• 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
[split] pilight Error : pilight hangs in a loop
I've got something.
pilight got in a loop stating:

ssdp sent search
no pilight ssdp connections found
connection to main pilight daemon lost
trying to reconnect...

Then i got out of the loop with CTRL+C
and ran backtrace and frames


Hope you can help!!

pilight-daemon: NOTICE: trying to reconnect...
pilight-daemon: DEBUG: ssdp sent search

Program received signal SIGINT, Interrupt.
0xb6ddd360 in nanosleep () at ../sysdeps/unix/syscall-template.S:81
81      ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) backtrace
#0  0xb6ddd360 in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1  0xb6ddd098 in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:137
#2  0x00024b7c in pilight_stats (param=0x0) at /root/pilight/daemon.c:2067
#3  0x00026328 in main (argc=2, argv=0xbefffd74) at /root/pilight/daemon.c:2801
(gdb) frame 3
#3  0x00026328 in main (argc=2, argv=0xbefffd74) at /root/pilight/daemon.c:2801
2801                    pilight_stats((void *)NULL);
(gdb) frame 2
#2  0x00024b7c in pilight_stats (param=0x0) at /root/pilight/daemon.c:2067
2067                    sleep(1);
(gdb) frame 1
#1  0xb6ddd098 in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:137
137     ../sysdeps/unix/sysv/linux/sleep.c: No such file or directory.
(gdb) frame 0
#0  0xb6ddd360 in nanosleep () at ../sysdeps/unix/syscall-template.S:81
81      ../sysdeps/unix/syscall-template.S: No such file or directory.
A loop is not an error. It's just a recurring attempt to find other daemon. If you want to prevent this, you can always set this one into standalone mode, but you will have to supply an IP and server to be able to connect to that specific daemon with pilight-receive and such.
I have split the thread.

It could be that the symptoms of your 2nd post are related to the same issue, but the 2nd post is "wanted" behaviour, e.q. pilight is hanging in a loop, as it can not establish a ssdp connection.
I do assume that the sleep(1) timer is the root reason that the high CPU condition is not triggered, I also think that the loop in itself is correct, and that another error condition is present.

Whereas in your 1st post pilight ends up with "unwanted" high CPU usage and thus terminates itself "gracefully".

It may be that the problems are related to each other and that the underlying problem is the same, but that may not be the case. In any case we do want to identify the code segment responsible for a high CPU condition / causing pilight to hang, etc.

The log states that pilight is trying to establish a ssdp connection. The reason why it can't do that is unclear, as the respective part of the pilight log is not available for analysis.

Do you have the full log available ?

Under the assumption that both cases are related to each other:
I do assume that the difference to both cases is that due to the fact that the variable stats is not set to "1" the sleep(1) timer saves us from triggering the high CPU condition.
That there is a network issue and pilight might try to deal with the issue but gets caught in a loop without a sleep() timer, thus CPU cycles are burnt, and after 10 secs pilight gracefully takes the eit.

Could the loop in libs/pilight/core/ssdp.c, starting at L184 be causing such behaviour ?
If the answer is yes, what do you suggest to detect such an unwanted state ?
I don't have full logs available because my terminal scrollback wasn't long enough.
Are there tips regarding the fetching of logs? 
Can i automatically let gdb write to file? 
Can i automatically let gdb do a backtrace/frame sequence once pilight has halted?
Have you checked the following locations:
/var/log/pilight.log and /var/log/pilight.err ?
(or whereever you have configured in the settings section of config.json to save the pilight.log file)

Once pilight has "crashed", and it is running under gdb control, you can use gdb to investigate further.
pilight logs lost.. but i've started again with GDB so i'm hoping that it will occur again today after which i will directly fetch the logs

Possibly Related Threads...
Thread Author Replies Views Last Post
  rpi3 Buster Compile Error Nikau 9 1,145 03-26-2020, 08:47 AM
Last Post: tvdgeer
  pilight bugs Ascenion 1 211 03-23-2020, 06:29 PM
Last Post: curlymo
  [Solved] pilight service crashing on first webserver access after reboot VrahoK 20 1,740 12-21-2019, 09:46 AM
Last Post: curlymo
  pilight-control modify values coolinx 16 1,514 11-13-2019, 08:02 PM
Last Post: curlymo
  Bug: double free or corruption in pilight-send blackzombie 12 1,361 10-07-2019, 08:15 PM
Last Post: blackzombie
  [Fixed] High CPU usage when pilight usb nano disconnects DieterK 1 536 08-13-2019, 05:43 PM
Last Post: curlymo
  pilight Nano USB interface curlymo 228 118,010 07-10-2019, 06:14 PM
Last Post: curlymo
  ERROR: The Broadcom 2835 GPIO 0 is not set to output mode stuckinger 10 1,740 05-07-2019, 09:11 PM
Last Post: curlymo
  Connection lost, trying to reconnect — loop apartmedia 5 1,187 03-16-2019, 09:41 AM
Last Post: curlymo
  problems compiling pilight on Odroid C2 WitchDoctor 101 17,360 03-14-2019, 09:01 PM
Last Post: curlymo

Forum Jump:

Browsing: 1 Guest(s)