classification
Title: Building with configure option "--without-doc-strings" crashes first time through PyUnicode_DecodeUTF8Stateful
Type: crash Stage: resolved
Components: Interpreter Core Versions: Python 3.3
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Initialization of globals in unicodeobject.c
View: 10156
Assigned To: Nosy List: Arfrever, Gregory.Andersen, franck, georg.brandl, pitrou, skrah
Priority: critical Keywords:

Created on 2012-10-05 16:45 by Gregory.Andersen, last changed 2013-01-07 23:29 by skrah. This issue is now closed.

Messages (6)
msg172097 - (view) Author: Gregory Andersen (Gregory.Andersen) Date: 2012-10-05 16:45
Seems unicode_empty is still NULL at this point.

A gdb backtrace from an x86_64 build.  Reproduced on i686 and mips build as well.

Program received signal SIGSEGV, Segmentation fault.
0x000000000044f61e in PyUnicode_DecodeUTF8Stateful (s=0x59a767 "", size=0, errors=0x0, consumed=0x0) at Objects/unicodeobject.c:4726
4726	        Py_INCREF(unicode_empty);
(gdb) bt
#0  0x000000000044f61e in PyUnicode_DecodeUTF8Stateful (s=0x59a767 "", size=0, errors=0x0, consumed=0x0) at Objects/unicodeobject.c:4726
#1  0x0000000000433087 in PyType_Ready (type=0x7d5340) at Objects/typeobject.c:4235
#2  0x00000000004332ae in PyType_Ready (type=<optimized out>) at Objects/typeobject.c:4116
#3  PyType_Ready (type=0x7d54e0) at Objects/typeobject.c:4146
#4  0x000000000041bbfe in _Py_ReadyTypes () at Objects/object.c:1576
#5  0x00000000004a6eb0 in _Py_InitializeEx_Private (install_sigs=<optimized out>, install_importlib=<optimized out>) at Python/pythonrun.c:301
#6  Py_InitializeEx (install_sigs=<optimized out>) at Python/pythonrun.c:401
#7  Py_Initialize () at Python/pythonrun.c:407
#8  0x00000000004bb9fc in Py_Main (argc=1, argv=0x82f010) at Modules/main.c:646
#9  0x000000000041949e in main (argc=1, argv=0x7fffffffe658) at ./Modules/python.c:66
msg172101 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-10-05 17:06
This seems related to #9242: _Py_InitializeEx_Private() calls _Py_ReadyTypes(),
which uses the Unicode API, well before actually calling _PyUnicode_Init().
msg172102 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-10-05 17:15
Sorry, wrong issue number: Related to #10156.
msg175910 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-11-18 19:41
Does this need to be a release blocker? I don't know what the concrete point of --without-doc-strings is.
msg175912 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-11-18 19:50
The deeper issue is that globals in unicodeobject.c are used before
they are initialized. So I thought that should be cleared up before
the next release.

Basically, strings are used as keys during type initializations
*before* _PyUnicode_Init() is called.
msg179295 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2013-01-07 23:29
Closing as a duplicate of #10156, which has several patches.
History
Date User Action Args
2013-01-07 23:29:13skrahsetstatus: open -> closed
superseder: Initialization of globals in unicodeobject.c
messages: + msg179295

resolution: duplicate
stage: needs patch -> resolved
2013-01-05 21:50:15francksetnosy: + franck
2013-01-04 23:41:35Arfreversetnosy: + Arfrever
2012-11-18 19:57:32georg.brandlsetpriority: release blocker -> critical
2012-11-18 19:50:01skrahsetmessages: + msg175912
2012-11-18 19:41:22pitrousetnosy: + pitrou
messages: + msg175910
2012-10-05 17:15:34skrahsetmessages: + msg172102
2012-10-05 17:06:08skrahsetpriority: normal -> release blocker

nosy: + georg.brandl, skrah
messages: + msg172101

stage: needs patch
2012-10-05 16:45:15Gregory.Andersencreate