• 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
pilight Error : default_sa_restorer_v2 & CPU High
My pilight session halted on 24th of June around 14:00.

Raspberry Pi Model B Rev. 2.0 512MB
Linux raspberrypi 4.4.11+ #888 Mon May 23 20:02:58 BST 2016 armv6l GNU/Linux
I'm running a manually compiled version. Which i cloned from development on 21st of june around 7:44am localtime the netherlands.
I'm running it with an altered alecto_wx500 protocol (enabling rain meter)

Only enabled these protocols:
CPU temp
Generic Switch
Kaku switch
kaku switch old
Hardware 433 GPIO
Hardware 433 LIRC

I've got a filter installed and DS18B20 and BP180 attached.
So i've gone to go through the logs

Message in pilight.err
[Jun 24 14:02:21:624575] pilight-daemon: -- STACKTRACE (5 FRAMES) --
[Jun 24 14:02:22:266767] pilight-daemon: __default_sa_restorer_v2       ip = 0xb6d45180, sp = 0x*******
[Jun 24 14:02:22:797679] pilight-daemon: broadcast                      ip =    0x*******, sp = 0x*******
[Jun 24 14:02:23:136320] pilight-daemon: start_thread                   ip = 0xb*******, sp = 0xb2*******
[Jun 24 14:02:23:411186] pilight-daemon: clone                          ip = 0x*******, sp = 0x*******
(i've replace the adresses with * )

Messages in pilight.log that get my attention
[Jun 22 02:21:44:636190] pilight-daemon: WARNING: (webserver) could not read /usr/local/share/pilight//nice ports,/Trinity.txt.bak
(not the cause of crash.. but what should i do with it?

Found it:
[Jun 24 12:02:03:371111] pilight-daemon: WARNING: cpu usage too high 88.399633%
[Jun 24 12:02:03:735340] pilight-daemon: WARNING: checking again in 10 seconds
[Jun 24 12:02:15:947036] pilight-daemon: cpu usage still too high 80.356485%, stopping
[Jun 24 12:02:16:349919] pilight-daemon: INFO: removed stale pid_file /var/run/pilight.pid

How come it remains on high CPU?
Does does it halt on pilight CPU usage or total CPU usage?
Can you post the full debug output from the crash? There should also be some kind of thread profiling there, which shows the thread that is responsible for the high CPU usage.

The pilight watchdog monitors pilight CPU usage, not total. So there is something happening in pilight that causes the high usage, which might be found in the debug output from the crash.

Additionally, you should use gdb to further debug the issue, as the stacktrace is not helpful as is it currently is. There are step-by-step instructions in the pilight manual on how to do this, but it may also be that the issue is fixed in the rewrite code. So it would be good if you could try that first and see if it still crashes.
I don't have full debug output because i'm new to debugging in pilight (other then just verifying protocol output).

Just to check:
- I've got gdb version: 7.7.1
- Cloned fresh copy of Development branch
- Copied my alecto_wx500.c into the correct libs folder
- Manually compiled with only protocols needed
- Started pilight with GDB
- Hope/wait for crash

- Is there any way to keep GDB running without having a terminal open? And automatically save output to file including backtraces?
I don't think so, depending on your setup you can probably minimize the window somehow though. I don't think you can make it automatically save the backtrace and all frames for you
I've found answer to question below..
You have to type 'Run' yourself !!

Appearantly I'm using GDB 7.7.1 which is a different version than mentioned in the Online pilight debug manual.

Therefore i don't know if output below is correct.
It's not showing "(gdb) run" but just "(gdb)"

root@raspberrypi:~# service pilight stop
root@raspberrypi:~# gdb --args pilight-daemon -D
GNU gdb (Raspbian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from pilight-daemon...done.

and it just stays that way

Please inform me if i'm doing this correctly.
Yes, that's the beginning. Now you need to follow the remaining steps in the instructions; the next step is to issue the "run" command at the (gdb) prompt to start the pilight-daemon in gdb (this is admittedly a little unclear in the manual, I'll do something about that soon). Then you just need to wait for the program to crash, once it does, keep following the instructions.

Possibly Related Threads...
Thread Author Replies Views Last Post
  pilight Nano USB interface curlymo 226 87,768 05-12-2019, 05:52 PM
Last Post: bitboy
  ERROR: The Broadcom 2835 GPIO 0 is not set to output mode stuckinger 10 259 05-07-2019, 09:11 PM
Last Post: curlymo
  problems compiling pilight on Odroid C2 WitchDoctor 101 5,966 03-14-2019, 09:01 PM
Last Post: curlymo
  High cpu usage Dergo 1 110 02-23-2019, 04:31 PM
Last Post: curlymo
  pilight 8 what chages for custom protocols? polo 11 2,126 02-15-2019, 06:22 PM
Last Post: polo
  v8.1.3 compile error without https fourty2 3 281 11-21-2018, 08:02 PM
Last Post: fourty2
  Assert error in v8.1.3-nightly-d2ee2d0d Ulrich.Arnold 4 265 10-24-2018, 09:28 PM
Last Post: curlymo
  pilight-debug shows nothing minhdomanh 3 322 10-18-2018, 07:01 AM
Last Post: felfert
  pilight-send and pilight-daemon DieterK 0 411 06-20-2018, 12:44 AM
Last Post: DieterK
  Lights not switched on or off by rules in pilight 8.1.0 rorie 22 1,724 06-12-2018, 03:56 PM
Last Post: curlymo

Forum Jump:

Browsing: 1 Guest(s)