Skip to content

consistent signal 11 during application close #11

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

Open
anupamk opened this issue Sep 28, 2016 · 4 comments
Open

consistent signal 11 during application close #11

anupamk opened this issue Sep 28, 2016 · 4 comments

Comments

@anupamk
Copy link

anupamk commented Sep 28, 2016

hi,

i am seeing the following crash (consistently) during Py_Finalize. here is the back-trace

 gdb ./basic
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./basic...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/anupam/source-code/c++/matplotlib-cpp.git/examples/basic 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe94fd1d3 in QApplication::~QApplication() () from /usr/lib/libQtGui.so.4
(gdb) where
#0  0x00007fffe94fd1d3 in QApplication::~QApplication() () from /usr/lib/libQtGui.so.4
#1  0x00007fffea5927a9 in ?? () from /usr/lib/python2.7/site-packages/PyQt4/QtGui.so
#2  0x00007fffea5928ce in ?? () from /usr/lib/python2.7/site-packages/PyQt4/QtGui.so
#3  0x00007fffeb8f4c89 in ?? () from /usr/lib/python2.7/site-packages/sip.so
#4  0x00007fffeb8f62a9 in ?? () from /usr/lib/python2.7/site-packages/sip.so
#5  0x00007ffff7a92c53 in subtype_dealloc () from /usr/lib/libpython2.7.so.1.0
#6  0x00007ffff7a747df in insertdict_by_entry () from /usr/lib/libpython2.7.so.1.0
#7  0x00007ffff7a76330 in dict_set_item_by_hash_or_entry () from /usr/lib/libpython2.7.so.1.0
#8  0x00007ffff7a7b1ec in _PyModule_Clear () from /usr/lib/libpython2.7.so.1.0
#9  0x00007ffff7aeed5d in PyImport_Cleanup () from /usr/lib/libpython2.7.so.1.0
#10 0x00007ffff7afb0fd in Py_Finalize () from /usr/lib/libpython2.7.so.1.0
#11 0x0000000000402201 in matplotlibcpp::detail::_interpreter::~_interpreter() ()
#12 0x00007ffff6de5990 in __run_exit_handlers () from /usr/lib/libc.so.6
#13 0x00007ffff6de59ea in exit () from /usr/lib/libc.so.6
#14 0x00007ffff6dd0298 in __libc_start_main () from /usr/lib/libc.so.6
#15 0x000000000040143a in _start ()
(gdb) 

'basic' here is examples/basic.cpp

here are some environment details:

g++ --version
g++ (GCC) 6.2.1 20160830
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

uname -a
Linux fatcat 4.7.4-1-ARCH #1 SMP PREEMPT Thu Sep 15 15:24:29 CEST 2016 x86_64 GNU/Linux

of course, removing the Py_Finalize from the destructor 'solves' the problem, but that is cheating :)

@lava
Copy link
Owner

lava commented Sep 28, 2016

Hm, interesting :) To be sure, this is on an unmodified examples/basic.cpp?

@anupamk
Copy link
Author

anupamk commented Sep 28, 2016

Hm, interesting :) To be sure, this is on an unmodified examples/basic.cpp?

yes it is.

@sophana
Copy link

sophana commented Jun 19, 2017

I confirm same behavior on example minimal.cpp.
On centos7 64 bits

#0  0x00007fffe4940c84 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /lib64/libQtCore.so.4
#1  0x00007fffe2b52b2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQtGui.so.4
#2  0x00007fffe2b594d5 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQtGui.so.4
#3  0x00007fffe3bcf806 in sipQApplication::notify(QObject*, QEvent*) () at /usr/lib64/python2.7/site-packages/PyQt4/QtGui.so
#4  0x00007fffe4940b2d in QCoreApplication::notifyInternal(QObject*, QEvent*) () at /lib64/libQtCore.so.4
#5  0x00007fffe2b99994 in QWidgetPrivate::setWinId(unsigned long) () at /lib64/libQtGui.so.4
#6  0x00007fffe2be732e in QWidget::destroy(bool, bool) () at /lib64/libQtGui.so.4
#7  0x00007fffe2ba1cd0 in QWidget::~QWidget() () at /lib64/libQtGui.so.4
#8  0x00007fffe3a1aeb9 in sipQMainWindow::~sipQMainWindow() () at /usr/lib64/python2.7/site-packages/PyQt4/QtGui.so
#9  0x00007fffe3a1af2e in release_QMainWindow () at /usr/lib64/python2.7/site-packages/PyQt4/QtGui.so
#10 0x00007fffe513ff46 in forgetObject () at /usr/lib64/python2.7/site-packages/sip.so
#11 0x00007fffe5140f59 in sipWrapper_dealloc () at /usr/lib64/python2.7/site-packages/sip.so
#12 0x00007ffff7ab1173 in subtype_dealloc () at /lib64/libpython2.7.so.1.0
#13 0x00007ffff7b24adb in collect () at /lib64/libpython2.7.so.1.0
#14 0x00007ffff7b250d8 in PyGC_Collect () at /lib64/libpython2.7.so.1.0
#15 0x00007ffff7b12249 in Py_Finalize () at /lib64/libpython2.7.so.1.0
#16 0x0000000000402adf in matplotlibcpp::detail::_interpreter::~_interpreter() ()
#17 0x00007ffff6e6ce69 in __run_exit_handlers () at /lib64/libc.so.6
#18 0x00007ffff6e6ceb5 in  () at /lib64/libc.so.6
#19 0x00007ffff6e55b1c in __libc_start_main () at /lib64/libc.so.6
#20 0x00000000004017d9 in _start ()

@xizou
Copy link

xizou commented Jun 13, 2020

This is due to some unknown conflicts between Qt-based backend and matplotlib-cpp. An easy solution is to replace the backend with GTK3Agg by setting an environment variable:

export MPLBACKEND=GTK3Agg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants