Page 1 of 1

Python Plugin Crash

Posted: Friday 18 March 2022 16:08
by pipiche
Domoticz 2022.1 (build 14257)

I'm getting this stack trace mainly when stop/starting a plugin



pp.zip
(5.88 KiB) Downloaded 33 times

Re: Python Plugin Crash

Posted: Friday 18 March 2022 16:59
by pipiche
same crash with Domoticz 2022.1 (build 14285)
pp.zip
(6.36 KiB) Downloaded 33 times

Re: Python Plugin Crash

Posted: Saturday 19 March 2022 21:33
by smailhop
Same problem here when I restart domoticz after installing any plugin it won't start again so I must delete the plugin to get it start again.
I think this problem is related to a python library

Re: Python Plugin Crash

Posted: Saturday 19 March 2022 22:10
by waltervl
If you are on latest beta please report your issue in this topic with the requested details viewtopic.php?t=38086

Re: Python Plugin Crash

Posted: Sunday 20 March 2022 0:58
by Dnpwwo
The 2 stack dumps show that the 'zigpy-deconz' have 3 or 4 threads running during the plugin shutdown.

Python threads need to all be stopped before leaving onStop otherwise there will be a crash. The Python C API doesn't have a way of detecting or handling this (can I've seen).

Re: Python Plugin Crash

Posted: Sunday 20 March 2022 9:10
by Dnpwwo
I've pushed a change to check (and log) for running threads during stop and wait for around 10 seconds to give them time to stop before continuing.

Sadly the 'threading' library doesn't have a 'kill' or 'stop' API so I can't do much about that.

Re: Python Plugin Crash

Posted: Tuesday 22 March 2022 9:13
by pipiche
Thanks I’ll check the plugin code.


Envoyé de mon iPhone en utilisant Tapatalk

Re: Python Plugin Crash

Posted: Tuesday 22 March 2022 11:55
by pipiche
I'm now on Domoticz 2022.1 build 14289 and get crash when having the plugin running.
This looks to happen when I'm doing a http request from a web browser to a plugin webserver thread. This problem was not existing with a prior Domoticz version I was running
crash.log.zip
(8.42 KiB) Downloaded 38 times