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

Segfault on plotting with PySide as backend.qt4 #5687

Closed
JCorson opened this issue Dec 16, 2015 · 3 comments
Closed

Segfault on plotting with PySide as backend.qt4 #5687

JCorson opened this issue Dec 16, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@JCorson
Copy link

JCorson commented Dec 16, 2015

The following code is failing with a segfault on Mac and Linux with backend : Qt4Agg and qt4.backend : PySide.

import matplotlib.pyplot as plt
plt.plot(range(10))

Setting qt4.backend to PyQt4 does not produce a segfault and this code works as expected.
Running %matplotlib in ipython also prevents this segfault.

I have reproduced this on both Enthought and Anaconda releases of matplotib 1.5.0 on Mac (OSX 10.11) and Linux (Ubuntu 14.04).

@tacaswell
Copy link
Member

I can confirm this. It is a regression from 1.4.3 in the sense that it didn't used to seg-fault, but I also can not get it to show a window at all.

@tacaswell
Copy link
Member

err, I can get it to work with 1.4.3 + pyside + ipython magic and 1.5.0 + pyside + ipython magic.

the matplotlib ipython magic installs their own version of input hook

This makes me think that the underlying problem is that pyqt is (forcibly) installing it's PyOS_InputHook where as pyside does not.

@tacaswell tacaswell added this to the Critical bugfix release (1.5.1) milestone Dec 16, 2015
@tacaswell
Copy link
Member

And I can not figure out how to get pyside to install it's own version of the input hook. The best I could get out of a quick google search is a link that says that functionality was never implemented (but it is from 2011 https://groups.google.com/forum/#!topic/pyside/EZxnlxEy94o )

I suspect that the other part of this is that the auto-redraw is forcing a redraw on an object that does not exist yet because it should have been created by the first draw to the screen (which never happens under pyside because the qt event loop is not spinning).

pankajp added a commit to pankajp/matplotlib that referenced this issue Dec 17, 2015
PySide QApplication constructor cannot handle unicode text
(segfaults), so we instead pass an empty list to the constructor.
pankajp pushed a commit to pankajp/matplotlib that referenced this issue Dec 18, 2015
PySide QApplication constructor cannot handle unicode text.
tacaswell added a commit that referenced this issue Dec 22, 2015
Fix #5687: Don't pass unicode to QApplication()
tacaswell added a commit that referenced this issue Jan 1, 2016
Fix #5687: Don't pass unicode to QApplication()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants