• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Segmentation fault when using Socket API wrong
#1
Hi

just a small report: when accessing the Socket API incorrectly, pilight 8.1.5 may run into a Segfault:

when sending
Code:
{ "action": "request values" }


without sending 
Code:
{ "action": "identify" }


before, then the Segfault occurs. So workaround is to send the identify action before Wink

Code:
(/home/pilight/source/daemon-dev/daemon.c #496) [Aug 12 09:36:08:377049] DEBUG: broadcasted: {"message":{"id":13,"temperature":23.9,"humidity":56.0,"battery":1},"origin":"receiver","protocol":"alecto_ws1700","uuid":"0000-b8-27-eb-caec10","repeats":2}
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:08:613824] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:08:863850] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:09:114296] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:09:364588] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:09:614344] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:09:863973] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:10:114310] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/daemon.c #2549) [Aug 12 09:36:10:174185] DEBUG: cpu: 11.176309%
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:10:364141] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:10:614605] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:10:863810] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:11:114022] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:11:364241] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:11:613741] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:11:864619] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:12:114192] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:12:364098] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:12:613969] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:12:864148] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:13:114345] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/daemon.c #2549) [Aug 12 09:36:13:173380] DEBUG: cpu: 8.538665%
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:13:364077] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:13:614415] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/libs/pilight/lua_c/wiringx.c #438) [Aug 12 09:36:13:864594] DEBUG: lua wiringx on state #0
(/home/pilight/source/daemon-dev/daemon.c #1186) [Aug 12 09:36:13:928580] DEBUG: socket recv: { "action": "request values" }

Thread 13 "pilight-daemon" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x6fdfb470 (LWP 17506)]
0x767c740c in devices_values () from /usr/local/lib/libpilight.so
(gdb) backtrace
#0  0x767c740c in devices_values () from /usr/local/lib/libpilight.so
#1  0x0000f8d4 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) frame 1
#1  0x0000f8d4 in ?? ()
(gdb) frame 0
#0  0x767c740c in devices_values () from /usr/local/lib/libpilight.so


occurs on pilight-daemon version v8.1.5-nightly-c0a175e0  


Bye
Tom
 
Reply
#2
So RTFM  Cool



But also thanks for reporting Smile



Also, before using gdb install pilight-dbg instead of the regular pilight.



Can you post minimal example that triggers the error? I can't reproduce it here.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Issue send actions over Socket API in AdHoc network ggtrts 10 638 03-13-2019, 06:32 AM
Last Post: curlymo
  Wrong time after switch from DST Rschnauzer 2 261 10-29-2018, 06:00 PM
Last Post: Rschnauzer
Bug Bug report: segmentation fault using rule with AFTER woutput 3 2,463 11-22-2015, 12:27 PM
Last Post: woutput
  Kernel Fault - Raspberry Pi 2 simonsmart99 7 4,908 05-04-2015, 05:52 PM
Last Post: wo_rasp
  pilight-receive/socket receive DHT11 temp? geerttttt 1 1,692 06-11-2014, 11:02 PM
Last Post: curlymo
  Alot of false positives + wrong filter firmware reported bjornhallberg 3 1,814 06-11-2014, 05:02 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)