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

Oops, it's my fault! PR 15415 fix the crash.

The regression was introduced by:

commit 74f6568bbd3e70806ea3219e8bacb386ad802ccf
Author: Victor Stinner <vstin...@redhat.com>
Date:   Fri Mar 15 15:08:05 2019 +0100

    bpo-36301: Add _PyWstrList structure (GH-12343)

Simplified change:

-        static wchar_t *empty_argv[1] = {L""};
+        wchar_t* empty_argv[1] = {L""};

It's a deliberate change to not waste memory: PySys_SetArgvEx() 
(make_sys_argv()) is only called once, whereas static keeps the memory for the 
whole lifecycle of the process.

But I didn't notice a subtle issue with memory allocated on the stack: the code 
works well with gcc -O0! The bug only triggers with gcc -O3.

----------

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

Reply via email to