New submission from Thomas Wouters <tho...@python.org>:

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.)

----------
components: Interpreter Core
messages: 157586
nosy: benjamin.peterson, twouters
priority: release blocker
severity: normal
status: open
title: Build failures in non-pydebug builds without NDEBUG.
type: compile error
versions: Python 2.7

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

Reply via email to