classification
Title: crash reimporting posix after Py_Finalize on mac
Type: crash Stage: patch review
Components: Interpreter Core, macOS Versions: Python 3.9, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Benoit Hudson, ned.deily, ronaldoussoren
Priority: normal Keywords: patch

Created on 2019-08-23 15:39 by Benoit Hudson, last changed 2019-10-10 15:23 by Benoit Hudson.

Files
File name Uploaded Description Edit
crashy.c Benoit Hudson, 2019-08-23 15:39
Pull Requests
URL Status Linked Edit
PR 15428 open Benoit Hudson, 2019-08-23 16:07
Messages (2)
msg350309 - (view) Author: Benoit Hudson (Benoit Hudson) * Date: 2019-08-23 15:39
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.
msg354387 - (view) Author: Benoit Hudson (Benoit Hudson) * Date: 2019-10-10 15:23
Ping! The patch has been ready for review for over a month.

If the patch can be backported to 2.7.x before that gets end-of-lifed it would be ideal.
History
Date User Action Args
2019-10-10 15:23:12Benoit Hudsonsetmessages: + msg354387
versions: + Python 2.7
2019-08-23 16:07:35Benoit Hudsonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request15125
2019-08-23 15:39:47Benoit Hudsoncreate