[New-bugs-announce] [issue21418] Segv during call to super_init in application embedding Python interpreter.

Robert Snoeberger report at bugs.python.org
Fri May 2 21:22:40 CEST 2014


New submission from Robert Snoeberger:

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 file Objects/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.

----------
files: super_invoke.c
messages: 217777
nosy: snoeberger
priority: normal
severity: normal
status: open
title: Segv during call to super_init in application embedding Python interpreter.
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file35131/super_invoke.c

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21418>
_______________________________________


More information about the New-bugs-announce mailing list