Generic Nightly kodi restarts after loading sqlite3

  • Hi,

    I have noticed that since the bump in python version 3.9 in LE11 generic nightly builds I can no longer import sqlite3 without getting a segfault:

    import sqlite3

    seems to consistently crash kodi.

    Is this a known issue?

  • After testing this further, I can see the issue is when sqlite3 is loaded for a second time.

    To test, I wrote an addon that simply displays in a ListItem the count of records in a table.

    The first time I go into the addon, it works as expected.

    If I then exit the addon and go back into it I get the segfault when the addon tries to import sqlite3

    This only started happening last month, around the time of the python updates to LE11

    For now I've rolled back to using LE10, but was just curious if anyone else has noticed this behaviour with sqlite3.

    *EDIT*

    I'm wondering if this is related to this python bug: https://bugs.python.org/issue46070

    Also, maybe this is related: https://github.com/LibreELEC/LibreELEC.tv/issues/6266

  • It could be related, a debug build of libreelec would tell from the segfault stacktrace. But it is likely. I made a test case in https://github.com/LibreELEC/LibreELEC.tv/issues/6266 sqlite3_crash.py . But I cannot reproduce the crash with a python 3.9.11 build run from builddir (I cannot tell if it loads the modules from the right spot) made from git on x86_64 or with debian python 3.9.2 on x86_64. For now I can only on my LibreElec box python 3.9.11 (Odroid C2 aarch64).

    Do you run your Generic build on x86_64 ?

  • Thank you for confirming for me, initially I thought it couldn't be an issue with importing built in modules, but I guess so.

    You're right, I am on x86-64, hopefully there is a resolution for this before LE11 is released.

    Thanks for your help