Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue21418

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Segv during call to super_init in application embedding Python interpreter.
Type:crashStage:
Components:Versions:Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: benjamin.peterson, python-dev, snoeberger, vstinner
Priority:normalKeywords:

Created on2014-05-02 19:22 bysnoeberger, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
super_invoke.csnoeberger,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)(Python triager)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)*(Python committer)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
DateUserActionArgs
2022-04-11 14:58:03adminsetgithub: 65617
2014-05-12 23:35:48vstinnersetstatus: open -> closed
resolution: fixed
2014-05-12 23:35:40vstinnersetmessages: +msg218378
2014-05-12 23:33:17python-devsetnosy: +python-dev
messages: +msg218377
2014-05-04 22:07:47pitrousetnosy: +benjamin.peterson
2014-05-02 19:50:56vstinnersetnosy: +vstinner
2014-05-02 19:22:40snoebergercreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp