[issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression)

2022-03-24 Thread Alban Browaeys


Alban Browaeys  added the comment:

sqlite3_crash.py does not crashes on python 3.9 below and equal 3.9.9 and 
python main branch 12c0012cf97d21bc637056983ede0eaf4c0d9c33. I confirm it 
crashes on python 3.9.10, 3.9.11, 3.10 branch commit 
9006b4471cc4d74d0cbf782d841a330b0f46a3d0 .
It is fixed in main branch commit 12c0012cf97d21bc637056983ede0eaf4c0d9c33 .

Currently bisecting both 3.9.9 to 3.9.10 and 3.10 to 3.11 main branch for bad 
to good.

The patches in this bug report are already merged in the 3.10 branch which 
crash.

I cannot reproduce win_py399_crash_reproducer.py which I used as a basis for 
this test case.
The backtrace is the same as the ones from the crashes of the kodi addons (me 
Jellyfin Kodi addon), which is the initial report .
This looks like importing sqlite3 in threads plays badly.

I can reproduce on aarch64 (Odroid C2) LibreElec and builds of cpython on 
Debian stable x86_64 (the extensive testing of the broken interpreters is done 
on x86_64 Debian stable bullseye with a cpython clone and running from 
builddir).

--
nosy: +prahal
Added file: https://bugs.python.org/file50699/sqlite3_crash.py

___
Python tracker 
<https://bugs.python.org/issue46070>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression)

2022-03-24 Thread Alban Browaeys


Alban Browaeys  added the comment:

By "It is fixed in main branch commit 12c0012cf97d21bc637056983ede0eaf4c0d9c33 
." I mean that this commit is good not that this commit fixes the issue.

--

___
Python tracker 
<https://bugs.python.org/issue46070>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression)

2022-03-24 Thread Alban Browaeys


Alban Browaeys  added the comment:

I did 3.9 branch bisect and commit 52937c26adc35350ca0402070160cf6dc838f359 
bpo-46070: _PyGC_Fini() untracks objects (GH-30577) (GH-30580) is the one that 
broke 3.9 . While with my main branch builds this commit is fine, it is not for 
the 3.9 branches.

Proceeding with 3.10 branch bisect of first bad commit and redoing main branch 
first good commit.

--

___
Python tracker 
<https://bugs.python.org/issue46070>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression)

2022-03-24 Thread Alban Browaeys


Alban Browaeys  added the comment:

3.10 branch is fixed if I revert e6bb17fe29713368e1fd93d9ac9611017c4f570c 
bpo-46070: _PyGC_Fini() untracks objects (GH-30577). Be it if I revert it atop 
current head 9006b4471cc4d74d0cbf782d841a330b0f46a3d0 or if I test the commit 
before e6bb17fe29713368e1fd93d9ac9611017c4f570c was merged.

As this made no sense with regards to this bug report history that this fix 
broke the branch, I tried v3.10.1 which lacks this fix. Vanilla is broken too. 
Also applying the "_PyGC_Fini untracks objects" upon 3.10.1 does not fix the 
test case crash.

I am puzzled. Will try to bisect the commit that fixed the testcase in the 3.10 
branch before "_PyGC_Fini untracks objects" was merged and after 3.10.1.

--

___
Python tracker 
<https://bugs.python.org/issue46070>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression)

2022-03-24 Thread Alban Browaeys


Alban Browaeys  added the comment:

While bisecting main branch I did not only get segfaults but also exceptions, 
namely:

$ ./python  ../python-crash-kodi/sqlite3_crash.py 
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File 
"/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", 
line 81, in register_adapters_and_converters
register_adapter(datetime.datetime, adapt_datetime)
KeyError: 'isoformat'
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File 
"/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", 
line 83, in register_adapters_and_converters
register_converter("timestamp", convert_timestamp)
KeyError: 'timepart_full'
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File 
"/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", 
line 83, in register_adapters_and_converters
register_converter("timestamp", convert_timestamp)
KeyError: 'day'
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File 
"/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", 
line 83, in register_adapters_and_converters
register_converter("timestamp", convert_timestamp)
KeyError: 'month'
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File 
"/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", 
line 83, in register_adapters_and_converters
register_converter("timestamp", convert_timestamp)
KeyError: 'year'
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File 
"/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", 
line 83, in register_adapters_and_converters
register_converter("timestamp", convert_timestamp)
KeyError: 'timepart'
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File 
"/home/prahal/Projects/WIP/libreelec/cpython_bisect/Lib/sqlite3/dbapi2.py", 
line 83, in register_adapters_and_converters
register_converter("timestamp", convert_timestamp)
KeyError: 'datepart'
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File "", line 688, in _load_unlocked
KeyError: 'convert_timestamp'
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File "", line 688, in _load_unlocked
KeyError: 'convert_date'
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File "", line 688, in _load_unlocked
KeyError: 'adapt_datetime'
Exception ignored deletion of interned string failed:
Traceback (most recent call last):
  File "", line 688, in _load_unlocked
KeyError: 'adapt_date'


The 3.10 branch bisect pointed to one commit that fix the crash after 3.10.1 
which is 72c260cf0c71eb01eb13100b751e9d5007d00b70 [3.10] bpo-46006: Revert 
"bpo-40521: Per-interpreter interned strings (GH-20085)" (GH-30422) (GH-30425) 
which makes sense regarding main branch logs. It is commit 
35d6540c904ef07b8602ff014e520603f84b5886 in the main branch.

What remains to be seen is why "bpo-46070: _PyGC_Fini() untracks objects 
(GH-30577)" looks fine in the main branch (though it has no effect on the 
import crash) and not in 3.9 and 3.10 branch.
Mind in the main branch "bpo-46006: Revert "bpo-40521: Per-interpreter interned 
strings (GH-20085)" (GH-30422)" was already applied when "bpo-46070: 
_PyGC_Fini() untracks objects (GH-30577)" went in so it was also unrelated to 
the fix of the initial report.

--

___
Python tracker 
<https://bugs.python.org/issue46070>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression)

2022-03-24 Thread Alban Browaeys


Alban Browaeys  added the comment:

bisect of main for bug.py with each local python builds get me to commit 
b127e70a8a682fe869c22ce04c379bd85a00db67 "bpo-46070: Fix asyncio initialization 
guard (GH-30423)" as the one that fixed bug.py most of the time.

At times I can make bug.py segfault be it on python 3.9, 3.10 or main branch. 
It is pretty hard (I can have a batch of 200 runs without an issue) but seems 
easier to reproduce with a CPU stressed, then I can have two segfaults in a 
batch of 50 runs.

Bash:
for i in {1..50}; do ./python  ../python-crash-kodi/bug.py ; done
or sh:
for i in `seq 1 50`; do ./python  ../python-crash-kodi/bug.py ; done

with:
stress -c `nproc --all` at the same time.

--

___
Python tracker 
<https://bugs.python.org/issue46070>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression)

2022-03-24 Thread Alban Browaeys


Alban Browaeys  added the comment:

I managed to reproduce the bug.py crash with main branch up to commit 
12c0012cf97d21bc637056983ede0eaf4c0d9c33 .

--
Added file: 
https://bugs.python.org/file50700/bug.py_asyncio_cpustressed-crash.log

___
Python tracker 
<https://bugs.python.org/issue46070>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com