• 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
[SOLVED] Triggering generic_switch leads to segfault
#1
Click to edit


Attached Files
.txt   log1std.txt (Size: 137.92 KB / Downloads: 2)
 
Reply
#2
I have no issues when testing it here in my local setup. Can you post a debug log as described in the manual?
https://manual.pilight.org/development/debugging.html
 
Reply
#3
(10-08-2019, 09:34 PM)curlymo Wrote: I have no issues when testing it here in my local setup. Can you post a debug log as described in the manual?
https://manual.pilight.org/development/debugging.html

Hi!

I've tested to switch one clarus-switch without the generic-switch and rule. This works fine.

With the gerneric-switch i get the following gdb-log:
Code:
[Oct 09 11:53:03:310459] DEBUG: socket write succeeded: {"origin":"update","type":1,"uuid":"0000-b8-27-eb-cd7a82","devices":["Diele"],"values":{"timestamp":1570621983,"state":"on"}}

[Oct 09 11:53:03:310546] DEBUG: broadcasted: {"origin":"update","type":1,"uuid":"0000-b8-27-eb-cd7a82","devices":["Diele"],"values":{"timestamp":1570621983,"state":"on"}}
[Oct 09 11:53:03:310745] DEBUG: socket write succeeded: {"origin":"sender","protocol":"generic_switch","message":{"id":99,"state":"on"},"repeat":1,"uuid":"0000-b8-27-eb-cd7a82"}

[Oct 09 11:53:03:310796] DEBUG: broadcasted: {"origin":"sender","protocol":"generic_switch","message":{"id":99,"state":"on"},"repeat":1,"uuid":"0000-b8-27-eb-cd7a82"}
[Oct 09 11:53:03:313887] DEBUG: lua thread on state #1
[Oct 09 11:53:03:314121] INFO: executed rule: DieleAn
[Oct 09 11:53:03:314164] DEBUG: lua thread on state #0
[Oct 09 11:53:03:314178] DEBUG: rule #48 DieleAn was parsed in 0.000899 seconds
[Oct 09 11:53:03:314381] DEBUG: rule #49 DieleAus was parsed in 0.000076 seconds
[Oct 09 11:53:03:315115] DEBUG: **** RAW CODE ****
180 540 540 180 180 540 180 540 180 540 540 180 180 540 540 180 180 540 180 540 180 540 540 180 180 540 540 180 180 540 540 180 180 540 180 540 540 180 540 180 180 540 180 540 540 180 540 180 180 6120
[Oct 09 11:53:03:315270] DEBUG: **** RAW CODE ****
[Oct 09 11:53:03:316321] DEBUG: **** RAW CODE ****
[Oct 09 11:53:03:316413] DEBUG: lua async on state #0
180 540 540 180 180 540 180 540 180 540 540 180 180 540 540 180 180 540 180 540 180 540 540 180 180 540 540 180 180 540 540 180 540 180 540 180 180 540 180 540 180 540 180 540 540 180 540 180 180 6120
[Oct 09 11:53:03:316503] DEBUG: **** RAW CODE ****
[Oct 09 11:53:03:316910] DEBUG: socket write succeeded: {"origin":"update","type":1,"uuid":"0000-b8-27-eb-cd7a82","devices":["SteckdoseRund1"],"values":{"timestamp":1570621983,"state":"on"}}

[Oct 09 11:53:03:317032] DEBUG: broadcasted: {"origin":"update","type":1,"uuid":"0000-b8-27-eb-cd7a82","devices":["SteckdoseRund1"],"values":{"timestamp":1570621983,"state":"on"}}
[Oct 09 11:53:03:317227] DEBUG: socket write succeeded: {"origin":"sender","protocol":"clarus_switch","message":{"id":"A3","unit":18,"state":"on"},"repeat":1,"uuid":"0000-b8-27-eb-cd7a82"}

[Oct 09 11:53:03:317318] DEBUG: broadcasted: {"origin":"sender","protocol":"clarus_switch","message":{"id":"A3","unit":18,"state":"on"},"repeat":1,"uuid":"0000-b8-27-eb-cd7a82"}
[Oct 09 11:53:03:318123] DEBUG: lua async on state #0
[Oct 09 11:53:03:318582] DEBUG: socket write succeeded: {"origin":"update","type":1,"uuid":"0000-b8-27-eb-cd7a82","devices":["SteckdoseRund2"],"values":{"timestamp":1570621983,"state":"on"}}

[Oct 09 11:53:03:318661] DEBUG: broadcasted: {"origin":"update","type":1,"uuid":"0000-b8-27-eb-cd7a82","devices":["SteckdoseRund2"],"values":{"timestamp":1570621983,"state":"on"}}
[Oct 09 11:53:03:318874] DEBUG: socket write succeeded: {"origin":"sender","protocol":"clarus_switch","message":{"id":"B3","unit":18,"state":"on"},"repeat":1,"uuid":"0000-b8-27-eb-cd7a82"}

[Oct 09 11:53:03:318927] DEBUG: broadcasted: {"origin":"sender","protocol":"clarus_switch","message":{"id":"B3","unit":18,"state":"on"},"repeat":1,"uuid":"0000-b8-27-eb-cd7a82"}
[Oct 09 11:53:03:416259] DEBUG: lua timer on state #0
[Oct 09 11:53:03:663302] DEBUG: lua timer on state #0

Thread 1 "pilight-daemon" received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/arm/armv6/strlen.S:26
26    ../sysdeps/arm/armv6/strlen.S: Datei oder Verzeichnis nicht gefunden.


(gdb) backtrace
#0  strlen () at ../sysdeps/arm/armv6/strlen.S:26
#1  0x76585ba8 in lua_getfield ()
  from /usr/lib/arm-linux-gnueabihf/libluajit-5.1.so.2
#2  0x7682cd28 in ?? () from /usr/local/lib/libpilight.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Uli
 
Reply
#4
Please install the pilight-dbg version before testing?
 
Reply
#5
(10-09-2019, 06:40 PM)curlymo Wrote: Please install the pilight-dbg version before testing?

Hi!

I did the following:

apt-get update
apt-get install pilight-dbg
gdb --args pilight-daemon -D

This gets:
Code:
Thread 1 "pilight-daemon" received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/arm/armv6/strlen.S:26
26    ../sysdeps/arm/armv6/strlen.S: Datei oder Verzeichnis nicht gefunden.
(gdb)


(gdb) backtrace
#0  strlen () at ../sysdeps/arm/armv6/strlen.S:26
#1  0x7657dba8 in lua_getfield ()
  from /usr/lib/arm-linux-gnueabihf/libluajit-5.1.so.2
#2  0x768278e4 in timer_callback (req=<optimized out>)
   at /home/pilight/source/daemon-dev/libs/pilight/lua_c/async/timer.c:387
#3  0x7678e8a8 in uv__run_timers (
   loop=loop@entry=0x76f9d598 <default_loop_struct>)
   at /home/pilight/source/daemon-dev/libs/libuv/unix/timer.c:165
#4  0x7677fd54 in uv_run (loop=0x76f9d598 <default_loop_struct>,
   mode=mode@entry=UV_RUN_DEFAULT)
   at /home/pilight/source/daemon-dev/libs/libuv/unix/core.c:353
#5  0x0000b898 in main (argc=<optimized out>, argv=<optimized out>)
   at /home/pilight/source/daemon-dev/daemon.c:3512
(gdb)

I hope that helps

Uli
 
Reply
#6
I just can't seem to reproduce it. What version did you install?
 
Reply
#7
(10-10-2019, 12:29 PM)curlymo Wrote: I just can't seem to reproduce it. What version did you install?

The latest available nightly 8.1.5-37
 
Reply
#8
Are you sure it's just switching the Diele that should trigger the error? I'm asking this because the Diele change in itself doesn't trigger any timer anywhere.
 
Reply
#9
Another possibility is to start installing one version after another starting from 8.1.5 to see what change caused the error.
 
Reply
#10
(10-13-2019, 11:19 AM)curlymo Wrote: Another possibility is to start installing one version after another starting from 8.1.5 to see what change caused the error.

Hi curlymo

Yes i already did some testing today. 8.1.5-10 works fine,  the problem starts with 8.1.5-28.

I also could narrow down the cause. The generic-switch is not the problem, there are many generic switches in my config, which work fine. The problem is in the rules, which changes multiple devices at once (... THEN switch DEVICE a AND b TO on).

I remember there was a problem with this, the devices did not react without introducing a AFTER clause. This was solved in 8.1.4 nightly. Maybe there is some connection in this area.

Uli
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  ][solved]Segfault when retrieving big chunked http message Niek 21 5,863 11-29-2018, 03:17 PM
Last Post: curlymo
  http code 301 causes segfault Niek 3 3,343 08-14-2018, 06:57 PM
Last Post: curlymo
  Long label text causes segfault Niek 10 1,330 06-29-2018, 02:18 PM
Last Post: Niek
  [Solved] config.json not updated Niek 6 1,522 12-31-2017, 03:19 PM
Last Post: curlymo
  [Solved] callback not executing when dns lookup fails Niek 1 645 10-08-2017, 11:44 AM
Last Post: curlymo
  [Solved] Rules switching state based on another device state not working apartmedia 6 2,474 09-27-2017, 01:41 PM
Last Post: apartmedia
  [Solved] connection to main pilight daemon lost TopdRob 20 4,249 09-17-2017, 04:30 PM
Last Post: curlymo
  [Solved] dimmer protocol kaku_dimmer does not react on dimmervalue apartmedia 25 4,075 09-16-2017, 10:29 PM
Last Post: apartmedia
  [Solved] Webgui not working in IE Ulrich.Arnold 7 1,791 09-12-2017, 05:22 PM
Last Post: Ulrich.Arnold
  [Solved] Sunriseset v7 fails after update and gives negative values PPacman 7 1,686 09-06-2017, 06:25 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)