You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2014-05-12.23:35:48.744>created_at=<Date2014-05-02.19:22:40.702>labels= ['type-crash']
title='Segv during call to super_init in application embedding Python interpreter.'updated_at=<Date2014-05-12.23:35:48.743>user='https://github.com/ruibo'
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.
"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.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: