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.
Created on 2008年07月14日 21:15 by pitrou, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 6522 | closed | sblondon, 2018年04月18日 18:45 | |
| Messages (7) | |||
|---|---|---|---|
| msg69661 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年07月14日 21:15 | |
With the latest py3k, some tests fail when run in debug mode: - test_distutils fails with the following message: FAILED (errors=1) Traceback (most recent call last): File "Lib/test/test_distutils.py", line 17, in <module> test_main() File "Lib/test/test_distutils.py", line 13, in test_main test.support.run_unittest(distutils.tests.test_suite()) File "/home/antoine/py3k/pristine/Lib/test/support.py", line 717, in run_unittest _run_suite(suite) File "/home/antoine/py3k/pristine/Lib/test/support.py", line 700, in _run_suite raise TestFailed(err) test.support.TestFailed: Traceback (most recent call last): File "/home/antoine/py3k/pristine/Lib/distutils/tests/test_build_ext.py", line 48, in test_build_ext import xx AttributeError: mro - test_set crashes with the following message: ./python Lib/test/test_set.py test_add (__main__.TestSet) ... ok test_and (__main__.TestSet) ... ok test_badcmp (__main__.TestSet) ... ok test_c_api (__main__.TestSet) ... Fatal Python error: Objects/setobject.c:2429 object at 0xb797ce04 has negative ref count -1 Abandon |
|||
| msg69663 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2008年07月14日 21:45 | |
I'll look at the test_set failure if no one else gets to it first. |
|||
| msg69666 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年07月14日 22:54 | |
Neither of these fail for me on MacOS. |
|||
| msg69667 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年07月14日 23:17 | |
On another machine, with another distro (Debian stable) and another gcc version (4.1.2 instead of 4.3.1), I even get a segmentation fault on test_distutils: $ ./python Lib/test/test_set.py test_add (__main__.TestSet) ... ok test_and (__main__.TestSet) ... ok test_badcmp (__main__.TestSet) ... ok test_c_api (__main__.TestSet) ... Fatal Python error: Objects/setobject.c:2429 object at 0xb761ce04 has negative ref count -1 Abandon $ ./python Lib/test/test_distutils.py test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase) ... Erreur de segmentation |
|||
| msg69674 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2008年07月15日 06:01 | |
I can't reproduce the error using Windows. |
|||
| msg70299 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年07月26日 12:37 | |
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. |
|||
| msg70300 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年07月26日 12:39 | |
> Py_REFCNT simply drops their refcount field to -1 without bothering. I meant Py_DECREF. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:36 | admin | set | github: 47606 |
| 2018年04月18日 18:45:49 | sblondon | set | pull_requests: + pull_request6216 |
| 2010年10月21日 17:11:27 | pitrou | set | status: open -> closed resolution: wont fix |
| 2009年05月16日 20:35:19 | ajaksu2 | set | priority: high -> low nosy: georg.brandl, rhettinger, pitrou, benjamin.peterson title: some tests fail with Py_DEBUG (test_distutils, test_set) -> some tests fail with 'make EXTRA_CFLAGS="-DPy_DEBUG"' (test_distutils, test_set) components: + Build versions: + Python 3.1, - Python 3.0 |
| 2008年07月26日 12:39:56 | pitrou | set | type: behavior -> crash messages: + msg70300 components: + Tests |
| 2008年07月26日 12:37:07 | pitrou | set | priority: high assignee: georg.brandl type: crash -> behavior components: + Documentation, - Tests title: some tests fail in debug mode (test_distutils, test_set) -> some tests fail with Py_DEBUG (test_distutils, test_set) nosy: + georg.brandl versions: + Python 2.6 messages: + msg70299 |
| 2008年07月15日 06:01:17 | rhettinger | set | messages: + msg69674 |
| 2008年07月14日 23:17:44 | pitrou | set | messages: + msg69667 |
| 2008年07月14日 22:54:33 | benjamin.peterson | set | nosy:
+ benjamin.peterson messages: + msg69666 |
| 2008年07月14日 21:45:36 | rhettinger | set | nosy:
+ rhettinger messages: + msg69663 |
| 2008年07月14日 21:15:26 | pitrou | create | |