I'm currently trying to develop a plugin for Domoticz based on the zigpy python library. That library allow to be independent of the HW layer and provide a full Zigbee 3.0, ZHA stack .
Any hints would be welcome .
The library is based on asyncio , and in order to get it integrated into the Python Framework, I have dedicated a thread for that.
My current issue is related to sqlite access. And I get a systematic segmentation fault on an sql.execute() call when doing a SELECT statement. For instance during the Table Creation the same method is called, and there is no issue at all. Only when the first SELECT * from table statement is made that I get a full crash
In the here after crash stack:
line 54 is :
Code: Select all
result = self._cursor.execute(sql_statement)Code: Select all
sql_statement = CREATE TABLE IF NOT EXISTS devices (ieee ieee, nwk, status)Code: Select all
Aug 13 10:31:08 rasp domoticz[18067]: Fatal Python error: Segmentation fault
Aug 13 10:31:08 rasp domoticz[18067]: Current thread 0xaaf963a0 (most recent call first):
Aug 13 10:31:08 rasp domoticz[18067]: File "/var/lib/domoticz/plugins/Domoticz-Zigpy/zigpy/appdb.py", line 54 in execute
Aug 13 10:31:08 rasp domoticz[18067]: File "/var/lib/domoticz/plugins/Domoticz-Zigpy/zigpy/appdb.py", line 320 in _scan
Aug 13 10:31:08 rasp domoticz[18067]: File "/var/lib/domoticz/plugins/Domoticz-Zigpy/zigpy/appdb.py", line 373 in _load_devices
Aug 13 10:31:08 rasp domoticz[18067]: File "/var/lib/domoticz/plugins/Domoticz-Zigpy/zigpy/appdb.py", line 325 in load
Aug 13 10:31:08 rasp domoticz[18067]: File "/var/lib/domoticz/plugins/Domoticz-Zigpy/zigpy/application.py", line 53 in _load_db
Aug 13 10:31:08 rasp domoticz[18067]: File "/var/lib/domoticz/plugins/Domoticz-Zigpy/zigpy/application.py", line 61 in new
Aug 13 10:31:08 rasp domoticz[18067]: File "/var/lib/domoticz/plugins/Domoticz-Zigpy/plugin.py", line 138 in main
Aug 13 10:31:08 rasp domoticz[18067]: File "/usr/lib/python3.7/asyncio/events.py", line 88 in _run
Aug 13 10:31:08 rasp domoticz[18067]: File "/usr/lib/python3.7/asyncio/base_events.py", line 1786 in _run_once
Aug 13 10:31:08 rasp domoticz[18067]: File "/usr/lib/python3.7/asyncio/base_events.py", line 541 in run_forever
Aug 13 10:31:08 rasp domoticz[18067]: File "/usr/lib/python3.7/asyncio/base_events.py", line 574 in run_until_complete
Aug 13 10:31:08 rasp domoticz[18067]: File "/usr/lib/python3.7/asyncio/runners.py", line 43 in run
Aug 13 10:31:08 rasp domoticz[18067]: File "/var/lib/domoticz/plugins/Domoticz-Zigpy/plugin.py", line 183 in zigpy_thread
Aug 13 10:31:08 rasp domoticz[18067]: File "/usr/lib/python3.7/threading.py", line 870 in run
Aug 13 10:31:08 rasp domoticz[18067]: File "/usr/lib/python3.7/threading.py", line 926 in _bootstrap_inner
Aug 13 10:31:08 rasp domoticz[18067]: File "/usr/lib/python3.7/threading.py", line 890 in _bootstrap
Aug 13 10:31:08 rasp domoticz[18067]: Thread 0xb4fe93a0 (most recent call first):
Aug 13 10:31:08 rasp domoticz[18067]: Error: Domoticz(pid:18067, tid:18090('PluginMgr')) received fatal signal 11 (Segmentation fault)
Aug 13 10:31:08 rasp domoticz[18067]: Error: siginfo address=0x4693, address=0xaaf943ec
Aug 13 10:31:08 rasp domoticz[18067]: Error: Failed to start gdb, will use backtrace() for printing stack frame
Aug 13 10:31:08 rasp domoticz[18067]:
Aug 13 10:31:08 rasp domoticz[18067]: Error: #0 /usr/share/domoticz/beta-domoticz/domoticz() [0x2f598c]
Aug 13 10:31:08 rasp domoticz[18067]: Error: #1 /usr/share/domoticz/beta-domoticz/domoticz : signal_handler(int, siginfo_t*, void*) + 0x238 [0x2f63a8]
Aug 13 10:31:08 rasp domoticz[18067]: Error: #2 /lib/libc.so.6 : __default_rt_sa_restorer + 0 [0xb6947570]