This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Build failures in non-pydebug builds without NDEBUG.
Type: compile error Stage: resolved
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, georg.brandl, python-dev, twouters
Priority: release blocker Keywords:

Created on 2012-04-05 13:42 by twouters, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg157586 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2012-04-05 13:42
The hash randomization change conflates 'pydebug' builds (which define the 'Py_DEBUG' preprocessor symbol) and asserts (which use 'NDEBUG' instead.) While Py_DEBUG automatically unsets NDEBUG, the inverse is not true (and should not be true.)

In random.c (and Include/object.h), _Py_HashSecret_Initialized is defined as static or global depending on the value of Py_DEBUG. But in (at least) Objects/stringobject.c and Objects/unicodeobject.c, unguarded asserts are used that check the value of _Py_HashSecret_Initialized. This causes builds that define neither NDEBUG nor Py_DEBUG to fail. Either the guard used around the declaration and definition should be '#ifndef NDEBUG' instead of '#ifdef Py_DEBUG', or there should be a Py_DEBUG guard around the two assert statements.

(I would submit a patch but my development environment died during a nasty power outage yesterday.)
msg157881 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-04-09 19:06
New changeset a11a2bbd8241 by Benjamin Peterson in branch '2.7':
fix build without Py_DEBUG and DNDEBUG (closes #14509)
http://hg.python.org/cpython/rev/a11a2bbd8241

New changeset 64bb1d258322 by Benjamin Peterson in branch '3.1':
fix build without Py_DEBUG and DNDEBUG (closes #14509)
http://hg.python.org/cpython/rev/64bb1d258322

New changeset 5168483316b5 by Benjamin Peterson in branch '3.2':
merge 3.1 (#14509)
http://hg.python.org/cpython/rev/5168483316b5

New changeset c20f604a2da6 by Benjamin Peterson in branch 'default':
merge 3.2 (#14509)
http://hg.python.org/cpython/rev/c20f604a2da6
History
Date User Action Args
2022-04-11 14:57:28adminsetgithub: 58714
2012-04-09 19:06:02python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg157881

resolution: fixed
stage: resolved
2012-04-05 19:04:11pitrousetnosy: + georg.brandl
2012-04-05 13:42:50twouterscreate