Kodi Community Forum
Migrated service add-on is seg faulting kodi 19.0 - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+---- Forum: Python 3 migration (https://forum.kodi.tv/forumdisplay.php?fid=281)
---- Thread: Migrated service add-on is seg faulting kodi 19.0 (/showthread.php?tid=362479)



Migrated service add-on is seg faulting kodi 19.0 - djbloc - 2021-05-09

I'm migrating an add-on from python 2 to python 3 and when trying the add-on on Kodi 19.0 (Ubuntu 20.04), Kodi is seg faulting on the second or subsequent loading of kodi

I've started with a blank .kodi folder so this is the only additional add-on and it is repeatable so confident it is something I've done.

The crashlog says the seg fault is in #0  0x00007f3efc121816 in _PyObject_GetMethod () from /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0

That doesn't mean much to me. I had debug logging switched on and note the debug information in the top left corner doesn't update for a few seconds before it crashes.

I would appreciate some help/pointers in how to debug what could be causing it. Thanks

Crashlog


RE: Migrated service add-on is seg faulting kodi 19.0 - djbloc - 2021-05-09

I've added log commands around blocks of code and through a process of elimination I've narrowed it down to a requests.post command:

custom_headers = { 'user-agent': xbmc.getUserAgent(), 'Content-Type': 'application/json' }
log.info("Snapshot 2")
r = requests.post(url=register_endpoint, data=json.dumps(data_to_submit), headers=custom_headers, timeout=_request_timeout)
log.info("Snapshot 2a")

Steps to reproduce:

1) Start Kodi with add-on uninstalled
2) Install add-on using "Install from zip file"
3) In the log file it prints "Snapshot 2" and "Snapshot 2a" (plus later logs) - i.e. the requests.post command works correctly
4) Exit and restart Kodi
5) Add-on is started and last log line is "Snapshot 2" then Kodi crashes, implying the requests.post command is causing the crash


This forum uses Lukasz Tkacz MyBB addons.