
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2014-05-02 19:22 bysnoeberger, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| super_invoke.c | snoeberger,2014-05-02 19:22 | |||
| Messages (3) | |||
|---|---|---|---|
| msg217777 -(view) | Author: Robert Snoeberger (snoeberger) | Date: 2014-05-02 19:22 | |
While embedding the Python interpreter in an application, I have encountered a crash when the built-in function 'super' is invoked with no arguments. The crash occurs during a call to PyObject_Call.A file is attached, super_invoke.c, that reproduces the crash. The reproduction steps on my machine are the following:% gcc -o super_invoke super_invoke.c -I/path_to_py/include/python3.5m -L/path_to_py/lib -lpthread -ldl -lutil -lm -lpython3.5m -Xlinker -export-dynamic % ./super_invoke Call super with no arguments...Segmentation fault% The crash appears to occur in the function super_init contained in the fileObjects/typeobject.c. The code path enters the if statement that checks for no input arguments. The following two lines cause the crash.PyFrameObject *f = PyThreadState_GET()->frame;PyCodeObject *co = f->f_code;The PyFrameObject pointer 'f' is NULL. | |||
| msg218377 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2014-05-12 23:33 | |
New changesetcee528d44b1e by Victor Stinner in branch '3.4':Issue#21418: Fix a crash in the builtin function super() when called withouthttp://hg.python.org/cpython/rev/cee528d44b1eNew changeset53cf343c4fff by Victor Stinner in branch 'default':(Merge 3.4) Issue#21418: Fix a crash in the builtin function super() whenhttp://hg.python.org/cpython/rev/53cf343c4fff | |||
| msg218378 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2014-05-12 23:35 | |
"While embedding the Python interpreter in an application, I have encountered a crash when the built-in function 'super' is invoked with no arguments."This is not supported. When super() is invoked with no arguments, the class is retrieved (indirectly) from the current frame. In your example, there is no current frame. You can workaround this limitation by passing explicitly the class to super.The crash should be fixed: a RuntimeError is now raised. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:03 | admin | set | github: 65617 |
| 2014-05-12 23:35:48 | vstinner | set | status: open -> closed resolution: fixed |
| 2014-05-12 23:35:40 | vstinner | set | messages: +msg218378 |
| 2014-05-12 23:33:17 | python-dev | set | nosy: +python-dev messages: +msg218377 |
| 2014-05-04 22:07:47 | pitrou | set | nosy: +benjamin.peterson |
| 2014-05-02 19:50:56 | vstinner | set | nosy: +vstinner |
| 2014-05-02 19:22:40 | snoeberger | create | |