Segmentation fault onStop
Posted: Tuesday 13 June 2017 23:15
Hi all,
I'm struggling with a intermittent segmentation fault when pushing the "Update" button in the hardware-page. I have a skeleton plugin (just showing the relevant parts, the rest is unchanged from the base template, except the plugin definition in the head):
Adding it works fine, it connects to my server (a simple telnet-server that responds with a json greeting). When selecting the plugin in the hardware list and pressing "Update", sometimes it stops and restarts the plugin as expected and sometimes domoticz dies with a segmentation fault. It varies how many times I can "update" before it seg-faults, but sooner or later it will:
Using the latest master branch, compiled on debian linux. I have noticed that on my development-machine (Mac), using python 3.6.1 I can update the plugin as many times as I like, but on my test-setup, using python 3.4.2, the seg-fault happens...
Regards,
M
I'm struggling with a intermittent segmentation fault when pushing the "Update" button in the hardware-page. I have a skeleton plugin (just showing the relevant parts, the rest is unchanged from the base template, except the plugin definition in the head):
Code: Select all
class BasePlugin:
enabled = False
coapAdaptor = None
def __init__(self):
return
def onStart(self):
Domoticz.Log("onStart called")
self.CoapAdapter = Domoticz.Connection(Name="Main", Transport="TCP/IP", Protocol="JSON", Address="127.0.0.1", Port="1234")
self.CoapAdapter.Connect()
def onMessage(self, Connection, Data, Status, Extra):
Domoticz.Log("onMessage called with data: {0}".format(Data))
#snipp#
Code: Select all
2017-06-13 23:09:18.790 (Test) Initialized version 1.0.0, author 'moroen'
2017-06-13 23:09:18.791 (Test) onStart called
2017-06-13 23:09:18.791 PluginSystem: Starting I/O service thread.
2017-06-13 23:09:18.841 (Test) onConnect called
2017-06-13 23:09:18.841 (Test) onMessage called with data: b'{"status": "Ok", "action": "clientConnect", "version": "0.1"}'
2017-06-13 23:09:20.290 (Test) Exiting work loop...
2017-06-13 23:09:20.296 (Test) onDisconnect called
2017-06-13 23:09:20.297 (Test) onStop called
2017-06-13 23:09:20.299 Error: CPluginTransport: Base handleRead invoked for Hardware 2
2017-06-13 23:09:20.361 (Test) Stopped.
2017-06-13 23:09:20.428 (Test) Initialized version 1.0.0, author 'moroen'
2017-06-13 23:09:20.429 (Test) onStart called
2017-06-13 23:09:20.429 PluginSystem: Starting I/O service thread.
2017-06-13 23:09:20.479 (Test) onConnect called
2017-06-13 23:09:20.479 (Test) onMessage called with data: b'{"status": "Ok", "action": "clientConnect", "version": "0.1"}'
2017-06-13 23:09:22.085 (Test) onDisconnect called
2017-06-13 23:09:22.085 (Test) onStop called
Segmentation fault

Regards,
M