On two occasions I've noticed that Domoticz crashes reporting signal 11, (segmentation fault) when executing python code using the plugin framework.
As far as I can tell, there is no error in the Python code. In both occasions, it happens if I pass data, returned from a Domoticz function to another function. So there appears to be something gone wrong with memory allocation on the returned data. I've put the easiest to understand example below.
In this scenario, I add a new level to a multilevel switch. After this, if you request the Level options, Domoticz crashes when you try to access the data. After I restart domoticz, I can handle the level options, until I add a new level. This is 100% reproducable for me.
Code to add a level:
Code: Select all
def addListeningMode(strCode):
nValue = Devices[MAINLISTENINGMODE].nValue
sValue = Devices[MAINLISTENINGMODE].sValue
dictOptions = Devices[MAINLISTENINGMODE].Options
dictOptions["LevelNames"] = dictOptions["LevelNames"]+'|['+strCode+']'+' New'
dictOptions["LevelActions"] = dictOptions["LevelActions"]+'|'
Devices[MAINLISTENINGMODE].Update(nValue = nValue, sValue = sValue, Options = dictOptions)
Code: Select all
def setSelectorByCode(intId, strCode):
Domoticz.Log("Onkyo: setSelectorByCode code: "+strCode)
dictOptions = Devices[intId].Options
Domoticz.Log("Onkyo: Fetched Options")
Domoticz.Log("Onkyo: options: "+dictOptions['LevelNames'])
The following is logged:
Code: Select all
2017-05-12 11:21:55.270 (Onkyo) Onkyo: setSelectorByCode code: 80
2017-05-12 11:21:55.272 (Onkyo) Onkyo: Fetched Options
2017-05-12 11:21:55.273 Error: Domoticz received fatal signal 11 !...
2017-05-12 11:21:55.282 Error: /home/pi/dev-domoticz/domoticz() [0x1c25c0]
2017-05-12 11:21:55.284 Error: /home/pi/dev-domoticz/domoticz(_Z14signal_handleri+0x58) [0x1c2678]
2017-05-12 11:21:55.285 Error: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0xb6b2a180]
Is there someone that can shed some light on this? Do I need to file a bug report somewhere? If any additional data or logging is needed, I'm willing to assist to further debug this issue.
Kind regards,
Jorg