STINNER Victor <vstin...@redhat.com> added the comment:

Oh. So Py_FinalizeEx() does get a SIGSEGV when triggering a garbage collection: 
the test doesn't crash, it's Python which crash at exit.

> Program received signal SIGSEGV, Segmentation fault.
> 0x00002aaaaae88924 in visit_decref (op=0x2aaaaacd3468, data=0x0) at 
> Modules/gcmodule.c:271
> 271       if (PyObject_IS_GC(op)) {

You can try to dump the content of op? For example:

(gdb) print *op
(gdb) print *op->ob_type


Can you try to rebuild Python from source in debug mode, and then retry the 
script? Something like:
---
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
tar -xf Python-3.7.4.tar.xz 
cd Python-3.7.4/
./configure --with-pydebug --prefix /opt/py37
make
./python script.py
# no need to install Python
---

If it works, maybe retry without --with-pydebug.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37565>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to