-
Notifications
You must be signed in to change notification settings - Fork 123
Crash of Python binding #25
Comments
Works for me...
|
The crash happens when trying elektra 0.8.6. I've not checked again with current Git/master. |
Please retest with master. SWIG bindings have preview state in 0.8.6 so I don't care much. Imho you shouldn't package them at all until the next release. |
I can reproduce the crash as well, python3 binding built from current Git/master on a Debian/Jessie system (Python3 3.4.1, swig 2.0.12).
Not a problem preventing an upload at least to Debian experimental. |
I'm still not able to reproduce this on Fedora. SWIG 2.0.12 works fine here. Don't have any Debian machine available. Can you post the backtrace? |
(shortened) ...... frame 83
is quite amusing
|
I spend more than 24h to trace this allocation bug, but finally found the issue. In short, the bug only happens if python is build with:
As soon as you remove one of these the bug won't get triggered anymore. Tracing this at the source code level, the allocation failure happens in the swig generated file at the PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None) call. This is used to create the shadowed instance of the exception. Tracing this call in the python source will get you to the object_new function in Objects/typeobject.c. The failing condition is type->tp_new != object_new. Since type is our data->newargs, couldn't we just call data->newargs->tp_new(data->newargs, ...) to fix this issue? Turns out we can: swig/swig@c063bb8 So the fix is to update swig or just patch the generated swig file. P.S. No idea why this doesn't happen if python gets build without LTO or gcov or even pickle?!... @pinotree is it ok to close this issue? |
Thanks for the detailed analysis!
It looks like this is available only in swig 3, so I'll try to switch to it in my next Debian releases.
I guess it is, thanks for your work. |
afaik swig 2 is dead |
Pino Toscano wrote:
The text was updated successfully, but these errors were encountered: