You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im trying to integrate Home Assistant with pilight.
You lib is used bij HaSS to connect to the API. For some reason pilight daemon crashes when this lib connects to it. See https://forum.pilight.org/showthread.php?tid=3218 for more info.
With this sample code:
REQUIREMENTS = ['pilight==0.1.1']
from pilight import pilight
host = "127.0.0.1"
port = 5001
pilight_client = pilight.Client(host=host, port=port)
The debug output of pilight is:
[Dec 09 20:39:35:338994] pilight-daemon: DEBUG: cpu: 0.076251%
[Dec 09 20:39:36:99890] pilight-daemon: DEBUG: new client, ip: 10.0.0.6, port: 33772
[Dec 09 20:39:36:100054] pilight-daemon: DEBUG: client fd: 17
[Dec 09 20:39:36:118482] pilight-daemon: DEBUG: new client, ip: 10.0.0.6, port: 33774
[Dec 09 20:39:36:118641] pilight-daemon: DEBUG: client fd: 18
Thread 1 "pilight-daemon" received signal SIGSEGV, Segmentation fault.
__GI_strcmp (p1=<optimized out>, p2=<optimized out>) at strcmp.c:38
38 strcmp.c: No such file or directory.
(gdb) backtrace
#0 __GI_strcmp (p1=<optimized out>, p2=<optimized out>) at strcmp.c:38
#1 0xb67c8c20 in request_handler (req=0x4b3b8) at /home/pi/repos/pilight/libs/pilight/core/webserver.c:892
#2 0xb67cba8c in client_read_cb (req=0x4b3b8, nread=0x4b7fc, buf=0x4b848 "{\"options\":") at /home/pi/repos/pilight/libs/pilight/core/webserver.c:1652
#3 0xb67abe54 in uv_custom_poll_cb (req=0x4b3b8, status=0, events=1) at /home/pi/repos/pilight/libs/pilight/core/eventpool.c:694
#4 0xb678a984 in uv__poll_io (loop=0xb6fa95f8 <default_loop_struct>, w=0x4b3ec, events=1) at /home/pi/repos/pilight/libs/libuv/unix/poll.c:64
#5 0xb6784224 in uv__io_poll (loop=0xb6fa95f8 <default_loop_struct>, timeout=2220) at /home/pi/repos/pilight/libs/libuv/unix/linux-core.c:400
#6 0xb677a8d8 in uv_run (loop=0xb6fa95f8 <default_loop_struct>, mode=UV_RUN_DEFAULT) at /home/pi/repos/pilight/libs/libuv/unix/core.c:362
#7 0x0001cb00 in main (argc=2, argv=0xbefff784) at /home/pi/repos/pilight-dev/pilight/daemon.c:3468
(gdb) frame 0
#0 __GI_strcmp (p1=<optimized out>, p2=<optimized out>) at strcmp.c:38
38 in strcmp.c
(gdb) frame 1
#1 0xb67c8c20 in request_handler (req=0x4b3b8) at /home/pi/repos/pilight/libs/pilight/core/webserver.c:892
892 } else if(strcmp(&conn->uri[(rstrstr(conn->uri, "/")-conn->uri)], "/") == 0) {
(gdb) frame 2
#2 0xb67cba8c in client_read_cb (req=0x4b3b8, nread=0x4b7fc, buf=0x4b848 "{\"options\":") at /home/pi/repos/pilight/libs/pilight/core/webserver.c:1652
1652 int x = request_handler(req);
(gdb) frame 3
#3 0xb67abe54 in uv_custom_poll_cb (req=0x4b3b8, status=0, events=1) at /home/pi/repos/pilight/libs/pilight/core/eventpool.c:694
694 custom_poll_data->read_cb(req, &custom_poll_data->recv_iobuf.len, custom_poll_data->recv_iobuf.buf);
(gdb) frame 4
Is your lib compatible with version 8 of pilight?
And is there anything I can do to fix this issue?
The text was updated successfully, but these errors were encountered:
Thank you for your bug report. Yes, the HTTP endpoint is not used by this python module. What you see is one of the bugs in the piligh library causing SEGFAULTS. Theoretically a SEGFAULT on the server side should never be triggered by a client message.
This bug is not the only error, depending on the string you send the pilight library reproducibly crashes. Fortunately this python module allows you to send only "valid" strings, besides the new bug you have found now ;-) This cannot be fixed in this python module and is addressed in the pilight library here.
Hello,
Im trying to integrate Home Assistant with pilight.
You lib is used bij HaSS to connect to the API. For some reason pilight daemon crashes when this lib connects to it. See https://forum.pilight.org/showthread.php?tid=3218 for more info.
With this sample code:
The debug output of pilight is:
Is your lib compatible with version 8 of pilight?
And is there anything I can do to fix this issue?
The text was updated successfully, but these errors were encountered: