Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue3356] some tests fail with Py_DEBUG (test_distutils, test_set)

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 26, 2008, 5:37 AM

Post #1 of 2 (128 views)
Permalink
[issue3356] some tests fail with Py_DEBUG (test_distutils, test_set)

Antoine Pitrou <pitrou[at]free.fr> added the comment:

Hmm, ok. I was using `make EXTRA_CFLAGS="-DPy_DEBUG"`, but it wouldn't
undefine NDEBUG so the assert() macro wouldn't be enabled.
By using `make EXTRA_CFLAGS="-DPy_DEBUG -UNDEBUG"` instead it's fine.

But that makes test_c_api in setobject.c bogus, because it relies on the
execution of assert() statements to modify the refcount of certain
objects - which doesn't happen when assert() is optimized out. The only
reason it doesn't crash in non-debug mode is that the deallocated
objects are still intact in memory, and Py_REFCNT simply drops their
refcount field to -1 without bothering.

It also means the following statement in Misc/SpecialBuilds.txt is
misleading:

« Py_DEBUG implies LLTRACE, Py_REF_DEBUG, Py_TRACE_REFS, and
PYMALLOC_DEBUG (if WITH_PYMALLOC is enabled). In addition, C
assert()s are enabled (via the C way: by not defining NDEBUG) »

I haven't looked at the distutils problem yet.

----------
assignee: -> georg.brandl
components: +Documentation -Tests
nosy: +georg.brandl
priority: -> high
title: some tests fail in debug mode (test_distutils, test_set) -> some tests fail with Py_DEBUG (test_distutils, test_set)
type: crash -> behavior
versions: +Python 2.6

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3356>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 26, 2008, 5:39 AM

Post #2 of 2 (112 views)
Permalink
[issue3356] some tests fail with Py_DEBUG (test_distutils, test_set) [In reply to]

Antoine Pitrou <pitrou[at]free.fr> added the comment:

> Py_REFCNT simply drops their refcount field to -1 without bothering.

I meant Py_DECREF.

----------
components: +Tests
type: behavior -> crash

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3356>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.