Closed mailych closed 3 years ago
I investigated this further. I build a debug version and with optimization 2 of MQTT-SNGateway
Ran it with gdb. Below is the back trace I have received
20200910 181731.046 DISCONNECT <--- x 02 18 20200910 181731.047 DISCONNECT ===> x E0 00 20200910 181731.047 DISCONNECT ---> x 02 18
[New LWP 20833] [New LWP 20834] [New LWP 20835] [New LWP 20836] [New LWP 20838] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `./MQTT-SNGateway'. Program terminated with signal SIGSEGV, Segmentation fault.
62 ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory. [Current thread is 1 (Thread 0x7f9da83fe700 (LWP 20837))] (gdb) bt
format=format@entry=0x55f690da4140 "%s \033[0m\033[0;33m%-18s%-6s\033[0m\033[0;37m%-34.32s \033[0m\033[0;34m%s\033[0m\033[0;37m\n", ap=ap@entry=0x7f9da83fdc50)
at vfprintf.c:1643
s=0x55f690fb3284 <gateway+164> "20200909 111125.044 \033[0m\033[0;33mRESERVED ===> \033[0m\033[0;37mClientPUB", ' ' <repeats 26 times>, "\033[0m\033[0;34m E0 00\033[0m\033[0;37m\n", flags=1, slen=18446744073709551615,
format=0x55f690da4140 "%s \033[0m\033[0;33m%-18s%-6s\033[0m\033[0;37m%-34.32s \033[0m\033[0;34m%s\033[0m\033[0;37m\n", args=0x7f9da83fdc50) at vsprintf_chk.c:82
(gdb)
Sorry, Please ignore this issue. The crash was caused because of local change in the code.
SN gateway crashes (Segmentation fault) on receiving disconnect requests from client. It doesn't always happen.
Issue can be reproduced by running MQTT-SNPub binary multiple times. This is part of package.
Below is last lines when issue happens
Issue can 20200911 062703.443 PUBLISH ===> ClientPUB 30 26 00 0C 74 79 34 74 77 2F 74 6F 70 69 63 32 70 75 62 6C 69 73 68 20 22 74 79 34 74 77 2F 74 6F 70 69 63 32 22 20 0A 20200911 062704.950 DISCONNECT <--- ClientPUB 02 18 20200911 062704.950 DISCONNECT ---> ClientPUB 02 18 20200911 062704.950 DISCONNECT ===> ClientPUB E0 00 Segmentation fault ~/projects$