• 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
#1
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

https://dl.dropboxusercontent.com/u/8949...ghtlog.txt

Hope you can help!!

Code:
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.
(gdb)
 
Reply
#2
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.
 
Reply
#3
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.

@tommybear1979,
Do you have the full log available ?

Under the assumption that both cases are related to each other:
1.
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.
2.
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.

@curlymo,
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 ?
 
Reply
#4
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?
 
Reply
#5
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.
 
Reply
#6
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
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  rpi3 Buster Compile Error Nikau 4 64 08-18-2019, 09:08 AM
Last Post: curlymo
  pilight Nano USB interface curlymo 228 94,064 07-10-2019, 06:14 PM
Last Post: curlymo
  ERROR: The Broadcom 2835 GPIO 0 is not set to output mode stuckinger 10 617 05-07-2019, 09:11 PM
Last Post: curlymo
  Connection lost, trying to reconnect — loop apartmedia 5 429 03-16-2019, 09:41 AM
Last Post: curlymo
  problems compiling pilight on Odroid C2 WitchDoctor 101 8,663 03-14-2019, 09:01 PM
Last Post: curlymo
  pilight 8 what chages for custom protocols? polo 11 2,655 02-15-2019, 06:22 PM
Last Post: polo
  v8.1.3 compile error without https fourty2 3 422 11-21-2018, 08:02 PM
Last Post: fourty2
  Assert error in v8.1.3-nightly-d2ee2d0d Ulrich.Arnold 4 429 10-24-2018, 09:28 PM
Last Post: curlymo
  pilight-debug shows nothing minhdomanh 3 470 10-18-2018, 07:01 AM
Last Post: felfert
  Infinite loop on sunrise rule caused by currentdatetime Trashware 18 1,558 10-14-2018, 03:41 PM
Last Post: kylex

Forum Jump:


Browsing: 1 Guest(s)