Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.4.0 RC1+7: *** glibc detected *** python: corrupted double-linked list #3304

Closed
letmaik opened this issue Jul 25, 2014 · 25 comments
Closed
Assignees
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. status: confirmed bug
Milestone

Comments

@letmaik
Copy link
Contributor

letmaik commented Jul 25, 2014

I just spent a day figuring out where *** glibc detected *** .../bin/python: corrupted double-linked list: 0x00000000069a01a0 *** was coming from. I installed the latest 1.4.x branch version, so I thought that something must have happened there. Bisecting the commits and testing different versions, I found that 7b39e78 introduced the problem. The errors happen randomly and the stacktraces are different most of the time. Some examples:

*** glibc detected *** .../p27/bin/python: corrupted double-linked list: 0x00000000069a01a0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x76166)[0x7f95f35c2166]
/lib64/libc.so.6(+0x79f9a)[0x7f95f35c5f9a]
/lib64/libc.so.6(__libc_malloc+0x71)[0x7f95f35c69a1]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyString_FromStringAndSize+0xda)[0x7f95f4224c6a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyUnicodeUCS2_EncodeUTF8+0x1be)[0x7f95f424860e]
.../p27/lib/python2.7/lib-dynload/_io.so(+0x15111)[0x7f95ec053111]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5910)[0x7f95f427f000]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f95f41fef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f95f41cf9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f95f427d81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f95f427ed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f95f427ed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f95f427ed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f95f427ed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f95f41fef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f95f41cf9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f95f427d81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f95f427ed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f95f41fef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f95f41cf9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f95f427d81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76e21)[0x7f95f41fee21]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f95f41cf9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f95f427d81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f95f41fef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f95f41cf9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f95f427d81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f95f427ed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f95f41fef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f95f41cf9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f95f427d81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f95f41fef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f95f41cf9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f95f427d81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f95f41fef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f95f41cf9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f95f427d81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f95f427ed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f95f427ed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f95f41fef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f95f41cf9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f95f427d81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f95f4280b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f95f41fef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f95f41cf9a3]
.../p27/lib/python2.7/lib-dynload/_functools.so(+0x1764)[0x7f95eba30764]
*** glibc detected *** .../p27/bin/python: corrupted double-linked list: 0x000000001771e600 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x76166)[0x7ffd5f3be166]
/lib64/libc.so.6(+0x79f9a)[0x7ffd5f3c1f9a]
/lib64/libc.so.6(__libc_malloc+0x71)[0x7ffd5f3c29a1]
.../p27/lib/python2.7/site-packages/numpy/core/multiarray.so(+0xa5782)[0x7ffd52c8f782]
.../p27/lib/python2.7/site-packages/numpy/core/multiarray.so(+0xe5eb6)[0x7ffd52ccfeb6]
.../p27/lib/python2.7/site-packages/numpy/core/multiarray.so(+0xe64be)[0x7ffd52cd04be]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5910)[0x7ffd6007b000]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ffd6007ad2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76e21)[0x7ffd5fffae21]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ffd5ffcb9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x5a0cf)[0x7ffd5ffde0cf]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ffd5ffcb9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(_PyObject_CallFunction_SizeT+0xac)[0x7ffd5ffcecbc]
.../p27/lib/python2.7/site-packages/numpy/core/multiarray.so(+0x61909)[0x7ffd52c4b909]
.../p27/lib/python2.7/site-packages/numpy/core/multiarray.so(+0x64a30)[0x7ffd52c4ea30]
.../p27/lib/python2.7/site-packages/numpy/core/multiarray.so(+0x65ab3)[0x7ffd52c4fab3]
.../p27/lib/python2.7/site-packages/matplotlib/_path.so(_Z31py_to_agg_transformation_matrixP7_objectb+0x74)[0x7ffd48ddb994]
.../p27/lib/python2.7/site-packages/matplotlib/_path.so(_ZN12_path_module14convert_to_svgERKN2Py5TupleE+0xb3)[0x7ffd48dc4003]
.../p27/lib/python2.7/site-packages/matplotlib/_path.so(_ZN2Py15ExtensionModuleI12_path_moduleE21invoke_method_varargsEPvRKNS_5TupleE+0x18)[0x7ffd48dcf828]
.../p27/lib/python2.7/site-packages/matplotlib/_path.so(method_varargs_call_handler+0x15d)[0x7ffd48dea20d]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5910)[0x7ffd6007b000]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ffd6007ad2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ffd6007ad2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ffd6007ad2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ffd6007ad2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ffd5fffaf28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ffd5ffcb9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ffd6007981a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ffd6007ad2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ffd5fffaf28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ffd5ffcb9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ffd6007981a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76e21)[0x7ffd5fffae21]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ffd5ffcb9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ffd6007981a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ffd5fffaf28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ffd5ffcb9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ffd6007981a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ffd6007ad2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ffd5fffaf28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ffd5ffcb9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ffd6007981a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ffd5fffaf28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ffd5ffcb9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ffd6007981a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ffd6007cb7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ffd5fffaf28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ffd5ffcb9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ffd6007981a]
*** glibc detected *** .../p27/bin/python: corrupted double-linked list: 0x0000000005905b40 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x76166)[0x7ff01fe0c166]
/lib64/libc.so.6(+0x79f9a)[0x7ff01fe0ff9a]
/lib64/libc.so.6(__libc_malloc+0x71)[0x7ff01fe109a1]
.../p27/lib/python2.7/site-packages/matplotlib/_path.so(_ZN12_path_module14convert_to_svgERKN2Py5TupleE+0x92c)[0x7ff00981287c]
.../p27/lib/python2.7/site-packages/matplotlib/_path.so(_ZN2Py15ExtensionModuleI12_path_moduleE21invoke_method_varargsEPvRKNS_5TupleE+0x18)[0x7ff00981d828]
.../p27/lib/python2.7/site-packages/matplotlib/_path.so(method_varargs_call_handler+0x15d)[0x7ff00983820d]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5910)[0x7ff020ac9000]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ff020ac8d2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ff020ac8d2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ff020ac8d2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ff020ac8d2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ff020a48f28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ff020a199a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ff020ac781a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ff020ac8d2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ff020a48f28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ff020a199a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ff020ac781a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76e21)[0x7ff020a48e21]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ff020a199a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ff020ac781a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ff020a48f28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ff020a199a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ff020ac781a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ff020ac8d2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ff020a48f28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ff020a199a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ff020ac781a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ff020a48f28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ff020a199a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ff020ac781a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ff020a48f28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ff020a199a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ff020ac781a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ff020ac8d2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ff020ac8d2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ff020a48f28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ff020a199a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7ff020ac781a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7ff020a48f28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ff020a199a3]
.../p27/lib/python2.7/lib-dynload/_functools.so(+0x1764)[0x7ff01827a764]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7ff020a199a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x4ddd)[0x7ff020ac84cd]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7ff020acab7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7ff020ac8d2a]
*** glibc detected *** .../p27/bin/python: corrupted double-linked list: 0x0000000009e18c50 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x76166)[0x7f6fb6e02166]
/lib64/libc.so.6(+0x79f9a)[0x7f6fb6e05f9a]
/lib64/libc.so.6(__libc_malloc+0x71)[0x7f6fb6e069a1]
.../p27/lib/python2.7/site-packages/matplotlib/_path.so(_ZN12_path_module14convert_to_svgERKN2Py5TupleE+0x92c)[0x7f6fa080887c]
.../p27/lib/python2.7/site-packages/matplotlib/_path.so(_ZN2Py15ExtensionModuleI12_path_moduleE21invoke_method_varargsEPvRKNS_5TupleE+0x18)[0x7f6fa0813828]
.../p27/lib/python2.7/site-packages/matplotlib/_path.so(method_varargs_call_handler+0x15d)[0x7f6fa082e20d]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5910)[0x7f6fb7abf000]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f6fb7abed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f6fb7abed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f6fb7abed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f6fb7abed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f6fb7a3ef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f6fb7a0f9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f6fb7abd81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f6fb7abed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f6fb7a3ef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f6fb7a0f9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f6fb7abd81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76e21)[0x7f6fb7a3ee21]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f6fb7a0f9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f6fb7abd81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f6fb7a3ef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f6fb7a0f9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f6fb7abd81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f6fb7abed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f6fb7a3ef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f6fb7a0f9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f6fb7abd81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f6fb7a3ef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f6fb7a0f9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f6fb7abd81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f6fb7a3ef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f6fb7a0f9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f6fb7abd81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f6fb7abed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f6fb7abed2a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f6fb7a3ef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f6fb7a0f9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x412a)[0x7f6fb7abd81a]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(+0x76f28)[0x7f6fb7a3ef28]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f6fb7a0f9a3]
.../p27/lib/python2.7/lib-dynload/_functools.so(+0x1764)[0x7f6faf270764]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyObject_Call+0x53)[0x7f6fb7a0f9a3]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x4ddd)[0x7f6fb7abe4cd]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x7f6fb7ac0b7e]
/opt/Python2.7/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x563a)[0x7f6fb7abed2a]

So, in summary: up until 760b2fc everything is fine, but with the following commit 7b39e78, my program crashes randomly when drawing things with matplotlib, usually after a few minutes of drawing plots.

As the crashes appear randomly I cannot be absolutely sure that up until 760b2fc the problem really is not appearing, but as I let it run for an hour without crashes I'm pretty confident.

I hope you can find out what's going on, I'm certainly not an expert in these things. One guess of me would be that something writes over the edge of the string array, and this then sometimes happens to be a doubly linked list which gets corrupted.

@tacaswell
Copy link
Member

It is odd that the tests don't trigger this.

@letmaik
Copy link
Contributor Author

letmaik commented Jul 25, 2014

Well, the tests are probably short ones, right? I plot hundreds of figures and allocate huge numpy arrays etc. And it only happens after a while. I guess this bug depends on the current memory layout to trigger an error.

@mdboom
Copy link
Member

mdboom commented Jul 25, 2014

Can you provide a standalone script to reproduce the problem?

@letmaik
Copy link
Contributor Author

letmaik commented Jul 25, 2014

I can try it next week, but the main problem is that 7b39e78 changes several things, so I guess it would be most useful if I apply each change on its own (the Py_XDECREF in RendererAgg::_draw_path_collection_generic, the PyBytes_ change in RendererAgg::tostring_rgba_minimized, etc.) and see if I can pinpoint it. After that I can try to create a test script which may be very similar to #3197 (comment). If you want to try to trigger the bug yourself, I'm basically drawing a single PolygonCollection in a figure with rasterized=True and save it as SVG, repeated many times.

@tacaswell
Copy link
Member

If the rasterization code path was broken when you ran these tests, that code path should not have been hit (as there were no temporary rasterized buffers).

@tacaswell
Copy link
Member

I ran a modified version of one of the demo (examples/api/collections_demo.py, see below) and let it run 18k times before I killed it.


'''Demonstration of LineCollection, PolyCollection, and
RegularPolyCollection with autoscaling.

For the first two subplots, we will use spirals.  Their
size will be set in plot units, not data units.  Their positions
will be set in data units by using the "offsets" and "transOffset"
kwargs of the LineCollection and PolyCollection.

The third subplot will make regular polygons, with the same
type of scaling and positioning as in the first two.

The last subplot illustrates the use of "offsets=(xo,yo)",
that is, a single tuple instead of a list of tuples, to generate
successively offset curves, with the offset given in data
units.  This behavior is available only for the LineCollection.

'''

import matplotlib.pyplot as plt
from matplotlib import collections, transforms
from matplotlib.colors import colorConverter
import numpy as np

import six
from six.moves import range
for j in range(1000000):
    if j % 1000 == 0:
        print j
    nverts = 500
    npts = 100

    # Make some spirals
    r = np.array(range(nverts))
    theta = np.array(range(nverts)) * (2*np.pi)/(nverts-1)
    xx = r * np.sin(theta)
    yy = r * np.cos(theta)
    spiral = list(zip(xx,yy))

    # Make some offsets
    rs = np.random.RandomState([12345678])
    xo = rs.randn(npts)
    yo = rs.randn(npts)
    xyo = list(zip(xo, yo))

    # Make a list of colors cycling through the rgbcmyk series.
    colors = [colorConverter.to_rgba(c) for c in ('r','g','b','c','y','m','k')]

    fig, axes = plt.subplots(2,2)
    ((ax1, ax2), (ax3, ax4)) = axes # unpack the axes


    col = collections.LineCollection([spiral], offsets=xyo,
                                    transOffset=ax1.transData)
    trans = fig.dpi_scale_trans + transforms.Affine2D().scale(1.0/72.0)
    col.set_transform(trans)  # the points to pixels transform
        # Note: the first argument to the collection initializer
        # must be a list of sequences of x,y tuples; we have only
        # one sequence, but we still have to put it in a list.
    ax1.add_collection(col, autolim=True)
        # autolim=True enables autoscaling.  For collections with
        # offsets like this, it is neither efficient nor accurate,
        # but it is good enough to generate a plot that you can use
        # as a starting point.  If you know beforehand the range of
        # x and y that you want to show, it is better to set them
        # explicitly, leave out the autolim kwarg (or set it to False),
        # and omit the 'ax1.autoscale_view()' call below.

    # Make a transform for the line segments such that their size is
    # given in points:
    col.set_color(colors)

    ax1.autoscale_view()  # See comment above, after ax1.add_collection.
    ax1.set_title('LineCollection using offsets')


    # The same data as above, but fill the curves.
    col = collections.PolyCollection([spiral], offsets=xyo,
                                    transOffset=ax2.transData, rasterized=True)
    trans = transforms.Affine2D().scale(fig.dpi/72.0)
    col.set_transform(trans)  # the points to pixels transform
    ax2.add_collection(col, autolim=True)
    col.set_color(colors)


    ax2.autoscale_view()
    ax2.set_title('PolyCollection using offsets')

    # 7-sided regular polygons

    col = collections.RegularPolyCollection(7,
                                            sizes = np.fabs(xx)*10.0, offsets=xyo,
                                            transOffset=ax3.transData)
    trans = transforms.Affine2D().scale(fig.dpi/72.0)
    col.set_transform(trans)  # the points to pixels transform
    ax3.add_collection(col, autolim=True)
    col.set_color(colors)
    ax3.autoscale_view()
    ax3.set_title('RegularPolyCollection using offsets')


    # Simulate a series of ocean current profiles, successively
    # offset by 0.1 m/s so that they form what is sometimes called
    # a "waterfall" plot or a "stagger" plot.

    nverts = 60
    ncurves = 20
    offs = (0.1, 0.0)

    yy = np.linspace(0, 2*np.pi, nverts)
    ym = np.amax(yy)
    xx = (0.2 + (ym-yy)/ym)**2 * np.cos(yy-0.4) * 0.5
    segs = []
    for i in range(ncurves):
        xxx = xx + 0.02*rs.randn(nverts)
        curve = list(zip(xxx, yy*100))
        segs.append(curve)

    col = collections.LineCollection(segs, offsets=offs)
    ax4.add_collection(col, autolim=True)
    col.set_color(colors)
    ax4.autoscale_view()
    ax4.set_title('Successive data offsets')
    ax4.set_xlabel('Zonal velocity component (m/s)')
    ax4.set_ylabel('Depth (m)')
    # Reverse the y-axis so depth increases downward
    ax4.set_ylim(ax4.get_ylim()[::-1])

    fig.savefig('test.svg')
    plt.close('all')

@letmaik
Copy link
Contributor Author

letmaik commented Jul 28, 2014

I think I found the mistake. I couldn't produce a small test script though.

The problem is the rewrite of code in tostring_rgba_minimized of commit 7b39e78. Apparently, PyBytes_FromStringAndSize returns an owned reference. At the end of the method, there is result[0] = Py::Object(data, false); where false means that data is unowned. Also, the next line Py_DECREF(data); doesn't make sense to me, but I don't understand all details yet.

So, what I think is happening is that the data object gets freed, as the reference count goes to zero. And then, by chance, everything works as usual, but equally it can also happen that something overwrites this piece of memory when it's allocated again, resulting in random corruption.

Using result[0] = Py::Object(data, true); and removing Py_DECREF(data); there were no errors anymore, but I'm not completely sure on the implications, whether this introduces a new leak or not.

I like to strongly emphasize that I think the previous version using the slightly ugly Python 2/3 switch is in many ways safer and more easily understandable (and thus changeable). By switching from PyCXX to the raw Python API you deal with PyObject * and reference counting. PyCXX says "The basic concept of CXX/Objects.hxx is to create a wrapper around each PyObject * so that the reference counting can be done automatically, thus eliminating the most frequent source of errors."

I propose that the previous version of tostring_rgba_minimized is used again, with Py::Bytes and Py::String. What do you think?

@mdboom
Copy link
Member

mdboom commented Jul 28, 2014

Thanks for getting to the bottom of this. The previous version leaked memory, however, which is the problem the change endeavoured to solve. We need to have a solution that neither leaks nor over-zealously frees memory. I'm fine with using the PyCXX API for this, but it didn't appear possible to get it to not leak in this particular case.

@mdboom
Copy link
Member

mdboom commented Jul 28, 2014

This at least seems correct to me:

PyBytes_FromStringAndSize creates a new object, with a reference count of 1.
Py::Object(data, false) creates a new reference to that object in a PyCXX wrapper (saying owned=false is correct here so the reference count gets incremented)
Py_DECREF() then removes the raw C reference, reducing the reference count to 1 before returning.

The change to passing owned=true and then removing the Py_DECREF, should be functionally equivalent, so it's a bit puzzling, but I'm fine with making that change once I've confirmed that it doesn't reintroduce the leak.

@letmaik
Copy link
Contributor Author

letmaik commented Jul 28, 2014

Just to clarify, what makes you think that the previous version (introduced in 493ded8) didn't fix the memory leak? I'm pretty sure that I ran valgrind and didn't see a leak anymore. (EDIT: not so sure anymore that I really checked it, as I started noticing another leak #3264)

@mdboom
Copy link
Member

mdboom commented Jul 28, 2014

I was still seeing a memory leak with 493ded8 in the test suite. For whatever reason, the string ended with a refcnt of 2 when exiting the function.

@letmaik
Copy link
Contributor Author

letmaik commented Jul 28, 2014

Ok, I think this is because the tuple index assignment operator increases the refcnt:

virtual void setItem (sequence_index_type offset, const Object&ob)
{
    // note PyTuple_SetItem is a thief...
    if(PyTuple_SetItem (ptr(), offset, new_reference_to(ob)) == -1)
    {
        throw Exception();
    }
}

Then it makes sense that the previous version had a refcnt of 2, one from PyBytes_AsString and one from the Tuple. So that would mean if we in 493ded8 add data.decrement_reference_count() just before return result; it would be correct?

EDIT: The above is probably not correct, see below.

@mdboom
Copy link
Member

mdboom commented Jul 28, 2014

That might work. If the refcnt is 1 on the way out, and valgrind is happy, and it fixes what you're seeing, I'm not opposed.

@letmaik
Copy link
Contributor Author

letmaik commented Jul 28, 2014

I just got an idea. When PyCXX puts data into the tuple with PyTuple_SetItem (ptr(), offset, new_reference_to(ob)) == -1) then new_reference_to extracts the PyObject * pointer, and once tostring_rgba_minimized is exited there is no reference to the original data object left anymore, thus the destructor of it gets called and the refcnt of data becomes 1. So what I wrote before is actually wrong. Calling data.decrement_reference_count() would then be fatal as it would go down to zero after function exit. From my point of view, all three versions (original one, rewritten, and rewritten with owned=true) are correct. It's really a mystery. And you are really sure that the original one has a memory leak? I will test it tomorrow, I could have sworn that I checked it.

@letmaik
Copy link
Contributor Author

letmaik commented Jul 29, 2014

I just tested all three versions and see absolutely no difference in memory behaviour, both using top and valgrind. But I found another thing which may be related to the strange crashes. There is a check if (xmin < xmax && ymin < ymax) and if this is false, then data will never be initialized. And maybe then the behaviour is different for result[0] = Py::Object(data, false); vs result[0] = data vs result[0] = Py::Object(data, true);. It seems like this check should never fail but at least the compiler warning should be fixed: "src/_backend_agg.cpp:2433:5: warning: ‘data’ may be used uninitialised in this function [-Wuninitialized]". As a test I will add an else-clause and throw an exception there to see if this case occurs.

@letmaik
Copy link
Contributor Author

letmaik commented Jul 29, 2014

Oh yeah, I'm hitting this case! I think this is the root of all evil here. What would be the correct thing to do in the else clause? If it's throwing an exception then I've probably found a bug which is higher up the hierarchy, right?

@letmaik
Copy link
Contributor Author

letmaik commented Jul 29, 2014

I just created a reproducible test case for hitting the else clause. I cannot post it yet as it's using my own things, but I will try to simplify it. I will now debug a bit to see how this condition might occur.

@letmaik
Copy link
Contributor Author

letmaik commented Jul 29, 2014

Got it!

fig, ax = plt.subplots()
circle1=plt.Circle((-10,10),rasterized=True)
ax.add_artist(circle1)
ax.set_xlim(0, 1)
ax.set_ylim(0, 1)
fig.savefig('test.svg')
plt.close(fig)

When putting an object outside of the plot limits while using svg and rasterized=True, then apparently it tries to create a zero size rasterized image. Note that I put an exception in the else-clause to let it fail. So, including it as a test case might be tricky, as without the else-clause it just produces random crashes depending on which PyCXX style (or raw Python API) is used to put the uninitialized pointer into the tuple.

@tacaswell
Copy link
Member

@neothemachine Thanks so much for tracking this down!

Random crashes are not super informative, but they are something that will show up on travis and get the attention of the devs.

@WeatherGod
Copy link
Member

Perhaps that if-statement should be an assert? Or maybe if the statement is
false, we return empty data and emit a warning?

On Tue, Jul 29, 2014 at 8:31 AM, Thomas A Caswell notifications@github.com
wrote:

@neothemachine https://github.com/neothemachine Thanks so much for
tracking this down!

Random crashes are not super informative, but they are something that will
show up on travis and get the attention of the devs.


Reply to this email directly or view it on GitHub
#3304 (comment)
.

@tacaswell
Copy link
Member

I don't think emitting a warning is the correct thing to do. The case where this happens is when a rasterized artist doesn't happen to be in the data limits, there is nothing wrong with this situation. I suspect that the right thing to do is to return a zero-sized array, but I don't know this section of the code well enough to know if that will cause problems else where.

@mdboom
Copy link
Member

mdboom commented Jul 29, 2014

I think we should add an else clause that sets data to a 0-length string. Then we always get something. Thanks for tracking that down -- it makes a lot of sense. We may as well, as you had suggested, revert to the CXX API here while we're at it.

@mdboom
Copy link
Member

mdboom commented Jul 29, 2014

I'll try to whip something up for this.

@letmaik
Copy link
Contributor Author

letmaik commented Jul 29, 2014

Although I said earlier that using PyCXX would be more understandable I think it's ok to leave it as is here, mostly because there's just one API function (PyBytes_FromStringAndSize) that's used. But I would still replace result[0] = Py::Object(data, false); with result[0] = Py::Object(data, true); and get rid of the following dec ref. After all, it's shorter and semantically more logical.

@letmaik
Copy link
Contributor Author

letmaik commented Jul 29, 2014

One more thing, the exception message points to the wrong function name RendererAgg::tostring_minimized instead of RendererAgg::tostring_rgba_minimized.

@mdboom mdboom closed this as completed in d797bc1 Jul 31, 2014
tacaswell added a commit that referenced this issue Jul 31, 2014
BUG : fixes memory corruption issues with zero-size rasterized artists

Fix #3304.
tacaswell added a commit that referenced this issue Jul 31, 2014
BUG : fixes memory corruption issues with zero-size rasterized artists

Fix #3304.
jbmohler pushed a commit to jbmohler/matplotlib that referenced this issue Aug 14, 2014
BUG : fixes memory corruption issues with zero-size rasterized artists

Fix matplotlib#3304.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. status: confirmed bug
Projects
None yet
Development

No branches or pull requests

5 participants