pytest segfault, not with -v

Dieter Maurer dieter at handshake.de
Sat Dec 18 12:33:25 EST 2021


Marco Sulla wrote at 2021-12-18 14:10 +0100:
>Ok, I created the script:
>
>https://github.com/Marco-Sulla/python-frozendict/blob/master/test/debug.py
>
>The problem is it does _not_ crash, while a get a segfault using
>pytest with python 3.9 on MacOS 10.15
>
>Maybe it's because I'm using eval / exec in the script?

Segfaults can result from C stack overflow which in turn can
be caused in special cases by too deeply nested function calls
(usually, Python's "maximal recursion depth exceeded" prevents
this before a C stack overflow).

Otherwise, whatever you do in Python (this includes "eval/exec")
should not cause a segfault. The cause for it likely comes from
a memory management bug in some C implemented part of your
application.

Note that memory management bugs may not show deterministic
behavior. Minor changes (such as "with/without -v")
can significantly change the outcome.


More information about the Python-list mailing list