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

spyder2 crashes upon launch when pygtk2 is installed #5212

Open
nonamedotc opened this issue Sep 12, 2017 · 12 comments
Open

spyder2 crashes upon launch when pygtk2 is installed #5212

nonamedotc opened this issue Sep 12, 2017 · 12 comments

Comments

@nonamedotc
Copy link

Description of your problem

I maintain the spyder package for Fedora. This issue is about launching spyder (python 2 version) on Fedora 26.

If I have pygtk2 installed in my system, spyder (python2 version) crashes upon launch. If I remove pygtk2 package, I am able to launch spyder (python 2 version) without any issues.

[test@f26-xfce Desktop]$ rpm -qa pygtk2
pygtk2-2.24.0-16.fc26.x86_64

[test@f26-xfce Desktop]$ spyder
Segmentation fault (core dumped)

What steps will reproduce the problem?

  1. Install pygtk2 from the repositories.
  2. Launch spyder from terminal or from menu.

What is the expected output? What do you see instead?

Expected: Spyder (py 2 version) should launch

Observed: Segmentation fault.

Versions and main components

  • Spyder Version: 3.2.2, 3.2.3
    This issue was also observed in the older versions of spyder but are now not relevant.

  • Python Version: 2.7.13

  • Qt Version: 5.7.1

  • PyQt Version: 5.8.1

  • Operating system: Fedora 26 x86_64

Dependencies

IPython >=4.0;<6.0:  5.3.0 (OK)
cython >=0.21     :  None (NOK)
jedi >=0.9.0      :  0.10.2 (OK)
nbconvert >=4.0   :  4.2.0 (OK)
numpy >=1.7       :  1.12.1 (OK)
pandas >=0.13.1   :  0.20.1 (OK)
psutil >=0.3      :  5.0.1 (OK)
pycodestyle >=2.3 :  2.3.1 (OK)
pyflakes >=0.5.0  :  1.5.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
pylint >=0.25     :  1.7.2 (OK)
qtconsole >=4.2.0 :  4.2.1 (OK)
rope >=0.9.4      :  0.10.3 (OK)
sphinx >=0.6.6    :  1.6.3 (OK)
sympy >=0.7.3     :  None (NOK)

Python3 version of spyder is not affected.

@ccordoba12
Copy link
Member

Thanks for reporting. We'll take a look at this bug in 3.2.4

@nonamedotc
Copy link
Author

Thanks! Please let me know if you need more information (trace, etc.) and/or if you need someone to do some testing.

@rlaverde
Copy link
Member

I tried to reproduce it in debian, but installing python-gtk2 doesn't make spyder crash, I think It is a fedora issue.

Please let me know if you need more information (trace, etc.)

Maybe the core dumped, I could give a try tracing the bug (although segmentations faults are hard to trace)

Qt Version: 5.7.1
PyQt Version: 5.8.1

Maybe different versions of qt and pyqt could cause the error. If It cause a wrong detection of the qt version; in some places we check the specific pyqt version to use some classes/functions that are only available in some newer versions of the qt. (although that will be a really unlikely)

@ccordoba12 ccordoba12 removed this from the v3.2.4 milestone Sep 23, 2017
@nonamedotc
Copy link
Author

spyder_launch_strace.txt

I could only generate strace for the crash (attached). If you can tell me how I can go about generating coredump, I can try.

As for mismatch between Qt and PyQt, I tried the same spyder version in Fedora 27 where both are at 5.9.x. I get the same segmentation fault. So, I don't think this is the issue but, of course, I could be wrong.

@rlaverde
Copy link
Member

Thanks for the strace, Now I have an idea of how could be the error:

It looks like an incompatibility between pygtk2 and gtk3 (the error is raised when trying to read a translation file of gtk3)

Looking at pygtk2, It looks like It haven't been maintained in a long time, (and not gtk3 support was developed)
http://www.pygtk.org/news.html
https://git.gnome.org//browse/pygtk/

I think this bug doesn't affect only spyder, other applications could be affected

Maybe not setting application style to gtk fix the bug https://github.com/spyder-ide/spyder/blob/master/spyder/app/mainwindow.py#L2537 (I don't know if that is still needed to fix #2036)

@ccordoba12
Copy link
Member

I think it's still needed, yes. But we could try to import pygtk2 before applying that, and (if it's present) avoid the change in theme.

@nonamedotc
Copy link
Author

If you make the change, I can test it from git and report back.

@ccordoba12
Copy link
Member

@rlaverde, please open a PR for this so that @nonamedotc can test it on his end.

@rlaverde
Copy link
Member

rlaverde commented Sep 26, 2017

@nonamedotc could you test if #5335 fix the error?

@nonamedotc
Copy link
Author

nonamedotc commented Sep 26, 2017

spyder_launch_strace_2.txt

Still segfaults when pygtk2 is installed (strace attached).

I made the changes to the mainwindow.py in spyder 3.2.3 released tarball to test this. Would you prefer that I test this master instead?

@rlaverde
Copy link
Member

Looking at the strace it still raises the same error, maybe It's something about the console style, although I'm not sure, I'll try to reproduce it in a virtualbox and debug it more.

@nonamedotc
Copy link
Author

Hello there! I was looking at this again and I get the same crash with even with 3.2.6. Have any of you had a chance to take a look at this? I can provide the strace again if needed.

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

Successfully merging a pull request may close this issue.

3 participants