Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failures in non-pydebug builds without NDEBUG. #58714

Closed
Yhg1s opened this issue Apr 5, 2012 · 2 comments
Closed

Build failures in non-pydebug builds without NDEBUG. #58714

Yhg1s opened this issue Apr 5, 2012 · 2 comments
Labels
build The build process and cross-build interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker

Comments

@Yhg1s
Copy link
Member

Yhg1s commented Apr 5, 2012

BPO 14509
Nosy @Yhg1s, @birkenfeld, @benjaminp

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2012-04-09.19:06:02.675>
created_at = <Date 2012-04-05.13:42:50.659>
labels = ['interpreter-core', 'build', 'release-blocker']
title = 'Build failures in non-pydebug builds without NDEBUG.'
updated_at = <Date 2012-04-09.19:06:02.674>
user = 'https://github.com/Yhg1s'

bugs.python.org fields:

activity = <Date 2012-04-09.19:06:02.674>
actor = 'python-dev'
assignee = 'none'
closed = True
closed_date = <Date 2012-04-09.19:06:02.675>
closer = 'python-dev'
components = ['Interpreter Core']
creation = <Date 2012-04-05.13:42:50.659>
creator = 'twouters'
dependencies = []
files = []
hgrepos = []
issue_num = 14509
keywords = []
message_count = 2.0
messages = ['157586', '157881']
nosy_count = 4.0
nosy_names = ['twouters', 'georg.brandl', 'benjamin.peterson', 'python-dev']
pr_nums = []
priority = 'release blocker'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue14509'
versions = ['Python 2.7']

@Yhg1s
Copy link
Member Author

Yhg1s commented Apr 5, 2012

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

@Yhg1s Yhg1s added release-blocker interpreter-core (Objects, Python, Grammar, and Parser dirs) build The build process and cross-build labels Apr 5, 2012
@python-dev
Copy link
Mannequin

python-dev mannequin commented Apr 9, 2012

New changeset a11a2bbd8241 by Benjamin Peterson in branch '2.7':
fix build without Py_DEBUG and DNDEBUG (closes bpo-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 bpo-14509)
http://hg.python.org/cpython/rev/64bb1d258322

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

New changeset c20f604a2da6 by Benjamin Peterson in branch 'default':
merge 3.2 (bpo-14509)
http://hg.python.org/cpython/rev/c20f604a2da6

@python-dev python-dev mannequin closed this as completed Apr 9, 2012
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker
Projects
None yet
Development

No branches or pull requests

1 participant