• 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] Crash on invalid config.json syntax
#1
...
 
Reply
#2
Can you post more information.
 
Reply
#3
I had a backtrace and how to reproduce in that post, but it's blank now…? I'll get a new bt later today.
 
Reply
#4
Ok, here it is:

Code:
martin@linux-027e:~/builds/pilight/rewrite>  sudo ./pilight-daemon -D
root's password:
[Mar 01 07:19:40:321044] pilight-daemon: ERROR: failed to read configuration from json data source
-- STACKTRACE (10 FRAMES) --
__restore_rt                   ip = 0x7f9f3f692870, sp = 0x7fffb03d4040
pthread_join                   ip = 0x7f9f3f68c431, sp = 0x7fffb03d4490
timer_thread_gc                ip =   0x4b55df, sp = 0x7fffb03d44f0
main_gc                        ip =   0x497ce1, sp = 0x7fffb03d4500
start_pilight                  ip =   0x499c19, sp = 0x7fffb03d4520
main                           ip =   0x499c5c, sp = 0x7fffb03d4ea0
__libc_start_main              ip = 0x7f9f3e77db05, sp = 0x7fffb03d4ed0
_start                         ip =   0x4926b9, sp = 0x7fffb03d4f90
                               ip =      (nil), sp = 0x7fffb03d4f98
segmentation fault

Backtrace:
Code:
linux-027e:/home/martin/builds/pilight/rewrite #  gdb --args ./pilight-daemon -D
GNU gdb (GDB; openSUSE 13.2) 7.8
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 "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
---Type <return> to continue, or q <return> to quit---
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...

warning: /etc/gdbinit.d/gdb-heap.py: No such file or directory
Reading symbols from ./pilight-daemon...done.
(gdb) run
Starting program: /home/martin/builds/pilight/rewrite/pilight-daemon -D
Got object file from memory but can't read symbols: File truncated.
Missing separate debuginfos, use: zypper install glibc-debuginfo-2.19-16.22.2.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[Mar 01 07:21:01:499126] pilight-daemon: ERROR: failed to read configuration from json data source

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff76bc431 in pthread_join () from /lib64/libpthread.so.0
Missing separate debuginfos, use: zypper install libdbus-1-3-debuginfo-1.8.16-16.1.x86_64 libgcc_s1-debuginfo-4.8.3+r212056-2.2.4.x86_64 libnl3-200-debuginfo-3.2.25-2.1.2.x86_64 libpcap1-debuginfo-1.6.2-1.2.x86_64 libstdc++6-debuginfo-4.8.3+r212056-2.2.4.x86_64 libudev1-debuginfo-210.1453291613.c8d5bdf-25.30.1.x86_64 libunwind-debuginfo-1.1-10.3.1.x86_64 libusb-1_0-0-debuginfo-1.0.19-2.1.2.x86_64
(gdb) bt
#0  0x00007ffff76bc431 in pthread_join () from /lib64/libpthread.so.0
#1  0x00000000004b55df in timer_thread_gc ()
    at /home/martin/builds/pilight/rewrite/libs/pilight/core/timerpool.c:343
#2  0x0000000000497ce1 in main_gc () at /home/martin/builds/pilight/rewrite/daemon.c:1750
#3  0x0000000000499c19 in start_pilight (argc=2, argv=0x7fffffffe2c8)
    at /home/martin/builds/pilight/rewrite/daemon.c:2557
#4  0x0000000000499c5c in main (argc=2, argv=0x7fffffffe2c8)
    at /home/martin/builds/pilight/rewrite/daemon.c:2724
(gdb) frame 4
#4  0x0000000000499c5c in main (argc=2, argv=0x7fffffffe2c8)
    at /home/martin/builds/pilight/rewrite/daemon.c:2724
2724            int ret = start_pilight(argc, argv);
(gdb) frame 3
#3  0x0000000000499c19 in start_pilight (argc=2, argv=0x7fffffffe2c8)
    at /home/martin/builds/pilight/rewrite/daemon.c:2557
2557                    main_gc();
(gdb) frame 2
#2  0x0000000000497ce1 in main_gc () at /home/martin/builds/pilight/rewrite/daemon.c:1750
1750            timer_thread_gc();
(gdb) frame 1
#1  0x00000000004b55df in timer_thread_gc ()
    at /home/martin/builds/pilight/rewrite/libs/pilight/core/timerpool.c:343
343             pthread_join(pth, NULL);
(gdb)

Can be reproduced by invalidating the JSON syntax of config.json by removing a comma somewhere.
 
Reply
#5
For the lazy ones, can you post an example config Smile
 
Reply
#6
Attached Smile


Attached Files
.txt   config.json.txt (Size: 744 bytes / Downloads: 11)
 
Reply
#7
Hmm, can't confirm:
Code:
# ./pilight-daemon -D -C ../config5.json
[Mar 01 19:50:13:154546] pilight-daemon: ERROR: failed to read configuration from json data source
[Mar 01 19:50:13:155229] pilight-daemon: DEBUG: garbage collected event operator library
[Mar 01 19:50:13:155354] pilight-daemon: DEBUG: garbage collected event action library
[Mar 01 19:50:13:155433] pilight-daemon: DEBUG: garbage collected event function library
[Mar 01 19:50:13:155493] pilight-daemon: DEBUG: garbage collected events library
[Mar 01 19:50:13:155567] pilight-daemon: DEBUG: garbage collected fcache library
[Mar 01 19:50:13:155640] pilight-daemon: DEBUG: garbage collected sha256cache library
[Mar 01 19:50:13:155705] pilight-daemon: DEBUG: garbage collected webserver library
[Mar 01 19:50:13:155768] pilight-daemon: DEBUG: garbage collected datetime library
[Mar 01 19:50:13:155855] pilight-daemon: DEBUG: garbage collected options library
[Mar 01 19:50:13:155926] pilight-daemon: DEBUG: garbage collected socket library
[Mar 01 19:50:13:155993] pilight-daemon: DEBUG: [Z-Wave]: closing and freeing z-wave modules, please wait...
[Mar 01 19:50:13:156082] pilight-daemon: DEBUG: garbage collected config hardware library
[Mar 01 19:50:13:156155] pilight-daemon: DEBUG: garbage collected config rules library
[Mar 01 19:50:13:156220] pilight-daemon: DEBUG: garbage collected config storage library
[Mar 01 19:50:13:157656] pilight-daemon: DEBUG: garbage collected protocol library
[Mar 01 19:50:13:157792] pilight-daemon: DEBUG: garbage collected ntp library
[Mar 01 19:50:13:157876] pilight-daemon: DEBUG: garbage collected threads library
[Mar 01 19:50:13:157946] pilight-daemon: DEBUG: garbage collected wiringX library
[Mar 01 19:50:13:158016] pilight-daemon: DEBUG: garbage collected dso library
DEBUG: garbage collected log library
 
Reply
#8
The garbage collection doesn't work properly for me it seems.
 
Reply
#9
I get the same error after some random time. I was not able to link this to an specific event. Maybe it happens on receiving a protocol an changing the state.

It always occured when i restarted the daemon by "service pilight restart". Most of the time I did this because it used the whole cpu (~95%). A random (i think so far it's random) state is set to an invalid value. For me it was "down" instead of "off".

I will attach files when it occurs again.
 
Reply
#10
I have a different interessting issue:
After recompilation pilight stumbles across the following line
Code:
"gpio-platform": "raspberrypi1b2",
No clue how that line made it into ./res/config/config.json-default.
(I typically overwrite config.json with some of my own configuration files at the end of each compilation).
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  invalid: operator "==" does not exist ma-ca 2 858 01-20-2018, 10:40 AM
Last Post: ma-ca
  [Solved] openSUSE 13.2 "pilight-daemon -H" segfault pilino1234 2 1,894 04-22-2016, 08:39 AM
Last Post: pilino1234
Bug [Solved] no gpio-platform configured koos147 5 7,953 04-20-2016, 08:01 PM
Last Post: ksmedts
  [Solved] First transmission causes full cpu usage andiwand 11 4,536 04-19-2016, 06:16 AM
Last Post: curlymo
  [Solved] Compilation error under openSUSE pilino1234 4 2,156 04-16-2016, 08:23 AM
Last Post: pilino1234
  [Solved] pilight-receive fills log with empty DEBUG messages pilino1234 1 1,634 04-12-2016, 07:29 PM
Last Post: curlymo
  [Solved] wiringX initialisation error ksmedts 6 4,404 04-11-2016, 08:06 PM
Last Post: ksmedts
  [Solved] Time Stamp Information wo_rasp 5 2,319 03-05-2016, 11:29 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)