OpenZWave / ozw-admin

OpenZWave Gui
GNU General Public License v3.0
63 stars 9 forks source link

opening configuration window before starting a local or remote connection crashes ozw-admin #42

Closed rudybroersma closed 4 years ago

rudybroersma commented 4 years ago

I'm trying to migrate away from Z-Wave integrated in HASS to qt-openzwave. I started container with these parameters:

docker run -it --restart always --name ozwdaemon --security-opt seccomp=unconfined --device=/dev/ttyAMAzwave -v /opt/ozw/config:/opt/ozw -e MQTT_SERVER="192.168.178.250" -e USB_PATH=/dev/ttyAMAzwave -p1983:1983 -p 5901:5901 -p7800:7800 openzwave/ozwdaemon:allinone-latest

The container starts and I can connect to port 7800 and start VNC. Then as soon as I click on 'Configuration' from the File menu, the VNC connection is closed and I see that ozw-admin was terminated:

2020-06-09 10:18:35,994 INFO success: ozw-admin entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-06-09 10:18:35,995 INFO success: websockify entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-06-09 10:18:44,321 INFO success: ozwdaemon entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)
2020-06-09 10:18:59,362 INFO exited: ozw-admin (terminated by SIGSEGV (core dumped); not expected)
2020-06-09 10:18:59,374 INFO spawned: 'ozw-admin' with pid 25
2020-06-09 10:19:00,372 INFO success: ozw-admin entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-06-09 10:20:50,169 INFO exited: ozw-admin (terminated by SIGSEGV (core dumped); not expected)
2020-06-09 10:20:51,181 INFO spawned: 'ozw-admin' with pid 27
2020-06-09 10:20:52,538 INFO success: ozw-admin entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

I can reproduce this over and over.

The same issue occurs when I click on 'Open', enter /dev/ttyAMAzwave as device and click on 'Start'. As soon as I click on Start, the VNC connection is closed and ozw-admin is terminated by SIGSEGV.

I created /opt/ozw/crashes and /opt/ozw/config/crashes but I see no core-dumps.

The same occurs when I manually start ozwadmin from within the container and specify a device:

root@8a93fdf8d34e:/opt/ozw# /usr/local/bin/ozwadmin -platform vnc:port=5901 -s /dev/ttyAMAzwave
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
ozwadmin: Checking  "/opt/ozw/"  for manufacturer_specific.xml
ozwadmin: Checking  "/opt/ozw/"  for options.xml
ozwadmin: DBPath:  "/opt/ozw/"
ozwadmin: userPath:  "/opt/ozw/"
[20200609 10:24:37.898 UTC] [default] [warning]: QVncServer created on port 5901
[20200609 10:24:37.913 UTC] [ozwadmin] [debug]: Doing Local Connection:  "/dev/ttyAMAzwave" false
[20200609 10:24:37.916 UTC] [ozw.manager] [debug]: Database Path:  "/opt/ozw/"  User Path "/opt/ozw/"
[20200609 10:24:37.916 UTC] [ozw.manager] [debug]: OpenZWave Options Class Creating
[20200609 10:24:37.917 UTC] [ozw.manager] [debug]: OpenZWave Options Class Set
[20200609 10:24:37.917 UTC] [ozw.manager] [debug]: Models Created
[20200609 10:24:37.917 UTC] [ozw.manager] [debug]: QTOZWManager Ready!
[20200609 10:24:37.917 UTC] [ozwadmin] [debug]: QTOZW Ready
[20200609 10:24:37.917 UTC] [ozwadmin] [debug]: Updating Option  "ConfigPath"  to  QVariant(QString, "/opt/ozw/")
[20200609 10:24:37.918 UTC] [ozwadmin] [debug]: Updating Option  "UserPath"  to  QVariant(QString, "/opt/ozw/")
[20200609 10:24:38.085 UTC] [ozw.manager] [debug]: QTOZWLog Ready!
Segmentation fault (core dumped)

Any ideas?

rudybroersma commented 4 years ago

I found the core dump. Attached. coredump.zip

Should it help:

root@8a93fdf8d34e:/tmp# gdb --args /usr/local/bin/ozwadmin -platform vnc:port=5901 -s /dev/ttyAMAzwave
GNU gdb (Debian 9.2-1) 9.2
Copyright (C) 2020 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/bin/ozwadmin...
(No debugging symbols found in /usr/local/bin/ozwadmin)
(gdb) r
Starting program: /usr/local/bin/ozwadmin -platform vnc:port=5901 -s /dev/ttyAMAzwave
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
ozwadmin: Checking  "/opt/ozw/"  for manufacturer_specific.xml
ozwadmin: Checking  "/opt/ozw/"  for options.xml
ozwadmin: DBPath:  "/opt/ozw/"
ozwadmin: userPath:  "/opt/ozw/"
[20200609 10:32:47.784 UTC] [default] [warning]: QVncServer created on port 5901
[20200609 10:32:47.798 UTC] [ozwadmin] [debug]: Doing Local Connection:  "/dev/ttyAMAzwave" false
[20200609 10:32:47.801 UTC] [ozw.manager] [debug]: Database Path:  "/opt/ozw/"  User Path "/opt/ozw/"
[20200609 10:32:47.802 UTC] [ozw.manager] [debug]: OpenZWave Options Class Creating
[20200609 10:32:47.802 UTC] [ozw.manager] [debug]: OpenZWave Options Class Set
[20200609 10:32:47.802 UTC] [ozw.manager] [debug]: Models Created
[20200609 10:32:47.802 UTC] [ozw.manager] [debug]: QTOZWManager Ready!
[20200609 10:32:47.802 UTC] [ozwadmin] [debug]: QTOZW Ready
[20200609 10:32:47.802 UTC] [ozwadmin] [debug]: Updating Option  "ConfigPath"  to  QVariant(QString, "/opt/ozw/")
[20200609 10:32:47.802 UTC] [ozwadmin] [debug]: Updating Option  "UserPath"  to  QVariant(QString, "/opt/ozw/")
[20200609 10:32:47.988 UTC] [ozw.manager] [debug]: QTOZWLog Ready!

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7eeeb40 in QTOZWLog::getLogCount (this=0x555555cc7350) at source/qtozwlog.cpp:132
132     source/qtozwlog.cpp: No such file or directory.
Fishwaldo commented 4 years ago

Firstly - When connecting to the VNC interface, you should do a "Network" connection to localhost rather than trying to open the serial port. (Will look at removing/hiding the serial port option on the allinone in the future).

ozwdaemon is also running, and it will be using the serial port - So nothing ever good will happen if ozw-admin is also trying to open the serial port.

As for the config window crash - I'm working on that (opening it before opening a serial port or remote connection) - but for ozwdaemon - Any changes you want to make to how its running, should be via the Options.xml file in the User directory, or ozwdaemon.ini (for things as yet undocumented!)

rudybroersma commented 4 years ago

Ah, thanks. I guess I didn't understand the different parts of the system and that ozw-admin needs to connect to ozwdaemon. Sorry for that.

Fishwaldo commented 4 years ago

Opening the Config window shouldn't crash now