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.

Author twouters
Recipients benjamin.peterson, twouters
Date 2012-04-05.13:42:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1333633371.25.0.0777678806587.issue14509@psf.upfronthosting.co.za>
In-reply-to
Content
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.)
History
Date User Action Args
2012-04-05 13:42:51twouterssetrecipients: + twouters, benjamin.peterson
2012-04-05 13:42:51twouterssetmessageid: <1333633371.25.0.0777678806587.issue14509@psf.upfronthosting.co.za>
2012-04-05 13:42:50twouterslinkissue14509 messages
2012-04-05 13:42:50twouterscreate