bbqkees / ems-esp-domoticz-plugin

Domoticz plugin for the EMS Wi-Fi Gateway with Proddy's EMS-ESP firmware
MIT License
7 stars 8 forks source link

Segmentation fault when loading plugin on Debian Bullseye #37

Closed lmdecroos closed 2 years ago

lmdecroos commented 2 years ago

Hi,

I have upgrade my raspberry pi from buster to bullseye. Since the upgrade the EMS plugin causes a segmentation fault when launching Domoticz. Upgrading domoticz from stable release to beta doesn't fix the issue. Version: 2021.1 (build 13437) Build Hash: 9ab1f2c32 Compile Date: 2021-08-22 09:32:47 dzVents Version: 3.1.8 Python Version: 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110]

domoticz startup error : 2021-08-24 16:46:54.565 Status: EMS: (EMS) Initialized version 1.4 Fatal Python error: Segmentation fault

Current thread 0x6e1fe220 (most recent call first):

2021-08-24 16:46:54.566 Error: Domoticz(pid:1121, tid:1136('EMS')) received fatal signal 11 (Segmentation fault) 2021-08-24 16:46:54.567 Error: siginfo address=0x461, address=(nil) 2021-08-24 16:46:54.830 Status: PluginSystem: 1 plugins started. 2021-08-24 16:46:56.925 Status: RFXCOM: Using serial port: /dev/ttyUSB0 2021-08-24 16:46:56.990 Error: Did not find stack frame for thread (LWP 1136)), printing full gdb output: 2021-08-24 16:46:56.991 Error: > [New LWP 1122] 2021-08-24 16:46:56.991 Error: > [New LWP 1124] 2021-08-24 16:46:56.991 Error: > [New LWP 1125] 2021-08-24 16:46:56.991 Error: > [New LWP 1126] 2021-08-24 16:46:56.991 Error: > [New LWP 1127] 2021-08-24 16:46:56.992 Error: > [New LWP 1128] 2021-08-24 16:46:56.992 Error: > [New LWP 1129] 2021-08-24 16:46:56.992 Error: > [New LWP 1130] 2021-08-24 16:46:56.992 Error: > [New LWP 1131] 2021-08-24 16:46:56.992 Error: > [New LWP 1132] 2021-08-24 16:46:56.992 Error: > [New LWP 1133] 2021-08-24 16:46:56.993 Error: > [New LWP 1134] 2021-08-24 16:46:56.993 Error: > [New LWP 1135] 2021-08-24 16:46:56.993 Error: > [New LWP 1136] 2021-08-24 16:46:56.993 Error: > [New LWP 1137] 2021-08-24 16:46:56.993 Error: > [New LWP 1138] 2021-08-24 16:46:56.993 Error: > [New LWP 1152] 2021-08-24 16:46:56.994 Error: > [Thread debugging using libthread_db enabled] 2021-08-24 16:46:56.994 Error: > Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". 2021-08-24 16:46:56.994 Error: > 0x76923f8c in __GI___clock_nanosleep_time64 (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7ebb6258, req@entry=0x7ebb6250, rem=0x7ebb6268, rem@entry=0x7ebb6260) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:52 2021-08-24 16:46:56.994 Error: > 52 ../sysdeps/unix/sysv/linux/clock_nanosleep.c: No such file or directory. 2021-08-24 16:46:56.995 Error: > Id Target Id Frame 2021-08-24 16:46:56.995 Error: > * 1 Thread 0x76fa6010 (LWP 1121) "domoticz" 0x76923f8c in __GI___clock_nanosleep_time64 (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7ebb6258, req@entry=0x7ebb6250, rem=0x7ebb6268, rem@entry=0x7ebb6260) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:52 2021-08-24 16:46:56.995 Error: > 2 Thread 0x75920220 (LWP 1122) "Watchdog" 0x76923f8c in __GI___clock_nanosleep_time64 (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7591fb90, req@entry=0x7591fb88, rem=0x7591fba0, rem@entry=0x7591fb98) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:52 2021-08-24 16:46:56.995 Error: > 3 Thread 0x7511f220 (LWP 1124) "SQLHelper" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37 2021-08-24 16:46:56.995 Error: > 4 Thread 0x7491e220 (LWP 1125) "PluginMgr" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37 2021-08-24 16:46:56.995 Error: > 5 Thread 0x73ba3220 (LWP 1126) "InfluxPush" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37 2021-08-24 16:46:56.996 Error: > 6 Thread 0x733a2220 (LWP 1127) "Webem_ssncleane" 0x7696363c in epoll_wait (epfd=17, events=0x733a1378, maxevents=128, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30 2021-08-24 16:46:56.996 Error: > 7 Thread 0x72b6c220 (LWP 1128) "WebServer_8080" 0x7696363c in epoll_wait (epfd=13, events=0x72b6b348, maxevents=128, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30 2021-08-24 16:46:56.996 Error: > 8 Thread 0x721ff220 (LWP 1129) "Webem_ssncleane" 0x7696363c in epoll_wait (epfd=24, events=0x721fe378, maxevents=128, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30 2021-08-24 16:46:56.996 Error: > 9 Thread 0x719fe220 (LWP 1130) "WebServer_443" 0x7696363c in epoll_wait (epfd=20, events=0x719fd348, maxevents=128, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30 2021-08-24 16:46:56.996 Error: > 10 Thread 0x70fff220 (LWP 1131) "Scheduler" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37 2021-08-24 16:46:56.997 Error: > 11 Thread 0x707fe220 (LWP 1132) "TCPServer" 0x7696363c in epoll_wait (epfd=27, events=0x707fd378, maxevents=128, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30 2021-08-24 16:46:56.997 Error: > 12 Thread 0x6fdff220 (LWP 1133) "MainWorker" __lll_lock_wait (futex=futex@entry=0xa57bd4 , private=0) at lowlevellock.c:52 2021-08-24 16:46:56.997 Error: > 13 Thread 0x6f5fe220 (LWP 1134) "MainWorkerRxMsg" futex_abstimed_wait_cancelable (private=, abstime=0x6f5fdba0, clockid=, expected=0, futex_word=0xa53b78 ) at ../sysdeps/nptl/futex-internal.h:323 2021-08-24 16:46:56.997 Error: > 14 Thread 0x6e9ff220 (LWP 1135) "DarkSky" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37 2021-08-24 16:46:56.997 Error: > 15 Thread 0x6e1fe220 (LWP 1136) "EMS" 0x7692a4d4 in __GI___wait4 (pid=1140, stat_loc=0x6d827230, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:27 2021-08-24 16:46:56.997 Error: > 16 Thread 0x6d7ff220 (LWP 1137) "RFXCOM" syscall () at ../sysdeps/unix/sysv/linux/arm/syscall.S:37 2021-08-24 16:46:56.998 Error: > 17 Thread 0x6cffe220 (LWP 1138) "NotificationSys" futex_abstimed_wait_cancelable (private=, abstime=0x6cffdbd0, clockid=, expected=0, futex_word=0xa53658 ) at ../sysdeps/nptl/futex-internal.h:323 2021-08-24 16:46:56.998 Error: > 18 Thread 0x6c7fd220 (LWP 1152) "Plugin_ASIO" futex_wait_cancelable (private=0, expected=0, futex_word=0x258e9d8) at ../sysdeps/nptl/futex-internal.h:186 When copying only the plugin.py or mqtt.py script in the plugin folder then domoticz starts but off course the plugin doesn't work : 2021-08-24 16:45:46.571 EMS hardware started. 2021-08-24 16:45:46.571 Status: EMS: (EMS) Entering work loop. 2021-08-24 16:45:46.571 Status: EMS: (EMS) Started. 2021-08-24 16:45:46.572 Status: RFXCOM: Worker started... 2021-08-24 16:45:46.572 Status: NotificationSystem: thread started... 2021-08-24 16:45:46.572 Status: EventSystem: reset all events... 2021-08-24 16:45:46.574 Status: EventSystem: reset all device statuses... 2021-08-24 16:45:46.810 Error: EMS: (ems-gateway) failed to load 'plugin.py', Python Path used was '/home/lmd/domoticz/plugins/ems-esp/:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.9/dist-packages'. 2021-08-24 16:45:46.810 Error: EMS: (EMS) Module Import failed, exception: 'ModuleNotFoundError' 2021-08-24 16:45:46.810 Error: EMS: (EMS) Module Import failed: ' Name: mqtt' 2021-08-24 16:45:46.810 Error: EMS: (EMS) Error Line details not available. 2021-08-24 16:45:46.810 Error: EMS: (EMS) Exception traceback: 2021-08-24 16:45:46.810 Error: EMS: (EMS) ----> Line 90 in '/home/lmd/domoticz/plugins/ems-esp/plugin.py' 2021-08-24 16:45:46.855 Status: Python EventSystem: Initializing event module. 2021-08-24 16:45:46.856 Status: EventSystem: Started 2021-08-24 16:45:46.856 Status: EventSystem: Queue thread started... 2021-08-24 16:45:46.996 Status: PluginSystem: 1 plugins started.
bbqkees commented 2 years ago

I think the cause for this error is outside of the plugin.

Do you have other plugins that do work?

lmdecroos commented 2 years ago

Yes, my other plugins are still working.

I assume it has something to do with incompatibilty between old python syntax and version 3.9.2. The ems-esp scripts are failing when validating against python 3.9

I did a clean install of domoticz on a buster debian, and the ems-esp plain worked without any issue

On 27 Aug 2021, at 14:48, Kees @.***> wrote:

I think the cause for this error is outside of the plugin.

Do you have other plugins that do work?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bbqkees/ems-esp-domoticz-plugin/issues/37#issuecomment-907177733, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANDW4466OLTCUQTGJGZI4MTT66CTTANCNFSM5CXA6IAQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

bbqkees commented 2 years ago

Are any of your other plugins based on MQTT? I had a look into the issues on the Domoticz repository and it was reported that other Python plugins using MQTT had the same error lately. A fix was created in 13330 but it appears you are already on a later version.

If you dont have another plugin with MQTT, could you try out https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin to see if it causes the same error?

lmdecroos commented 2 years ago

I have no other MQTT based plugins working.

But was able to fix the issue by downgrading from python 3.9 to 3.8

Status: PluginSystem: Started, Python version '3.8.7’.

The Buster release is using python 3.7.3 The Bullseye installs python 3.9.2

Happily python 3.8 is available in bullseye release and works with the domoticz plugins

On 30 Aug 2021, at 14:29, Kees @.***> wrote:

Are any of your other plugins based on MQTT? I had a look into the issues on the Domoticz repository and it was reported that other Python plugins using MQTT had the same error lately. A fix was created in 13330 but it appears you are already on a later version.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bbqkees/ems-esp-domoticz-plugin/issues/37#issuecomment-908301956, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANDW443BXBWE5W47DPJ4YHDT7N2TZANCNFSM5CXA6IAQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

bbqkees commented 2 years ago

Please try out the new Autodiscovery feature of Domoticz instead of this plugin. See https://bbqkees-electronics.nl/wiki/gateway/domoticz-configuration.html

(You can run them side by side with the existing plugin for a while).

lmdecroos commented 2 years ago

This is great news. I did a short test and it works with the latest Domoticz beta and my EMS-ESP gateway v2.2.2 106 devices have been discovered :)

On 21 Dec 2021, at 10:04, Kees @.***> wrote:

Please try out the new Autodiscovery feature of Domoticz instead of this plugin. See https://bbqkees-electronics.nl/wiki/gateway/domoticz-configuration.html https://bbqkees-electronics.nl/wiki/gateway/domoticz-configuration.html (You can run them side by side with the existing plugin for a while).

— Reply to this email directly, view it on GitHub https://github.com/bbqkees/ems-esp-domoticz-plugin/issues/37#issuecomment-998595702, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANDW44YESEDDKCM5MQMSURDUSA7KFANCNFSM5CXA6IAQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.