• 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
  Loop in piligth >98% CPU Rschnauzer 18 518 05-13-2021, 02:57 PM
Last Post: Rschnauzer
  Security Error Message in Firefox Rschnauzer 2 101 05-05-2021, 02:06 PM
Last Post: Rschnauzer
  hardware info lost after pilight restart Rschnauzer 3 194 03-17-2021, 11:44 AM
Last Post: Rschnauzer
Question pilight stopped working sl4m01 3 878 11-26-2020, 09:17 PM
Last Post: PPacman
  pilight-raw changes output format from 7 to 8 Rschnauzer 1 600 11-26-2020, 01:52 PM
Last Post: curlymo
Question pilight nightly webgui offline after some hours fleisch 4 608 10-26-2020, 05:19 PM
Last Post: fleisch
  rpi3 Buster Compile Error Nikau 9 2,398 03-26-2020, 08:47 AM
Last Post: tvdgeer
  pilight bugs Ascenion 1 614 03-23-2020, 06:29 PM
Last Post: curlymo
  [Solved] pilight service crashing on first webserver access after reboot VrahoK 20 4,234 12-21-2019, 09:46 AM
Last Post: curlymo
  pilight-control modify values coolinx 16 3,444 11-13-2019, 08:02 PM
Last Post: curlymo

Forum Jump:

Browsing: 1 Guest(s)