-
Notifications
You must be signed in to change notification settings - Fork 896
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
nDPI proof of concept app runs under Windows, crashes under Linux #1526
Comments
How is the packet distribution done? |
packets are distributed between threads by hash of 5-tuple - packets for a given flow between 2 hosts always end up on the same thread, and when there are many flows at volume (the use case for this app) traffic load is more or less balanced between threads |
Can you share some of the backtraces? |
apologies for long delay replying... doesn't always crash in the same place, and this instance was compiled with --enable-sanitize. Not using a custom allocator. Doesn't look too useful, but here is a stacktrace : Thread 36 "SegmentAnalyze" received signal SIGSEGV, Segmentation fault. |
Are you sure that your C++ app was compiled with Those SIGSEGVs seems to be related to your implementation instead of libndpi. |
the strange thing is no issue under windows... the test is very simple: in the main thread, init detection module:
pass the detection module struct to each worker thread. each worker thread holds a map of flows, and each entry in the map holds a ndpi_flow_struct. Each packet is processed with:
is it safe to call:
if i wish to later reuse an ndpi_flow_struct? running the app under the windows memory checker shows no issues bt with line numbers:
|
Unfortunately, every thread need's it's own FYI: #1344 |
well that would be the issue -my bad |
Hi All,
I'm looking for help on getting a simple ndpi proof of concept app going under linux (ubuntu 20, x64). I have an existing packet processing application which has a plugin architecture. The app runs under both Windows and Linux. Under linux, the plugin is a shared .so library, and under Windows, a .dll. I have compiled ndpi as a platform specific static library, which i link into the .so or .dll depending on platform. This simple test, described below, appears to be working correctly under Windows. Under linux however, it seems to crash in random locations inside a call to ndpi_detection_process_packet(). The basic use of ndpi is:
on the main plugin thread, I simply initialize ndpi:
mutliple worker threads process packets independently; each thread has it's own flowmap and holds an instance of ndpi_detection_module_struct. Each entry in a thread's flowmap holds an instance of ndpi_flow_struct named tflow.
As each packet is processed, we hand it to ndpi for processing:
So, the same code runs on Windows, returning reasonable protocols, and crashes under Linux. GDB backtrace doesn't help too much, as the crash occurs at different locations and doesn't seem related to the line where the crash happens.
Does this sound familiar in any way? Any pointers on how to proceed at this point would be appreciated
Thanks!
The text was updated successfully, but these errors were encountered: