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

After pressing the flows button ntopng crashes #5129

Closed
AngeloColucci opened this issue Mar 24, 2021 · 4 comments
Closed

After pressing the flows button ntopng crashes #5129

AngeloColucci opened this issue Mar 24, 2021 · 4 comments

Comments

@AngeloColucci
Copy link

Hello,
on our ntopng server we get the following error when click on flows menu:

Mar 24 15:13:45 ntopng-poc kernel: [600665.356300] ntopng[35951]: segfault at 7f3f8070ff10 ip 000056505db08a0f sp 00007f3e92c84cd0 error 6 in ntopng[56505d9a2000+453000]
Mar 24 15:13:46 ntopng-poc systemd[1]: ntopng.service: Main process exited, code=killed, status=11/SEGV
Mar 24 15:13:46 ntopng-poc systemd[1]: ntopng.service: Failed with result 'signal'.

Following the Ntopng version used:

Version: 4.3.210324 [Enterprise/Professional build]
GIT rev: dev:728ee37f4cfc7d12286f54dbd0b08cc10af13735:20210324
Pro rev: r3654
Built on: Ubuntu 18.04.5 LTS
System Id: 5D536F36B208AA8F
Platform: x86_64
Edition: Enterprise M
License Type: Permanent

I have attached the ntopng.conf. I've removed our subnet:

ntopng.conf.txt

@MatteoBiscosi
Copy link
Member

Hi @AngeloColucci I'm sorry but i'm unable to reproduce this issue, so please download this binary with debug symbols
https://www.dropbox.com/s/ddi7gjw39nhbr65/ntopng?dl=0
Run it in gdb as you normally do:
gdb --args /etc/ntopng/ntopng.conf
Then run it and wait until it crashes. When it crashes type 'bt' inside the (gdb) prompt and send me the output.
You can find detailed instructions here

@AngeloColucci
Copy link
Author

Hi Matteo,
following the output in gdb after segmentation fault, and the bt:

Thread 13 "ntopng" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc67fc700 (LWP 40927)]
nDPIStats::incStats (this=this@entry=0x7fffc67f4650, when=when@entry=0, proto_id=proto_id@entry=3, sent_packets=, sent_bytes=, rcvd_packets=, rcvd_bytes=0) at src/nDPIStats.cpp:267
267 src/nDPIStats.cpp: No such file or directory.
(gdb) bt
#0 nDPIStats::incStats (this=this@entry=0x7fffc67f4650, when=when@entry=0, proto_id=proto_id@entry=3, sent_packets=, sent_bytes=, rcvd_packets=, rcvd_bytes=0) at src/nDPIStats.cpp:267
#1 0x000055555565aaa9 in Flow::sumStats (this=this@entry=0x7ffeee06bfd0, ndpi_stats=ndpi_stats@entry=0x7fffc67f4650, status_stats=status_stats@entry=0x7fffc67f3f10) at src/Flow.cpp:2389
#2 0x00005555556683f5 in flow_sum_stats (flow=0x7ffeee06bfd0, user_data=, matched=0x7fffc67f3dc7) at src/NetworkInterface.cpp:4482
#3 0x0000555555639045 in GenericHash::walk (this=0x555559bac8c0, begin_slot=0x7fffc67f3e1c, walk_all=true, walker=0x5555556683c0 <flow_sum_stats(GenericHashEntry*, void*, bool*)>, user_data=0x7fffc67f3e20) at src/GenericHash.cpp:222
#4 0x000055555566da3a in NetworkInterface::getActiveFlowsStats (this=this@entry=0x55555667e460, ndpi_stats=ndpi_stats@entry=0x7fffc67f4650, stats=stats@entry=0x7fffc67f3f10, allowed_hosts=0x7fffc67f6440, h=h@entry=0x0,
p=p@entry=0x7fffb455d710) at src/NetworkInterface.cpp:4508
#5 0x000055555568f422 in ntop_get_active_flows_stats (vm=0x7fffb4784808) at src/LuaEngineInterface.cpp:3587
#6 0x00005555557677c6 in luaD_precall ()
#7 0x0000555555772f9d in luaV_execute ()
#8 0x0000555555767a9f in luaD_call ()
#9 0x0000555555767af1 in luaD_callnoyield ()
#10 0x0000555555766f12 in luaD_rawrunprotected ()
#11 0x0000555555767deb in luaD_pcall ()
#12 0x00005555557651a4 in lua_pcallk ()
#13 0x00005555556a3809 in __ntop_lua_handlefile (L=0x7fffb4784808, script_path=script_path@entry=0x7fffc67f6cf0 "/usr/share/ntopng/scripts/lua/flows_stats.lua", ex=ex@entry=true) at src/LuaEngine.cpp:337
#14 0x00005555556a66ad in LuaEngine::handle_script_request (this=this@entry=0x7fffb40bcfb0, conn=conn@entry=0x7fffb4000b20, request_info=request_info@entry=0x7fffb4000b20,
script_path=script_path@entry=0x7fffc67f6cf0 "/usr/share/ntopng/scripts/lua/flows_stats.lua", attack_attempt=attack_attempt@entry=0x7fffc67f6a78, user=user@entry=0x7fffc67f6b30 "angelocolucci", group=,
session_csrf=, localuser=true) at src/LuaEngine.cpp:1152
#15 0x000055555562df4f in handle_lua_request (conn=0x7fffb4000b20) at src/HTTPserver.cpp:1316
#16 0x0000555555626682 in handle_request (conn=conn@entry=0x7fffb4000b20) at src/../third-party/mongoose/mongoose.c:4443
#17 0x0000555555628338 in process_new_connection (conn=0x7fffb4000b20) at src/../third-party/mongoose/mongoose.c:5165
#18 worker_thread (thread_func_param=0x555556bfaa40) at src/../third-party/mongoose/mongoose.c:5259
#19 0x00007ffff64d86db in start_thread (arg=0x7fffc67fc700) at pthread_create.c:463
#20 0x00007ffff3daf71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thanks in advance for your support

@simonemainardi
Copy link
Contributor

are you using custom protocols?

Please type p proto_id inside the gdb (were you have typed bt) and report the output.

@AngeloColucci
Copy link
Author

Hi Simone,

are you using custom protocols?

I don't know how I can do that...

Following the print of proto_id field that you required:

(gdb) bt
#0 nDPIStats::incStats (this=this@entry=0x7fffbb7f6650, when=when@entry=0, proto_id=proto_id@entry=3, sent_packets=, sent_bytes=, rcvd_packets=, rcvd_bytes=0) at src/nDPIStats.cpp:267
#1 0x000055555565aaa9 in Flow::sumStats (this=this@entry=0x7ffe9064a570, ndpi_stats=ndpi_stats@entry=0x7fffbb7f6650, status_stats=status_stats@entry=0x7fffbb7f5f10) at src/Flow.cpp:2389
#2 0x00005555556683f5 in flow_sum_stats (flow=0x7ffe9064a570, user_data=, matched=0x7fffbb7f5dc7) at src/NetworkInterface.cpp:4482
#3 0x0000555555639045 in GenericHash::walk (this=0x555559aaa650, begin_slot=0x7fffbb7f5e1c, walk_all=true, walker=0x5555556683c0 <flow_sum_stats(GenericHashEntry*, void*, bool*)>, user_data=0x7fffbb7f5e20) at src/GenericHash.cpp:222
#4 0x000055555566da3a in NetworkInterface::getActiveFlowsStats (this=this@entry=0x55555654b570, ndpi_stats=ndpi_stats@entry=0x7fffbb7f6650, stats=stats@entry=0x7fffbb7f5f10, allowed_hosts=0x7fffbb7f8440, h=h@entry=0x0,
p=p@entry=0x7fffb457fa00) at src/NetworkInterface.cpp:4508
#5 0x000055555568f422 in ntop_get_active_flows_stats (vm=0x7fffb41002d8) at src/LuaEngineInterface.cpp:3587
#6 0x00005555557677c6 in luaD_precall ()
#7 0x0000555555772f9d in luaV_execute ()
#8 0x0000555555767a9f in luaD_call ()
#9 0x0000555555767af1 in luaD_callnoyield ()
#10 0x0000555555766f12 in luaD_rawrunprotected ()
#11 0x0000555555767deb in luaD_pcall ()
#12 0x00005555557651a4 in lua_pcallk ()
#13 0x00005555556a3809 in __ntop_lua_handlefile (L=0x7fffb41002d8, script_path=script_path@entry=0x7fffbb7f8cf0 "/usr/share/ntopng/scripts/lua/flows_stats.lua", ex=ex@entry=true) at src/LuaEngine.cpp:337
#14 0x00005555556a66ad in LuaEngine::handle_script_request (this=this@entry=0x7fffb40b7f40, conn=conn@entry=0x7fffb4000b20, request_info=request_info@entry=0x7fffb4000b20,
script_path=script_path@entry=0x7fffbb7f8cf0 "/usr/share/ntopng/scripts/lua/flows_stats.lua", attack_attempt=attack_attempt@entry=0x7fffbb7f8a78, user=user@entry=0x7fffbb7f8b30 "angelocolucci", group=,
session_csrf=, localuser=true) at src/LuaEngine.cpp:1152
#15 0x000055555562df4f in handle_lua_request (conn=0x7fffb4000b20) at src/HTTPserver.cpp:1316
#16 0x0000555555626682 in handle_request (conn=conn@entry=0x7fffb4000b20) at src/../third-party/mongoose/mongoose.c:4443
#17 0x0000555555628338 in process_new_connection (conn=0x7fffb4000b20) at src/../third-party/mongoose/mongoose.c:5165
#18 worker_thread (thread_func_param=0x555556a90900) at src/../third-party/mongoose/mongoose.c:5259
#19 0x00007ffff64d86db in start_thread (arg=0x7fffbb7fe700) at pthread_create.c:463
#20 0x00007ffff3daf71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb) p proto_id
$1 = 3

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

No branches or pull requests

3 participants