Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runnng nfcapd/sfcapd simultaneously in WSL segfaults... #523

Closed
ken-adey opened this issue May 15, 2024 · 8 comments
Closed

Runnng nfcapd/sfcapd simultaneously in WSL segfaults... #523

ken-adey opened this issue May 15, 2024 · 8 comments

Comments

@ken-adey
Copy link

Hi Peter,
I'm trying to run both nfcapd and sfcapd (Version: 1.6.23) in a Windows 11 WSL V2 Ubuntu 22.05 distro.
They eventually SEGFAULT after about 5 or 10 minutes. They're also not actually processing any incoming flow data. Here's the dmesg logs:

[Wed May 15 19:00:01 2024] nfcapd[1364]: segfault at 9420 ip 0000000000009420 sp 00007ffe248e8f38 error 14 in nfcapd[5572a6b00000+3000]
[Wed May 15 19:00:01 2024] Code: Unable to access opcode bytes at RIP 0x93f6.
[Wed May 15 19:00:01 2024] potentially unexpected fatal signal 11.
[Wed May 15 19:00:01 2024] CPU: 9 PID: 1364 Comm: nfcapd Not tainted 5.15.146.1-microsoft-standard-WSL2 #1
[Wed May 15 19:00:01 2024] RIP: 0033:0x9420
[Wed May 15 19:00:01 2024] Code: Unable to access opcode bytes at RIP 0x93f6.
[Wed May 15 19:00:01 2024] RSP: 002b:00007ffe248e8f38 EFLAGS: 00010246
[Wed May 15 19:00:01 2024] RAX: 00007f878b0e0010 RBX: 00005572a8342ad0 RCX: 00000000000003e8
[Wed May 15 19:00:01 2024] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
[Wed May 15 19:00:01 2024] RBP: 00005572a83402c8 R08: 0000000000000035 R09: 00007ffe248e97a0
[Wed May 15 19:00:01 2024] R10: 0000000000000000 R11: 0000000000000000 R12: 00007ffe248ea8e0
[Wed May 15 19:00:01 2024] R13: 00005572a8342ad0 R14: 00007ffe248e97a0 R15: 00005572a83402c0
[Wed May 15 19:00:01 2024] FS: 00007f878bbc3740 GS: 0000000000000000
[Wed May 15 19:00:02 2024] sfcapd[1383]: segfault at 9420 ip 0000000000009420 sp 00007fff3dd3d548 error 14 in sfcapd[55653c880000+3000]
[Wed May 15 19:00:02 2024] Code: Unable to access opcode bytes at RIP 0x93f6.
[Wed May 15 19:00:02 2024] potentially unexpected fatal signal 11.
[Wed May 15 19:00:02 2024] CPU: 6 PID: 1383 Comm: sfcapd Not tainted 5.15.146.1-microsoft-standard-WSL2 #1
[Wed May 15 19:00:02 2024] RIP: 0033:0x9420
[Wed May 15 19:00:02 2024] Code: Unable to access opcode bytes at RIP 0x93f6.
[Wed May 15 19:00:02 2024] RSP: 002b:00007fff3dd3d548 EFLAGS: 00010246
[Wed May 15 19:00:02 2024] RAX: 00007f6a45d4e010 RBX: 000055653d3ef960 RCX: 000055653d3efa50
[Wed May 15 19:00:02 2024] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
[Wed May 15 19:00:02 2024] RBP: 000055653d3ed308 R08: 0000000000000035 R09: 00007fff3dd3d3f0
[Wed May 15 19:00:02 2024] R10: 00007fff3dd3dda0 R11: 0000000000000000 R12: 00007fff3dd3eee0
[Wed May 15 19:00:02 2024] R13: 000055653d3ef960 R14: 000055653d3ed300 R15: 000055653c893ad0
[Wed May 15 19:00:02 2024] FS: 00007f6a4674f740 GS: 0000000000000000

I can run one or the other just fine.

Please let me know what other info I can provide.

Ken....

@phaag
Copy link
Owner

phaag commented May 15, 2024

Hi Ken,
Do you have the command line, how you startup the two collectors?
Did you compile the code on the WSL Ubuntu?
I assume it makes no difference if sfcapd or nfcpad, but simply two collectors.
If you startup two collectors with -t 10 cycle time, does it crash after 10 or 20s?
Could you startup one of them in gdb?

% gdb nfcapd
gdb> run <you nfcapd arguments>

if it crashes in gdb, run

gdb > bt

send me the output of the gdb session.

@ken-adey
Copy link
Author

ken-adey commented May 16, 2024 via email

@ken-adey
Copy link
Author

ken-adey commented May 16, 2024 via email

@phaag
Copy link
Owner

phaag commented May 16, 2024

Hmm .. I do not understand the details of the WSL setup and why the libnfdump needs to be copied. If you found a suitable solution, that’s fine, otherwise my recommendation would be to disable the shared library in configure:

./configure …. —disable-shared

That links all code into the final binary. That may solve library issues.

@ken-adey
Copy link
Author

ken-adey commented May 16, 2024 via email

@phaag
Copy link
Owner

phaag commented May 17, 2024

Actually just running ldconfig should do the trick. Or recompile the binaries.

@ken-adey
Copy link
Author

ken-adey commented May 20, 2024 via email

@phaag
Copy link
Owner

phaag commented May 20, 2024

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants