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 2012年03月16日 12:33 by skrah, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| crasher.py | skrah, 2012年03月16日 12:33 | |||
| Messages (9) | |||
|---|---|---|---|
| msg156017 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2012年03月16日 12:33 | |
Hi -- I'm getting a segfault running the attached crasher.py script. Valgrind traces it down to an Invalid free() / delete / delete[] in _PyUnicode_Ready(). Reproduce: ========== Rev: 870c0ef7e8a2 Build: ./configure --without-pymalloc CFLAGS="-O0 -g" && make $ ./python crasher.py Segmentation fault $ valgrind --db-attach=yes --suppressions=./Misc/valgrind-python.supp ./python crasher.py ==3476== Memcheck, a memory error detector ==3476== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==3476== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==3476== Command: ./python crasher.py ==3476== ==3476== Invalid free() / delete / delete[] ==3476== at 0x4C2748D: free (vg_replace_malloc.c:366) ==3476== by 0x44763C: _PyUnicode_Ready (unicodeobject.c:1405) ==3476== by 0x44ACF8: PyUnicode_FromFormatV (unicodeobject.c:2500) ==3476== by 0x4A1CF4: PyErr_Format (errors.c:621) ==3476== by 0x42F8FE: type_getattro (typeobject.c:2551) ==3476== by 0x43493A: wrap_binaryfunc (typeobject.c:4317) ==3476== by 0x550008: wrapper_call (descrobject.c:1067) ==3476== by 0x532C93: PyObject_Call (abstract.c:2150) ==3476== by 0x49012B: PyEval_CallObjectWithKeywords (ceval.c:3920) ==3476== by 0x54F136: wrapperdescr_call (descrobject.c:309) ==3476== by 0x532C93: PyObject_Call (abstract.c:2150) ==3476== by 0x491A1E: ext_do_call (ceval.c:4355) ==3476== Address 0x4 is not stack'd, malloc'd or (recently) free'd ==3476== |
|||
| msg156023 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2012年03月16日 13:07 | |
3.2 also crashes. 2.7 runs fine. So it's certainly not related to the new Unicode API. |
|||
| msg156026 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2012年03月16日 13:49 | |
I've traced it down to this line: >>> getattr(type, '__getattribute__')(type, type) Segmentation fault Setting to 'normal', since there are apparently more of these. |
|||
| msg156029 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2012年03月16日 14:04 | |
One-line crasher: type.__getattribute__(type, type) Python 2.7 does not crash reliably, but is not exempt from the bug: type.__getattribute__(type, 1.1j) |
|||
| msg156037 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年03月16日 14:37 | |
New changeset b7bad204b34f by Benjamin Peterson in branch '3.2': check to make sure the attribute is a string (#14334) http://hg.python.org/cpython/rev/b7bad204b34f New changeset e44591015cf0 by Benjamin Peterson in branch 'default': merge 3.2 (#14334) http://hg.python.org/cpython/rev/e44591015cf0 |
|||
| msg156043 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年03月16日 14:46 | |
New changeset d1cf6008a565 by Benjamin Peterson in branch '2.7': check to make sure the attribute is a string (#14334) http://hg.python.org/cpython/rev/d1cf6008a565 |
|||
| msg156045 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2012年03月16日 14:49 | |
It doesn't crash for me anymore. |
|||
| msg156052 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) | Date: 2012年03月16日 15:09 | |
well, on 2.6 and 2.7 the following has weird output and crashes: def test(obj): try: type(obj).__getattribute__(obj, (1,)) except AttributeError as e: print(e) class C: pass test(str) test(C) test(C()) |
|||
| msg156056 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年03月16日 15:58 | |
New changeset 3d4d52e47431 by Benjamin Peterson in branch '2.7': check for string attribute names in old-style classes (closes #14334) http://hg.python.org/cpython/rev/3d4d52e47431 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:28 | admin | set | github: 58542 |
| 2012年03月16日 15:58:58 | python-dev | set | status: open -> closed messages: + msg156056 stage: needs patch -> resolved |
| 2012年03月16日 15:09:12 | amaury.forgeotdarc | set | status: closed -> open messages: + msg156052 |
| 2012年03月16日 14:49:31 | benjamin.peterson | set | status: open -> closed nosy: + benjamin.peterson messages: + msg156045 resolution: fixed |
| 2012年03月16日 14:46:32 | python-dev | set | messages: + msg156043 |
| 2012年03月16日 14:37:00 | python-dev | set | nosy:
+ python-dev messages: + msg156037 |
| 2012年03月16日 14:04:55 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc messages: + msg156029 |
| 2012年03月16日 13:49:06 | skrah | set | priority: high -> normal messages: + msg156026 title: Invalid free in _PyUnicode_Ready() -> Crash: getattr(type, '__getattribute__')(type, type) |
| 2012年03月16日 13:07:50 | skrah | set | messages:
+ msg156023 versions: + Python 3.2 |
| 2012年03月16日 12:33:40 | skrah | create | |