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

Listing of python modules with help() segfaults when Spyder is installed #4014

Closed
ocarino opened this issue Jan 20, 2017 · 13 comments
Closed

Comments

@ocarino
Copy link

ocarino commented Jan 20, 2017

When I install "spyder", the listing of all python modules that you usually get by typing "modules" in the help() mode, segfaults:
##############################################################
$ python
Python 2.7.12 (default, Oct 25 2016, 17:04:12)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

help()

Welcome to Python 2.7! This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/2.7/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".

help> modules

Please wait a moment while I gather a list of all available modules...

Segmentation fault
##############################################################

Running gdb on the generated core gives me this stacktrace:

##############################################################
#0 0x00007fb93d8060b1 in ?? () from /sw/rhel6-x64/x11/qt-5.5.1-gcc48/lib/libQt5Gui.so.5
#1 0x00007fb93d80867d in ?? () from /sw/rhel6-x64/x11/qt-5.5.1-gcc48/lib/libQt5Gui.so.5
#2 0x00007fb93d80e5b8 in QFontDatabase::addApplicationFont(QString const&) () from /sw/rhel6-x64/x11/qt-5.5.1-gcc48/lib/libQt5Gui.so.5
#3 0x00007fb945502af7 in meth_QFontDatabase_addApplicationFont () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/python2.7/site-packages/PyQt5/QtGui.so
#4 0x00007fb972283a24 in PyEval_EvalFrameEx () at Python/ceval.c:4350
#5 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#6 0x00007fb9721fd0ac in function_call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#7 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#8 0x00007fb97227f2d5 in PyEval_EvalFrameEx () at Python/ceval.c:4664
#9 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#10 0x00007fb9721fd0ac in function_call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#11 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#12 0x00007fb9721d97ed in instancemethod_call () at Objects/classobject.c:2602
#13 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#14 0x00007fb97223761d in slot_tp_init () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#15 0x00007fb97223624f in type_call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#16 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#17 0x00007fb972283445 in PyEval_EvalFrameEx () at Python/ceval.c:4567
#18 0x00007fb972284494 in PyEval_EvalFrameEx () at Python/ceval.c:4435
#19 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#20 0x00007fb9722843b4 in PyEval_EvalFrameEx () at Python/ceval.c:4445
#21 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#22 0x00007fb9722843b4 in PyEval_EvalFrameEx () at Python/ceval.c:4445
#23 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#24 0x00007fb9722843b4 in PyEval_EvalFrameEx () at Python/ceval.c:4445
#25 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#26 0x00007fb972288539 in PyEval_EvalCode () at Python/ceval.c:669
#27 0x00007fb97229c52d in PyImport_ExecCodeModuleEx () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#28 0x00007fb97229c88e in load_source_module () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#29 0x00007fb97229d679 in import_submodule () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#30 0x00007fb97229e3c4 in PyImport_ImportModuleLevel () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#31 0x00007fb97227b4f8 in builtin___import__ () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#32 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#33 0x00007fb97227d0a7 in PyEval_CallObjectWithKeywords () at Python/ceval.c:4219
#34 0x00007fb972281fcc in PyEval_EvalFrameEx () at Python/ceval.c:2622
#35 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#36 0x00007fb972288539 in PyEval_EvalCode () at Python/ceval.c:669
#37 0x00007fb97229c52d in PyImport_ExecCodeModuleEx () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#38 0x00007fb97229c88e in load_source_module () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#39 0x00007fb97229d679 in import_submodule () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#40 0x00007fb97229e30d in PyImport_ImportModuleLevel () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#41 0x00007fb97227b4f8 in builtin___import__ () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#42 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#43 0x00007fb97227d0a7 in PyEval_CallObjectWithKeywords () at Python/ceval.c:4219
#44 0x00007fb972281fcc in PyEval_EvalFrameEx () at Python/ceval.c:2622
#45 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#46 0x00007fb972288539 in PyEval_EvalCode () at Python/ceval.c:669
#47 0x00007fb97229c52d in PyImport_ExecCodeModuleEx () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#48 0x00007fb97229c88e in load_source_module () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#49 0x00007fb97229dc00 in load_package () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#50 0x00007fb97229d679 in import_submodule () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#51 0x00007fb97229e30d in PyImport_ImportModuleLevel () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#52 0x00007fb97227b4f8 in builtin___import__ () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#53 0x00007fb972283a24 in PyEval_EvalFrameEx () at Python/ceval.c:4350
#54 0x00007fb9721f10c3 in gen_iternext () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#55 0x00007fb97228215a in PyEval_EvalFrameEx () at Python/ceval.c:2806
#56 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#57 0x00007fb9722843b4 in PyEval_EvalFrameEx () at Python/ceval.c:4445
#58 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#59 0x00007fb9722843b4 in PyEval_EvalFrameEx () at Python/ceval.c:4445
#60 0x00007fb972284494 in PyEval_EvalFrameEx () at Python/ceval.c:4435
#61 0x00007fb972284494 in PyEval_EvalFrameEx () at Python/ceval.c:4435
#62 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#63 0x00007fb9721fd175 in function_call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#64 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#65 0x00007fb9721d97ed in instancemethod_call () at Objects/classobject.c:2602
#66 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#67 0x00007fb9721d8736 in instance_call () at Objects/classobject.c:2153
#68 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#69 0x00007fb97227f2d5 in PyEval_EvalFrameEx () at Python/ceval.c:4664
#70 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#71 0x00007fb9721fd0ac in function_call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#72 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#73 0x00007fb9721d97ed in instancemethod_call () at Objects/classobject.c:2602
#74 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#75 0x00007fb972237405 in slot_tp_call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#76 0x00007fb9721ca7d3 in PyObject_Call () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#77 0x00007fb972283445 in PyEval_EvalFrameEx () at Python/ceval.c:4567
#78 0x00007fb972288410 in PyEval_EvalCodeEx () at Python/ceval.c:3582
#79 0x00007fb972288539 in PyEval_EvalCode () at Python/ceval.c:669
#80 0x00007fb9722ae041 in PyRun_InteractiveOneFlags () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#81 0x00007fb9722ae25e in PyRun_InteractiveLoopFlags () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#82 0x00007fb9722ae8ae in PyRun_AnyFileExFlags () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#83 0x00007fb9722c46a5 in Py_Main () from /sw/rhel6-x64/python/python-2.7.12-gcc49/lib/libpython2.7.so.1.0
#84 0x00007fb971558d1d in __libc_start_main () from /lib64/libc.so.6
#85 0x0000000000400741 in _start ()

##############################################################

I would guess that it is related to this issue:

https://bugs.debian.org/cgi-bin/bugreport.cgi?att=0;bug=844601;msg=57

So libqt5gui.so segfaults when there is no qt event loop. Which is expected behaviour (say the qt developers). Why is all this qt stuff called when the modules are listed?

I have this behaviour with spyder 3.0.2 and 3.1.0 (these were the ones I tried) and I have this using qt5.7.0 or qt5.5.1.

@ccordoba12
Copy link
Member

I think this probably happens because help() introspects PyQt5, and PyQt5 in turn loads all Qt5 libraries.

Short advice: you shouldn't use help(). To see what modules you have installed in your system, you can run in an IPython console %reshashx to remove a cache with your installed modules, then import <Tab>.

I doubt there's something we can do about this, sorry.

@ocarino
Copy link
Author

ocarino commented Jan 21, 2017 via email

@ccordoba12
Copy link
Member

@dalthviz, I think this only happens on Linux, so please test there first.

@jitseniesen
Copy link
Member

This Debian bug report may be relevant: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844601

It basically says that the command import spyder.plugins.editor leads to a segfault. I just reproduced this on Debian Linux.

@ccordoba12
Copy link
Member

Thanks @jitseniesen! I'm sure that will make @dalthviz easier :-)

@ccordoba12 ccordoba12 modified the milestones: v3.1.2, v3.1.3 Jan 22, 2017
@dalthviz
Copy link
Member

Thanks @jitseniesen for the link 👍 . @ccordoba12 of what I have tested and readed, the problem is in the qtawesome project, since there we are using the QFontDatabase without a QApplication instance. Probably this is the cause of the segmentation fault

@jitseniesen
Copy link
Member

Thanks @jitseniesen for the link

I just found out that @ocarino who reported the bug already provided the same link at the end of their message.

@ccordoba12 ccordoba12 changed the title Listing of python modules ( help() modules ) segfaults Listing of python modules with help() segfaults when Spyder is installed Jan 24, 2017
@ghisvail
Copy link
Contributor

Could you confirm whether Bug-Debian #844601 is related to this issue, please?

@ocarino
Copy link
Author

ocarino commented Jan 25, 2017 via email

@jitseniesen
Copy link
Member

Hmm, the Debian bug is definitely related, but I just checked and the proposed fix for this issue does not fix the Debian bug. I opened a new issue for this: #4049.

@ccordoba12
Copy link
Member

@ocarino, the solution to this problem is to install qtawesome (one of Spyder dependencies) version 0.4.4 or higher (once I release it, in a couple of days).

Thanks for letting us know about this (very!) nasty problem :-)

@ccordoba12 ccordoba12 removed this from the v3.1.3 milestone Jan 28, 2017
@ocarino
Copy link
Author

ocarino commented Feb 14, 2017 via email

@ccordoba12
Copy link
Member

It seems you have an old version of setuptools. Why don't you use pip?

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

No branches or pull requests

6 participants