New submission from Benoit Hudson <benoit.hud...@imaginary-spaces.com>:

On OSX, with --enable-shared, if you shut down python and reinitialize, you can 
get a crash.

Repro steps: see attached crashy.c
gcc -I. -I ../Include/ -L. crashy.c -lpython3.9
./a.out

On OSX, with --enable-shared, you get a crash! On other platforms including on 
OSX static builds, no crash.

Not a regression: it's present in 2.7 (where we actually hit it).

PR incoming, the fix is simple. It has to do with caching (on OSX shared builds 
only) a stale value for the environment when building os.environ the first 
time; if you change the environment, the second initialization reads garbage 
when building os.environ.

----------
components: Interpreter Core, macOS
files: crashy.c
messages: 350309
nosy: Benoit Hudson, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: crash reimporting posix after Py_Finalize on mac
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file48559/crashy.c

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

Reply via email to