Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Kodi crashing when switching from an add-on to another #6266

Closed
pretoriano80 opened this issue Feb 25, 2022 · 47 comments · Fixed by #6345
Closed

[BUG] Kodi crashing when switching from an add-on to another #6266

pretoriano80 opened this issue Feb 25, 2022 · 47 comments · Fixed by #6345

Comments

@pretoriano80
Copy link

pretoriano80 commented Feb 25, 2022

Describe the bug

Kodi is crashing when switching from an addo-on to another, in this case it's either Netflix plugin or Tubed.
I only tested with these plug-ins because it's easy to reproduce (100% trigger rate)

To Reproduce

Steps to reproduce the behavior:

  1. Open Netflix (or Tubed) addon
  2. Navigate to any category (no need to play any video)
  3. Go back and open Tubed (or Netflix if you used Tubed in the first step) addon
  4. Navigate to a category and open it, this should trigger a crash and Kodi will restart

Note: Sometimes it may crash already at step 3.
Note 2: If you fail to reproduce on first try, just try again and it will certainly crash.

Informations

  • LE Version: LE11 master ae5c471
  • Hardware Platform: RPi4 8GB - SSD as main drive
  • Clean install, only Netflix and Tubed addons were installed

Log file

http://ix.io/3QHR

Additional context

~~ An important thing i noticed is that i can't reproduce the bug if only one of the addons is installed, meaning that if only Netflix is installed, then it won't cause any crash, same thing if only Tubed addon is installed. ~~

It seem that even after uninstalling Tubed addon,Netflix is still crashing if you leave Netflix ,open another addon and then go back to Netflix.

I have no clue if this is a bug caused by LibreELEC or some other Kodi related component.
I did some research and couldn't find any similar bug reports for Netflix addon, Tubed, Inputstream Adaptive or Input Stream Helper.

@pretoriano80 pretoriano80 changed the title [BUG] Kodi crashing under certain circumstances [BUG] Kodi crashing when switching from an add-on to another Feb 25, 2022
@rootcoder
Copy link

I'm having issues after python update.
Trying to downgrade to 3.8.12 and check.

@pretoriano80
Copy link
Author

@rootcoder yes, it appears to be an issue with the new python version, but it doesn't seem to affect everyone and i couldn't find any report on Kodi forums or GitHub.
I know that we are talking about alpha versions, so bleeding age software, but it's odd that nobody reported this yet, so it hard to say if only libreelec is affected.

@heitbaum
Copy link
Contributor

Please have a look at; Originally posted by @Maven85 in xbmc/xbmc#20853 (comment) and https://forum.libreelec.tv/core/search-result/129687/?highlight=Python

going to close these 2 issues as known issues - upstream addons. If there is a specific LE bug that needs to be fixed. Please reopen. But will need to know the detail and addon. Feedback via the forum would be great too.

@pretoriano80
Copy link
Author

pretoriano80 commented Feb 26, 2022

Ok, i did found those comments you linked, but in my case it's the Netflix addon and none of the addons mentioned there are installed on my system.

I pinged CastagnaIT on Kodi forums about it, maybe he's aware of this issue.
It does seem that other addons are affected, not only the ones mentioned in the your links.

In the meantime on the production drive i switched back to an older nigthly that i had around and will keep another testing drive for further development on the matter.

@HiassofT
Copy link
Member

I suspect it might be caused by this python bug which doesn't seem to be fully fixed (python issue is still open):
https://bugs.python.org/issue46070

@heitbaum
Copy link
Contributor

@pretoriano80 thanks for the additional info - reopened

@pretoriano80
Copy link
Author

pretoriano80 commented Feb 27, 2022

@heitbaum and @HiassofT i went further with the testing and i can reproduce the same crashing pattern with the latest Kodi nightly on my Android device (smartphone) , so definitely not a LibreELEC bug and not limited to LibreELEC.

However, i think that you guys have a much better way to communicate with the Kodi team directly and i'm certain that it will be solved at some point.

P. S. Maybe it's also a good thing to keep this bug report open, so if other LibreELEC users encounter this problem, will not open duplicate bug reports.

@HiassofT
Copy link
Member

@pretoriano80 please create a kodi issue about the Android crash

@pretoriano80
Copy link
Author

Done, here it is - > xbmc/xbmc#21045

@pretoriano80
Copy link
Author

I suspect it might be caused by this python bug which doesn't seem to be fully fixed (python issue is still open): https://bugs.python.org/issue46070

I applied the patch provided in that bug report but it seems that the issue is still there.
I only applied it to LibreELEC so maybe patching is also required on Kodi's side, but i have to admit that i didn't looked further into it because this python thing is a bit overwhelming for me. :)
Probably there's more than only the patch i tested, but python's bug tracking is a bit confusing for me (to say at least).

However, over the weekend i will have some more time for testing, so if you guys have more hints about this issue i will gladly test them.

@heitbaum
Copy link
Contributor

Is this the patch you tried?

python/cpython@52937c2

@pretoriano80
Copy link
Author

Is this the patch you tried?

python/cpython@52937c2

Nope,i've tested the patch from here --> https://bugs.python.org/issue46070
It seems that the patch from your link it's already merged in 3.9.10.

@WallyCZ
Copy link

WallyCZ commented Mar 22, 2022

I have built python asi debug and got something more from stacktrace:


kodi.bin: /libreelec/build.LibreELEC-RPi4.arm-11.0-devel/build/Python3-3.9.10/Modules/_struct.c:1870: s_pack: Assertion `PyStruct_Check(self)' failed.



Thread 1 (Thread 0xd5899280 (LWP 3040)):
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1  0xf4fb0798 in __GI_abort () at abort.c:79
#2  0xf4fbd9cc in __assert_fail_base (fmt=0xf50af7d0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0xeabdfb68 "PyStruct_Check(self)", assertion@entry=0xeabdf6d0 "/libreelec/build.LibreELEC-RPi4.arm-11.0-devel/build/Python3-3.9.10/Modules/_struct.c", file=0xeabdf6d0 "/libreelec/build.LibreELEC-RPi4.arm-11.0-devel/build/Python3-3.9.10/Modules/_struct.c", file@entry=0xf50af7d0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", line=line@entry=1870, function=0xeabe0338 "s_pack", function@entry=0xd5899280 "\001") at assert.c:92
#3  0xf4fbda7c in __GI___assert_fail (assertion=0xeabdf6d0 "/libreelec/build.LibreELEC-RPi4.arm-11.0-devel/build/Python3-3.9.10/Modules/_struct.c", file=0xf50af7d0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", line=1870, function=0xd5899280 "\001") at assert.c:101
#4  0xeabdd078 in ?? () from /usr/lib/python3.9/lib-dynload/_struct.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Line where it crashed was on assert(PyStruct_Check(self)):

static PyObject *
s_pack(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{
    char *buf;
    PyStructObject *soself;

    /* Validate arguments. */
    soself = (PyStructObject *)self;
    assert(PyStruct_Check(self));
    assert(soself->s_codes != NULL);
    if (nargs != soself->s_len)
    {
        PyErr_Format(_structmodulestate_global->StructError,
            "pack expected %zd items for packing (got %zd)", soself->s_len, nargs);
        return NULL;
    }
   ...

@prahal
Copy link
Contributor

prahal commented Mar 22, 2022

I checked and all the patches in https://bugs.python.org/issue46070, including python/cpython@52937c2, are included in python 3.9.10, which is now in LibreElec nightly builds. Which still crashes to me.

Also in this bug issue 46070, there are multiple issues:

Any patches to debug by printing the interpreter of the obj are pending but no more fix is left in this 46070 report. Though I admit our issue might be related to the objects shared between interpreters, we will have to add to the issue for it to go further.

My own issue is Kodi crashes when trying to play a second video, using Jellyfin add-on which could be close to this one.
I also can reproduce with the latest kodi nightly on android.
The backtrace in the log ends up in libpython3.9.so.1.0 with a corrupted stack (previous frame identical to this frame).

@pretoriano80
Copy link
Author

@WallyCZ the log is from a crash caused by the issue i presented heee, when switching from an add-on to another?

@prahal apart from the issue you have with jellyfin, did you also tried to reproduce the issue from this bug report?
Yes, i also checked all those patches and are indeed merged, so probably the log from WallyCZ is more relevant at this point.

Unfortunately, for a proper bug report to python devs, an easy way to reproduce the issue must be provided which in our case it is not (install kodi, addons, etc).
Probably this bug will become more relevant if it's not fixed until Kodi 20 betas or RCs are released.

@prahal
Copy link
Contributor

prahal commented Mar 22, 2022

@pretoriano80 yes but I do not have netflix. I reproduced with jellyfin your use case. I go in jellyfin addon, open a menu then go to another addon namely Dailymotion, then back in jellyfin: crash.

About WallyCZ log, I am trying to reproduce. Rebuilding LibreElec with DEBUG=Python3,kodi . His crash report gave me hope that a test case could be build.

@pretoriano80
Copy link
Author

@prahal great, i also managed to reproduce it without Netflix, so definitely there's more about this bug, not limited to only a few addons.
Yes, if we manage to provide some accurate logs, then probably Kodi devs will take it more seriously,especially because we are talking about a bug triggered by 3rd party addons annd sometimes Kodi team ignore these reports.

@prahal
Copy link
Contributor

prahal commented Mar 23, 2022

@pretoriano80 you should reproduce with a debug build : "DEBUG=Python3,kodi" added to "make release".
My attempt with debug on was of a proper backtrace.
python 3.9.11 https://paste.kodi.tv/zebiyopoge.kodi
python 3.10.3 https://paste.kodi.tv/oricadudah.kodi
So this issue is one that is not already fixed in python 3.10.3

@pretoriano80
Copy link
Author

Yes, i already have the debug build, will test it soon.

@pretoriano80
Copy link
Author

Ok,so i managed to get more crash logs from LE11 debug build.

  • YouTube crashing --> kodi_crashlog_youtube.log
    This is from a clean build,no other addons were installed and YouTube crashed on first try,no addon switching required.
  • Netflix crashing --> kodi_crashlog_netflix.log
    This was also on clean install with only Netflix installed.
    To make sure that Netflix wasn't crashing without the addon switch combo,i used this steps: Open Netflix -> Exit Netflix -> Return to Netflix -> Exit Netflix -> Open Libreelec Configuration addon -> Exit -> Open Netflix (kodi crashed)

Note: It seems that other addons i've tested (eg. Tubed) aren't crashing if YouTube or Netflix addons are not in the mix (aka disabled or not installed), but they do crash with the "addon switch combo" and YT or Netflix involved.
I still have to figure out how all these are related ,but i thought it's better to share my complete testing experience.

@prahal
Copy link
Contributor

prahal commented Mar 24, 2022

we have the same traces (Thread 1, python 3.9 one of mine). My first attempt at a fix was to check python 3.10 changes not backported to 3.9 but I found out that 3.10 was also broken.
I believe it is time to ask python devs to ask them for help in building a smaller test case (from our traces maybe they can hint).
I have a few more tests to attempt to check the second playback crash in jellyfin is the same trace as the enter jellyfin addon, then another addon, then back to jellyfin.
Feel free to beat me at finding a test case :-)
I believe @WallyCZ issue is not the same as ours.

@WallyCZ
Copy link

WallyCZ commented Mar 24, 2022

That can be the same issue as yours even if stack trace is different since I used the build option --with-pydebug and CFLAGS='-DPy_DEBUG', what you probably haven't. This will enable some python asserts, which can detect the bugs much more sooner than by you. It can have primary and secondary cause. But that's the theory, of course it can be something different. I have noticed that you have always the sqlite module (function pysqlite_microprotocols_add) in your stack traces, so this could be even bug only in sqlite module. Unfortunately, I had to switch to python 3.8 so now I can't do more explorations. I am pretty sure it can be debugged via gdb and resolved even without the deep knowledge of the python internals.

@prahal
Copy link
Contributor

prahal commented Mar 24, 2022

@WallyCZ thanks. Could you paste the full build command for --with-pydebug ?
I agree no need for deep python internals knowledges. I was more into deep knowledge of python current weaknesses :-) ie https://bugs.python.org/issue46070 showed me that the fact that there were bugs related to global state used by different interpreters was a known issue for python devs.
Mind I am also making in kodi addon internals. I cannot tell if switching from an addon to the other keep the previously loaded addon state. So kodi devs could help in narrowing a test case in my opinion (this time by knowing the code).

@WallyCZ
Copy link

WallyCZ commented Mar 24, 2022

Here is Python's package.mk I used https://paste.kodi.tv/acawitaqiy

@prahal
Copy link
Contributor

prahal commented Mar 24, 2022

running this on the kodi Odroid C2 with python 3.9.11 segfault:
python3.9 sqlite3_crash.py

# When this program is run using python 3.9.11 it crashes.

import _testcapi
import threading

code = """
import sqlite3
"""

def doIt():
    _testcapi.run_in_subinterp(code)

tt=[]

for i in range(16):
    t = threading.Thread(target=doIt)
    t.start()
    tt.append(t)

for t in tt:
    t.join()

This thanks to https://forum.libreelec.tv/thread/25454-generic-nightly-kodi-restarts-after-loading-sqlite3/ which found that an addon with only import sqlite3 in crashes kodi.

I extracted most of the test case from the initial https://bugs.python.org/issue46070 test case for the windows issue win_py399_crash_reproducer.py.

That should be enough for a python upstream bug report. Still I will do more tests on my side before that so feel free to open it beforehand.
I noticed than on x86_64 python 3.9.2 (debian stable) the segfault does not happen. I want to bisect the python 3.9 code down to a commit.

@pretoriano80
Copy link
Author

For now i won't open a bug report with python devs for several reasons.
First, i don't have python skills so this means that it may become a communication "barrier" between me and the devs if more technical discussions are required.

Another reason would be the testing environment, meaning that probably they won't like the idea of testing this on LibreELEC (even if it's clear that this is not caused by LibreELEC).

Probably it would be best if one of the developers behind the affected addons (Netflix,YouTube, etc) open a bug report with cpython devs and i'm saying this because they know the code used in their addons, hence the capacity to better understand the technical details.
And lastly,, Kodi devs may also do this if they want or have enough free time to help on this matter.

@prahal
Copy link
Contributor

prahal commented Mar 24, 2022

I can reproduce with a vanilla build of cpython github 3.9.11 tag on x86_64 (I checked a few runs and even on LibreElec the test case only crashes 90% of the time, so if it works the first time, retry). This vanilla build was without LE patches to python.

(gdb) py-list
  75    
  76            val = datetime.datetime(year, month, day, hours, minutes, seconds, microseconds)
  77            return val
  78    
  79    
 >80        register_adapter(datetime.date, adapt_date)
  81        register_adapter(datetime.datetime, adapt_datetime)
  82        register_converter("date", convert_date)
  83        register_converter("timestamp", convert_timestamp)
  84    
  85    register_adapters_and_converters()

python backtrace :

(gdb) thread apply all py-bt

Thread 7 (Thread 0x7ffff4dfe700 (LWP 436592) "python"):
Traceback (most recent call first):
  <built-in method register_adapter of module object at remote 0x7fffdc2e5a40>
  File "/home/prahal/Projects/WIP/libreelec/cpython_vanilla/Lib/sqlite3/dbapi2.py", line 80, in register_adapters_and_converters
    register_adapter(datetime.date, adapt_date)
  File "/home/prahal/Projects/WIP/libreelec/cpython_vanilla/Lib/sqlite3/dbapi2.py", line 85, in <module>
    register_adapters_and_converters()
  <built-in method exec of module object at remote 0x7ffff45edb80>
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "/home/prahal/Projects/WIP/libreelec/cpython_vanilla/Lib/sqlite3/__init__.py", line 57, in <module>
    from sqlite3.dbapi2 import *
  <built-in method exec of module object at remote 0x7ffff45edb80>
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<string>", line 2, in <module>
  <built-in method run_in_subinterp of module object at remote 0x7ffff77bc180>
  File "/home/prahal/Projects/WIP/libreelec/cpython_vanilla/../python-crash-kodi/sqlite3_crash.py", line 11, in doIt
    _testcapi.run_in_subinterp(code)
  File "/home/prahal/Projects/WIP/libreelec/cpython_vanilla/Lib/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/home/prahal/Projects/WIP/libreelec/cpython_vanilla/Lib/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/home/prahal/Projects/WIP/libreelec/cpython_vanilla/Lib/threading.py", line 930, in _bootstrap
    self._bootstrap_inner()

Thread 1 (Thread 0x7ffff7c45280 (LWP 436579) "python"):
Traceback (most recent call first):
  File "/home/prahal/Projects/WIP/libreelec/cpython_vanilla/Lib/threading.py", line 1073, in _wait_for_tstate_lock
    if lock.acquire(block, timeout):
  File "/home/prahal/Projects/WIP/libreelec/cpython_vanilla/Lib/threading.py", line 1053, in join
    self._wait_for_tstate_lock()
  File "/home/prahal/Projects/WIP/libreelec/cpython_vanilla/../python-crash-kodi/sqlite3_crash.py", line 21, in <module>
--Type <RET> for more, q to quit, c to continue without paging--
    t.join()

@prahal
Copy link
Contributor

prahal commented Mar 24, 2022

@pretoriano80 on the addon side, an addon which only code is "import sqlite3" reproduce the crash per https://forum.libreelec.tv/thread/25454-generic-nightly-kodi-restarts-after-loading-sqlite3/ . But on the kodi side, by changing the way they load addon they could workaround the issue. Feel free to bug kodi devs. If at all that will help kodi devs triage the bug reports that relates to this issue.

I will bug report the cpython devs as I have a test case and traces that only involves the python source code that should do on their side.

@prahal
Copy link
Contributor

prahal commented Mar 24, 2022

@pretoriano80 Oh sorry you already opened xbmc/xbmc#21045 . Then I will do my side :-)

@pretoriano80
Copy link
Author

@pretoriano80 Oh sorry you already opened xbmc/xbmc#21045 . Then I will do my side :-)

No problem! Yeah, the Kodi report was on Android, not so easy to debug as on LibreELEC.
I also pinged @CastagnaIT on Kodi forums about it, he couldn't reproduce it, but that's because he only has Netflix addon installed and it won't crash (tested myself).
YouTube addon is more prone to crashing, even without any other addon being involved.

@pretoriano80
Copy link
Author

Here's the journalctl log from the Netflix addon on a debug build - > http://ix.io/3TnX

It seems that it's indeed related to sqlite3.

@prahal
Copy link
Contributor

prahal commented Mar 26, 2022

@WallyCZ are you sure you did a make clean before make release? When I add your changes to Python3 package.mk I get:

<<< Pillow:target seq 256 <<<
(...)
BUILD      Pillow (target)
    TOOLCHAIN      manual
running build
(...)
building 'PIL._imagingmath' extension
/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/bin/armv8a-libreelec-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=native -O2 -Wall -pipe -I/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/include -Wno-format-security -march=native -O2 -Wall -pipe -I/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/include -Wno-format-security -march=armv8-a+crc -mtune=cortex-a53 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mfloat-abi=hard -mfpu=neon-fp-armv8 -Wall -pipe -O2 -fomit-frame-pointer -DNDEBUG -fPIC -I/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/include/freetype2 -I/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/include -I/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/include/fribidi -I/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/include -I/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/include/python3.9 -c src/_imagingmath.c -o build/temp.linux-x86_64-3.9/src/_imagingmath.o
src/_imaging.c:75:10: fatal error: Python.h: No such file or directory
   75 | #include "Python.h"
      |          ^~~~~~~~~~
compilation terminated.
src/_imagingft.c:22:10: fatal error: Python.h: No such file or directory
   22 | #include "Python.h"
      |          ^~~~~~~~~~
compilation terminated.

This because Pillow includes -I/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/include/python3.9 instead of the now -I/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/sysroot/usr/include/python3.9d (note the d added when I add py-debug and your CFLAGS.

I can work around this pillow issue if I symlink the includes from python3.9d to python3.9 pillow in the build and redo the make release.

But then kodi build fails with:

<<< kodi:target seq 266 <<<
BUILD      kodi (target) [DEBUG]
    TOOLCHAIN      cmake (auto-detect)
(...)
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Python3_LIBRARY
    linked by target "libkodi" in directory /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7
    linked by target "kodi" in directory /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7

-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ENABLE_LDGOLD


CMake Generate step failed.  Build files cannot be regenerated correctly.
FAILURE: scripts/build kodi:target during configure_target (default)
*********** FAILED COMMAND ***********
cmake ${CMAKE_GENERATOR_NINJA} ${TARGET_CMAKE_OPTS} ${PKG_CMAKE_OPTS_TARGET} ${PKG_CMAKE_SCRIPT%/*}
**************************************
*********** FAILED COMMAND ***********
${SCRIPTS}/build "${1}" "${PARENT_PKG}"
**************************************
FAILURE: scripts/install kodi:target has failed!

I have your --with-pydebug in PKG_CONFIGURE_OPTS_TARGET, CFLAGS='-DPy_DEBUG' in pre_configure_target and symlinking of python d suffixed libraries to non suffixed one in Python3 package.mk post_makeinstall_target

NB: I noticed when one upgrade the python to build if the target python library name change I usually get a missing library from dependent packages and kodi does not start. A make clean is then required.

@pretoriano80
Copy link
Author

@prahal i used his package.mk that he provided here and no "make clean" was required here.

@prahal
Copy link
Contributor

prahal commented Mar 26, 2022

@pretoriano80 sorry, I meant you have to make clean if you want a proper build when one change python suffix or version number (which is the case in this pythn debug build) else your build still contains the old python suffix and the build succeed but is not fine (at runtime it still attempt to load the python library with the old suffix).
Could you retry to make release but this time after a make clean?

@WallyCZ
Copy link

WallyCZ commented Mar 26, 2022

@prahal I didn't make clean. If you do this, you will need couple of additional changes in build scripts because dependencies will try to ink with incorrect python library (without "d"). The easiest way is to build it with the original make files, then replace that package.mk and build it again without doing make clean. The package.mk contains symlink trick so every dependency will use debug version even if it was linked with non-debug.

@prahal
Copy link
Contributor

prahal commented Mar 27, 2022

Thanks for this last tip that help me reproduce your struct bug. It turns out that yours is very likely a different bug. The struct crash happens even if you only wait doing nothing. From my logs, I suspect script.tubed to trigger it.
My kodi logs end up with:

2022-03-28 00:10:00.432 T:674      info <general>: [script.tubecast] ssdp: Starting SSDP server

and more importantly, I get this debug trace with gdbserver and sourcing the LE build python-gdb.py into gdb-multiarch client:

Thread 4 "LanguageInvoker" received signal SIGABRT, Aborted.
[Switching to Thread 1086.1111]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
49	  return ret;
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1  0xf5494798 in __GI_abort () at abort.c:79
#2  0xf54a19cc in __assert_fail_base (fmt=0xf55937d0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0xe7123ba4 "PyStruct_Check(self)", 
	assertion@entry=0xe71236d0 "/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Modules/_struct.c", 
	file=0xe71236d0 "/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Modules/_struct.c", 
	file@entry=0xf55937d0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", line=line@entry=1870, function=0xe7124388 <PRETTY_FUNCTION.9> "s_pack", 
	function@entry=0xdd070280 "\001") at assert.c:92
#3  0xf54a1a7c in GI_assert_fail (
	assertion=0xe71236d0 "/home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Modules/_struct.c", 
	file=0xf55937d0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", line=line@entry=1870, function=0xdd070280 "\001") at assert.c:101
#4  0xe7121078 in s_pack (self=<unknown at remote 0xdd070280>, args=0xf55937d0, args@entry=0xce375228, nargs=-418236720, nargs@entry=1)
	at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Modules/_struct.c:1870
#5  0xe71211ac in pack (self=<optimized out>, args=0xce375224, nargs=2)
	at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Modules/_struct.c:2177
#6  0xf765dcbc in cfunction_vectorcall_FASTCALL (func=func@entry=<built-in method pack of module object at remote 0xcafce9f8>, args=args@entry=0xce375224, 
	nargsf=nargsf@entry=2147483650, kwnames=kwnames@entry=0x0)
	at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/methodobject.c:430
#7  0xf773e180 in _PyObject_VectorcallTstate (tstate=0xf2d0a940, callable=<built-in method pack of module object at remote 0xcafce9f8>, args=0xce375224, nargsf=2147483650, 
	kwnames=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:118
#8  0xf774247c in PyObject_Vectorcall (kwnames=0x0, nargsf=2147483650, args=0xce375224, callable=<built-in method pack of module object at remote 0xcafce9f8>)
	at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:127
#9  call_function (tstate=tstate@entry=0xf2d0a940, pp_stack=0xdd06eebc, pp_stack@entry=0xdd06eeb4, oparg=oparg@entry=2, kwnames=0x0)
	at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:5077
#10 0xf774e0c8 in _PyEval_EvalFrameDefault (tstate=0xf2d0a940, f=<unknown at remote 0xce1190f4>, throwflag=<optimized out>)
	at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:3489
#11 0xf75f9c8c in _PyEval_EvalFrame (throwflag=0, f=
	Frame 0xce3750e0, for file /storage/.kodi/addons/script.tubecast/resources/lib/tubecast/ssdp.py, line 63, in set_loopback_mode (self=<MulticastServer(server_address=('0.0.0.0', 1900), RequestHandlerClass=<type at remote 0xce36da40>, _BaseServeris_shut_down=<Event(_cond=<Condition(_lock=<_thread.lock at remote 0xce371608>, acquire=<built-in method acquire of _thread.lock object at remote 0xce371608>, release=<built-in method release of _thread.lock object at remote 0xce371608>, _waiters=<collections.deque at remote 0xf2de0a30>) at remote 0xce372ad0>, _flag=False) at remote 0xce371638>, _BaseServershutdown_request=False, socket=<socket at remote 0xce374d88>, _thread=None, poll_interval=<float at remote 0xce34c940>, _handler=<type at remote 0xce36da40>, chromecast_addr=('0.0.0.0', 39141), _multicast_address=('239.255.255.250', 1900), _listen_interfaces=None) at remote 0xce3716b0>, mode=1), tstate=0xf2d0a940)
	at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/internal/pycore_ceval.h:40
#12 function_code_fastcall (tstate=0xf2d0a940, co=<optimized out>, args=0xce374cf4, args@entry=0xce374cec, nargs=nargs@entry=2, 
	globals={'name': 'resources.lib.tubecast.ssdp', 'doc': None, 'package': 'resources.lib.tubecast', 'loader': <SourceFileLoader(name='resources.lib.tubecast.ssdp', path='/storage/.kodi/addons/script.tubecast/resources/lib/tubecast/ssdp.py') at remote 0xcaf21d40>, 'spec': <ModuleSpec(name='resources.lib.tubecast.ssdp', loader=<...>, origin='/storage/.kodi/addons/script.tubecast/resources/lib/tubecast/ssdp.py', loader_state=None, submodule_search_locations=None, _set_fileattr=True, _cached='/storage/.kodi/addons/script.tubecast/resources/lib/tubecast/pycache/ssdp.cpython-39.opt-1.pyc', _initializing=False) at remote 0xce369350>, 'file': '/storage/.kodi/addons/script.tubecast/resources/lib/tubecast/ssdp.py', 'cached': '/storage/.kodi/addons/script.tubecast/resources/lib/tubecast/pycache/ssdp.cpython-39.opt-1.pyc', 'builtins': {'name': 'builtins', 'doc': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in s..--Type <RET> for more, q to quit, c to continue without paging--c
.(truncated)) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/call.c:330
#13 0xf75fa7f8 in _PyFunction_Vectorcall (func=func@entry=<function at remote 0xce3664f8>, stack=stack@entry=0xce374cec, nargsf=nargsf@entry=2147483650, kwnames=kwnames@entry=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/call.c:367
#14 0xf773e180 in _PyObject_VectorcallTstate (tstate=0xf2d0a940, callable=<function at remote 0xce3664f8>, args=0xce374cec, nargsf=2147483650, kwnames=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:118
#15 0xf774247c in PyObject_Vectorcall (kwnames=0x0, nargsf=2147483650, args=0xce374cec, callable=<function at remote 0xce3664f8>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:127
#16 call_function (tstate=tstate@entry=0xf2d0a940, pp_stack=0xdd06f024, pp_stack@entry=0xdd06f01c, oparg=oparg@entry=2, kwnames=kwnames@entry=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:5077
#17 0xf774e074 in _PyEval_EvalFrameDefault (tstate=0xf2d0a940, f=<unknown at remote 0xce103f54>, throwflag=<optimized out>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:3506
#18 0xf77507fc in _PyEval_EvalFrame (throwflag=0, f=Frame 0xce374b98, for file /storage/.kodi/addons/script.tubecast/resources/lib/tubecast/ssdp.py, line 58, in init (self=<MulticastServer(server_address=('0.0.0.0', 1900), RequestHandlerClass=<type at remote 0xce36da40>, _BaseServeris_shut_down=<Event(_cond=<Condition(_lock=<_thread.lock at remote 0xce371608>, acquire=<built-in method acquire of _thread.lock object at remote 0xce371608>, release=<built-in method release of _thread.lock object at remote 0xce371608>, _waiters=<collections.deque at remote 0xf2de0a30>) at remote 0xce372ad0>, _flag=False) at remote 0xce371638>, _BaseServershutdown_request=False, socket=<socket at remote 0xce374d88>, _thread=None, poll_interval=<float at remote 0xce34c940>, _handler=<type at remote 0xce36da40>, chromecast_addr=('0.0.0.0', 39141), _multicast_address=('239.255.255.250', 1900), _listen_interfaces=None) at remote 0xce3716b0>, addr=(...), handler=<type at remote 0xce36da40>, chromecast_addr=(...), poll_interval=<float at remote 0xce34c940>, bind_and_activate=True...(truncated), tstate=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/internal/pycore_ceval.h:40
#19 _PyEval_EvalCode (tstate=0x0, _co=<code at remote 0xce363c08>, globals=<optimized out>, locals=locals@entry=0x0, args=args@entry=0xce37165c, argcount=3, kwnames=0xce10a06c, kwargs=0xce371668, kwcount=-141382280, kwcount@entry=2, kwstep=kwstep@entry=1, defs=defs@entry=0xce10b00c, defcount=defcount@entry=3, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, name=name@entry='init', qualname='MulticastServer.init') at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:4329
#20 0xf75fa6e8 in _PyFunction_Vectorcall (func=<optimized out>, stack=0xce37165c, nargsf=<optimized out>, kwnames=<optimized out>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/call.c:396
#21 0xf75fb400 in _PyObject_FastCallDictTstate (tstate=tstate@entry=0xf2d0a940, callable=callable@entry=<function at remote 0xcaf0c340>, args=args@entry=0xdd06f14c, nargsf=nargsf@entry=3, kwargs={'chromecast_addr': ('0.0.0.0', 39141), 'interfaces': None}, kwargs@entry=<unknown at remote 0xf2d0a940>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/call.c:129
#22 0xf75fb698 in _PyObject_Call_Prepend (tstate=tstate@entry=0xf2d0a940, callable=callable@entry=<function at remote 0xcaf0c340>, obj=obj@entry=<MulticastServer(server_address=('0.0.0.0', 1900), RequestHandlerClass=<type at remote 0xce36da40>, _BaseServeris_shut_down=<Event(_cond=<Condition(_lock=<_thread.lock at remote 0xce371608>, acquire=<built-in method acquire of _thread.lock object at remote 0xce371608>, release=<built-in method release of _thread.lock object at remote 0xce371608>, _waiters=<collections.deque at remote 0xf2de0a30>) at remote 0xce372ad0>, _flag=False) at remote 0xce371638>, _BaseServershutdown_request=False, socket=<socket at remote 0xce374d88>, _thread=None, poll_interval=<float at remote 0xce34c940>, _handler=<type at remote 0xce36da40>, chromecast_addr=('0.0.0.0', 39141), _multicast_address=('239.255.255.250', 1900), _listen_interfaces=None) at remote 0xce3716b0>, args=args@entry=(('239.255.255.250', 1900), <type at remote 0xce36da40>), kwargs=kwargs@entry={'chromecast_addr': ('0.0.0.0', 39141), 'interfaces': None}) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/call.c:489
#23 0xf768ae8c in slot_tp_init (self=<MulticastServer(server_address=('0.0.0.0', 1900), RequestHandlerClass=<type at remote 0xce36da40>, _BaseServeris_shut_down=<Event(_cond=<Condition(_lock=<_thread.lock at remote 0xce371608>, acquire=<built-in method acquire of _thread.lock object at remote 0xce371608>, release=<built-in method release of _thread.lock object at remote 0xce371608>, _waiters=<collections.deque at remote 0xf2de0a30>) at remote 0xce372ad0>, _flag=False) at remote 0xce371638>, _BaseServershutdown_request=False, socket=<socket at remote 0xce374d88>, _thread=None, poll_interval=<float at remote 0xce34c940>, _handler=<type at remote 0xce36da40>, chromecast_addr=('0.0.0.0', 39141), _multicast_address=('239.255.255.250', 1900), _listen_interfaces=None) at remote 0xce3716b0>, args=(('239.255.255.250', 1900), <type at remote 0xce36da40>), kwds={'chromecast_addr': ('0.0.0.0', 39141), 'interfaces': None}) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/typeobject.c:6969
#24 0xf7686db0 in type_call (type=<optimized out>, args=(('239.255.255.250', 1900), <type at remote 0xce36da40>), kwds={'chromecast_addr': ('0.0.0.0', 39141), 'interfaces': None}) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/typeobject.c:1026
#25 0xf75fac98 in _PyObject_MakeTpCall (tstate=tstate@entry=0xf2d0a940, callable=callable@entry=<type at remote 0xce36d2e8>, args=args@entry=0xce372d74, nargs=nargs@entry=2, keywords=keywords@entry=('chromecast_addr', 'interfaces')) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/call.c:191
#26 0xf773e278 in _PyObject_VectorcallTstate (tstate=0xf2d0a940, callable=<type at remote 0xce36d2e8>, args=0xce372d74, nargsf=2147483650, kwnames=('chromecast_addr', 'interfaces')) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:116
#27 0xf774247c in PyObject_Vectorcall (kwnames=('chromecast_addr', 'interfaces'), nargsf=2147483650, args=0xce372d74, callable=<type at remote 0xce36d2e8>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:127
#28 call_function (tstate=tstate@entry=0xf2d0a940, pp_stack=0xdd06f2a4, pp_stack@entry=0xdd06f29c, oparg=oparg@entry=4, kwnames=kwnames@entry=('chromecast_addr', 'interfaces')) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:5077
#29 0xf774e1cc in _PyEval_EvalFrameDefault (tstate=0xf2d0a940, f=<unknown at remote 0xce121e44>, throwflag=<optimized out>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:3537
#30 0xf77507fc in _PyEval_EvalFrame (throwflag=0, f=Frame 0xce372c30, for file /storage/.kodi/addons/script.tubecast/resources/lib/tubecast/ssdp.py, line 159, in start (self=<SSDPserver at remote 0xce3716d8>, chromecast_addr=('0.0.0.0', 39141), interfaces=None), tstate=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/internal/pycore_ceval.h:40
#31 _PyEval_EvalCode (tstate=0x0, _co=<code at remote 0xce36f6c0>, globals=<optimized out>, locals=locals@entry=0x0, args=args@entry=0xce36fe60, argcount=argcount@entry=2, kwnames=0xe70e133c, kwargs=kwargs@entry=0xce36fe68, kwcount=0, kwcount@entry=1, kwstep=kwstep@entry=1, defs=defs@entry=0xce3692ac, defcount=defcount@entry=1, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, name=name@entry='start', qualname='SSDPserver.start') at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:4329
#32 0xf75fa6e8 in _PyFunction_Vectorcall (func=func@entry=<function at remote 0xce36df68>, stack=stack@entry=0xce36fe60, nargsf=nargsf@entry=2, kwnames=kwnames@entry=('interfaces',)) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/call.c:396
#33 0xf75fdc50 in _PyObject_VectorcallTstate (tstate=0xf2d0a940, callable=<function at remote 0xce36df68>, args=0xce36fe60, nargsf=2, kwnames=('interfaces',)) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:118
#34 0xf75fe7b0 in method_vectorcall (method=method@entry=<method at remote 0xce371ac8>, args=args@entry=0xce36fe64, nargsf=nargsf@entry=2147483649, kwnames=kwnames@entry=('interfaces',)) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/classobject.c:53
#35 0xf773e180 in _PyObject_VectorcallTstate (tstate=0xf2d0a940, callable=<method at remote 0xce371ac8>, args=0xce36fe64, nargsf=2147483649, kwnames=('interfaces',)) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:118
#36 0xf774247c in PyObject_Vectorcall (kwnames=('interfaces',), nargsf=2147483649, args=0xce36fe64, callable=<method at remote 0xce371ac8>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:127
#37 call_function (tstate=tstate@entry=0xf2d0a940, pp_stack=0xdd06f4a4, pp_stack@entry=0xdd06f49c, oparg=oparg@entry=2, kwnames=kwnames@entry=('interfaces',)) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:5077
#38 0xf774e1cc in _PyEval_EvalFrameDefault (tstate=0xf2d0a940, f=<unknown at remote 0xf2ddaba4>, throwflag=<optimized out>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:3537
#39 0xf75f9c8c in _PyEval_EvalFrame (throwflag=0, f=Frame 0xce36fd20, for file /storage/.kodi/addons/script.tubecast/resources/lib/service.py, line 22, in run (chromecast=<Chromecast(_monitor=<xbmc.Monitor at remote 0xca926188>, _server_thread=<Thread(_target=<method at remote 0xf2ddcd08>, _name='ChromecastServer', _args=('0.0.0.0', 0), _kwargs={}, _daemonic=True, _ident=3830690432, _native_id=1174, _tstate_lock=<_thread.lock at remote 0xce017d78>, _started=<Event(_cond=<Condition(_lock=<_thread.lock at remote 0xf2ddb288>, acquire=<built-in method acquire of _thread.lock object at remote 0xf2ddb288>, release=<built-in method release of _thread.lock object at remote 0xf2ddb288>, _waiters=<collections.deque at remote 0xc916cc08>) at remote 0xf2ddaff8>, _flag=True) at remote 0xf2ddb080>, _is_stopped=False, _initialized=True, _stderr=<xbmcout(ll=3) at remote 0xf2dd0db0>, _invoke_excepthook=<function at remote 0xce370170>) at remote 0xf2ddeb38>, _server=<ThreadedWSGIServer(server_address=('0.0.0.0', 39141), RequestHandlerClass=<type at remote 0xce36ac20>, _BaseServ...(truncated), tstate=0xf2d0a940) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/internal/pycore_ceval.h:40
#40 function_code_fastcall (tstate=0xf2d0a940, co=<optimized out>, args=args@entry=0xf2d80154, nargs=nargs@entry=0, globals={'name': 'resources.lib.service', 'doc': None, 'package': 'resources.lib', 'loader': <SourceFileLoader(name='resources.lib.service', path='/storage/.kodi/addons/script.tubecast/resources/lib/service.py') at remote 0xf2de0730>, 'spec': <ModuleSpec(name='resources.lib.service', loader=<...>, origin='/storage/.kodi/addons/script.tubecast/resources/lib/service.py', loader_state=None, submodule_search_locations=None, _set_fileattr=True, _cached='/storage/.kodi/addons/script.tubecast/resources/lib/pycache/service.cpython-39.opt-1.pyc', _initializing=False) at remote 0xf2ddf020>, 'file': '/storage/.kodi/addons/script.tubecast/resources/lib/service.py', 'cached': '/storage/.kodi/addons/script.tubecast/resources/lib/pycache/service.cpython-39.opt-1.pyc', 'builtins': {'name': 'builtins', 'doc': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", 'package': '', 'loader': <type at remote...(truncated)) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/call.c:330
#41 0xf75fa7f8 in _PyFunction_Vectorcall (func=func@entry=<function at remote 0xc916caf0>, stack=stack@entry=0xf2d80154, nargsf=nargsf@entry=2147483648, kwnames=kwnames@entry=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Objects/call.c:367
#42 0xf773e180 in _PyObject_VectorcallTstate (tstate=0xf2d0a940, callable=<function at remote 0xc916caf0>, args=0xf2d80154, nargsf=2147483648, kwnames=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:118
#43 0xf774247c in PyObject_Vectorcall (kwnames=0x0, nargsf=2147483648, args=0xf2d80154, callable=<function at remote 0xc916caf0>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/cpython/abstract.h:127
#44 call_function (tstate=tstate@entry=0xf2d0a940, pp_stack=0xdd06f60c, pp_stack@entry=0xdd06f604, oparg=oparg@entry=0, kwnames=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:5077
#45 0xf774e0c8 in _PyEval_EvalFrameDefault (tstate=0xf2d0a940, f=<unknown at remote 0x2e9d5b4>, throwflag=<optimized out>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:3489
#46 0xf77507fc in _PyEval_EvalFrame (throwflag=0, f=Frame 0xf2d80018, for file /storage/.kodi/addons/script.tubecast/main.py, line 7, in <module> (), tstate=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Include/internal/pycore_ceval.h:40
#47 _PyEval_EvalCode (tstate=0x0, _co=<code at remote 0xf2da4d20>, globals=<optimized out>, locals=<optimized out>, args=0x0, argcount=0, argcount@entry=-220729912, kwnames=0x0, kwnames@entry=0xf7750c00 <PyEval_EvalCodeEx+104>, kwargs=kwargs@entry=0x0, kwcount=-220344320, kwcount@entry=0, kwstep=2, kwstep@entry=0, defs=defs@entry=0x0, defcount=0, defcount@entry=2, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, name=name@entry=0x0, qualname=qualname@entry=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:4329
#48 0xf7750b88 in _PyEval_EvalCodeWithName (_co=<optimized out>, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=0, argcount@entry=-220729912, kwnames=0x0, kwnames@entry=0xf7750c3c <PyEval_EvalCode+44>, kwargs=kwargs@entry=0x0, kwcount=kwcount@entry=0, kwstep=kwstep@entry=2, defs=defs@entry=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0, name=name@entry=0x0, qualname=qualname@entry=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:4361
#49 0xf7750c00 in PyEval_EvalCodeEx (_co=_co@entry=<code at remote 0xf2da4d20>, globals=globals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}, locals=locals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}, args=args@entry=0x0, argcount=argcount@entry=0, kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0, closure=closure@entry=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:4377
#50 0xf7750c3c in PyEval_EvalCode (co=co@entry=<code at remote 0xf2da4d20>, globals=globals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}, locals=locals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/ceval.c:828
#51 0xf779e5a4 in run_eval_code_obj (tstate=tstate@entry=0xf2d0a940, co=co@entry=0xf2da4d20, globals=globals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}, locals=locals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/pythonrun.c:1221
#52 0xf779eb50 in run_mod (mod=mod@entry=0xf2dd4460, filename=filename@entry='/storage/.kodi/addons/script.tubecast/main.py', globals=globals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}, locals={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}, locals@entry=<unknown at remote 0xf2dd9178>, flags=flags@entry=0x0, arena=arena@entry=0xf2dd8c90) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/pythonrun.c:1242
#53 0xf77a28d8 in pyrun_file (fp=fp@entry=0xf2dd9178, filename=filename@entry='/storage/.kodi/addons/script.tubecast/main.py', start=start@entry=257, globals=globals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}, locals=locals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}, closeit=1, closeit@entry=6508264, flags=0x0, flags@entry=0xf2d7edc8) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/pythonrun.c:1140
#54 0xf77a2ed8 in PyRun_FileExFlags (fp=fp@entry=0xf2dd9178, filename=<optimized out>, start=start@entry=257, globals=globals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}, locals=locals@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}, closeit=closeit@entry=1, flags=flags@entry=0x0) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/Python/pythonrun.c:1160
#55 0x00634ee8 in CPythonInvoker::executeScript (this=this@entry=0x2ba4df0, fp=fp@entry=0xf2dd9178, script=..., moduleDict=moduleDict@entry={'name': 'main', 'doc': None, 'package': None, 'loader': <type at remote 0xf2d23be8>, 'spec': None, 'annotations': {}, 'builtins': <module at remote 0xf2d1d440>, 'xbmc': <module at remote 0xf2ddfa88>, 'xbmcout': <type at remote 0xf2dda490>, 'sys': <module at remote 0xf2d155f0>, 'file': '/storage/.kodi/addons/script.tubecast/main.py', 'xbmcaddonid': 'script.tubecast', 'xbmcapiversion': '3.0.0', 'xbmcinvokerid': 3, 'service': <module at remote 0xf2de0758>, 'kodilogging': <module at remote 0xf2d8eed8>}) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7/xbmc/interfaces/python/PythonInvoker.cpp:444
#56 0x006380c4 in CPythonInvoker::execute (this=this@entry=0x2ba4df0, script=..., arguments=...) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7/xbmc/interfaces/python/PythonInvoker.cpp:335
#57 0x00638b10 in CPythonInvoker::execute (this=0x2ba4df0, script=..., arguments=...) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7/xbmc/interfaces/python/PythonInvoker.cpp:161
#58 0x0137d668 in ILanguageInvoker::Execute (this=this@entry=0x2ba4df0, script=..., arguments=...) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7/xbmc/interfaces/generic/ILanguageInvoker.cpp:29
#59 0x00638e2c in CPythonInvoker::Execute (this=0x2ba4df0, script=..., arguments=...) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7/xbmc/interfaces/python/PythonInvoker.cpp:149
#60 0x0137df24 in CLanguageInvokerThread::Process (this=0x2a30d20) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7/xbmc/interfaces/generic/LanguageInvokerThread.cpp:107
#61 0x00a91e6c in CThread::Action (this=this@entry=0x2a30d38) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7/xbmc/threads/Thread.cpp:267
#62 0x00a92f88 in operator() (__closure=<optimized out>, pThread=0x2a30d38, promise=...) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7/xbmc/threads/Thread.cpp:138
#63 0x00a933e4 in std::invoke_impl<void, CThread::Create(bool)::<lambda(CThread*, std::promise<bool>)>, CThread*, std::promise<bool> > (f=...) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/include/c++/10.3.0/bits/invoke.h:60
#64 std::invoke<CThread::Create(bool)::<lambda(CThread*, std::promise<bool>)>, CThread*, std::promise<bool> > (fn=...) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/include/c++/10.3.0/bits/invoke.h:95
#65 std::thread::_Invoker<std::tuple<CThread::Create(bool)::<lambda(CThread*, std::promise<bool>)>, CThread*, std::promise<bool> > >::_M_invoke<0, 1, 2> (this=<optimized out>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/include/c++/10.3.0/thread:264
#66 std::thread::_Invoker<std::tuple<CThread::Create(bool)::<lambda(CThread*, std::promise<bool>)>, CThread*, std::promise<bool> > >::operator() (this=<optimized out>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/include/c++/10.3.0/thread:271
#67 std::thread::_State_impl<std::thread::_Invoker<std::tuple<CThread::Create(bool)::<lambda(CThread*, std::promise<bool>)>, CThread*, std::promise<bool> > > >::_M_run(void) (this=<optimized out>) at /home/prahal/Projects/WIP/libreelec/LibreELEC.tv/build.LibreELEC-AMLGX.arm-11.0-devel/toolchain/armv8a-libreelec-linux-gnueabihf/include/c++/10.3.0/thread:215
#68 0xf538e0e4 in ?? () from target:/usr/lib/libstdc++.so.6
#69 0xf7bbfc8c in start_thread (arg=0xdd070280) at pthread_create.c:463
#70 0xf5547cd8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from target:/usr/lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Note the Frame 0xce3750e0, for file /storage/.kodi/addons/script.tubecast/resources/lib/tubecast/ssdp.py, line 63, in set_loopback_mode (self=<MulticastServer(server_address=('0.0.0.0', 1900), RequestHandlerClass=<ty in frame 11.

that is by:

<kodi box>
# gdbserver  localhost:1234 /usr/lib/kodi/kodi.bin

<build host>
$ gdb-multiarch build.LibreELEC-AMLGX.arm-11.0-devel/build/kodi-2f11e994f322f7376476b186293a3df34246b9a7/.armv8a-libreelec-linux-gnueabihf/kodi.bin

(gdb) source -v build.LibreELEC-AMLGX.arm-11.0-devel/build/Python3-3.9.12/.armv8a-libreelec-linux-gnueabihf/python-gdb.py 
(gdb) c

@prahal
Copy link
Contributor

prahal commented Mar 27, 2022

@WallyCZ sorry I forgot to add that the current bug is fixed by reverting cpython commit 52937c26adc35350ca0402070160cf6dc838f359 (for python 3.9). But yours is still there even with that commit reverted.

@pretoriano80
Copy link
Author

@prahal you meant script.tubecast?Tubed it's a different addon.

@prahal
Copy link
Contributor

prahal commented Mar 28, 2022

@pretoriano80 thank you. @WallyCZ Indeed your issue is triggered by script.tubecast (not script.tubed)

@pretoriano80
Copy link
Author

@WallyCZ sorry I forgot to add that the current bug is fixed by reverting cpython commit 52937c26adc35350ca0402070160cf6dc838f359 (for python 3.9). But yours is still there even with that commit reverted.

I will revert that commit and try a build without it.
However, if that's the case, then python team will have to find a way out of this. xD

@prahal
Copy link
Contributor

prahal commented Mar 28, 2022

@pretoriano80 my pending push request is in http://sprunge.us/o9kNvR . I also told about this fix in https://bugs.python.org/issue46070 , no reply yet. Note that in 3.11 this commit is fine. It only breaks previous branches where it was backported.

@heitbaum
Copy link
Contributor

@pretoriano80 my pending push request is in http://sprunge.us/o9kNvR . I also told about this fix in https://bugs.python.org/issue46070 , no reply yet. Note that in 3.11 this commit is fine. It only breaks previous branches where it was backported.

@prahal / @pretoriano80 - if this indeed fixes the issues you are experiencing in 3.9.y - raise a PR to include this patch in LE11?

@pretoriano80
Copy link
Author

@pretoriano80 my pending push request is in http://sprunge.us/o9kNvR . I also told about this fix in https://bugs.python.org/issue46070 , no reply yet. Note that in 3.11 this commit is fine. It only breaks previous branches where it was backported.

@prahal / @pretoriano80 - if this indeed fixes the issues you are experiencing in 3.9.y - raise a PR to include this patch in LE11?

I'm testing a LE11 build with patched python 3.9.12 right now, :)

@WallyCZ
Copy link

WallyCZ commented Mar 28, 2022

@pretoriano80 thank you. @WallyCZ Indeed your issue is triggered by script.tubecast (not script.tubed)

Thank you for your analysis and it looks clear now that it is another issue. And indeed, I am confirming issues with this plugin even with non-debug version (more rare crashes). It crashes Kodi in about 20% of cases I am using it with the release version of python. Although I am not sure if the problem is in the addon itself because in my opinion no addon should crash Kodi even if it would do whatever. Probably should open new ticket on this, but wonder we have enough of information so somebody would bother with this...

@pretoriano80
Copy link
Author

@prahal i can confirm that reverting that commit fixed the crashing ,tested with YouTube addon and Netflix .
I only tested with these ones because it was reproducible at 100%, so most likely will also fix other addons affected by this bug.

You said that you already have the PR on hold, so in this case feel free to raise the PR with LibreELEC.

@pretoriano80
Copy link
Author

If someone wants to test the patch before a PR is raised,here's my branch with the patch -> https://github.com/pretoriano80/LibreELEC.tv/tree/revert-bpo46070

@prahal
Copy link
Contributor

prahal commented Mar 30, 2022

@WallyCZ you should definitely open a bug report, against the addon. Even if it is a python issue the addon manager might be able to help you narrow a test case. You have enough debug if this is an addon issue.
The fact that you cannot produce the LibreElec pydebug build after a make clean is a bad point. If you could get trace with a non pydebug build but with DEBUG="Python3,kodi" it will help check it is not related to this nonclean build.

I will not investigate further this issue for a long while as I have more pressing issues.
At least I had no crash with non pydebug build though I have the addon that crashes with it, ie script.tubecase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants