Skip to content

wx segfault #11582

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

Closed
anntzer opened this issue Jul 5, 2018 · 4 comments · Fixed by #11590
Closed

wx segfault #11582

anntzer opened this issue Jul 5, 2018 · 4 comments · Fixed by #11590
Labels
GUI: wx Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Jul 5, 2018

The following script (opening two figures, and triggering a figure quit via the keyboard shortcut on a timer 1 second after the second figure is drawn) segfaults when used with the wx{,agg} backend. It works as expected (closing the second figure after 1s) e.g. other backends.

from pylab import *

plt.figure()

fig = plt.figure()
timer = fig.canvas.new_timer(1000)
timer.add_callback(fig.canvas.key_press_event, "q")
fig.canvas.mpl_connect("draw_event", lambda event: timer.start())
plt.show()

Interestingly, commenting out the first plt.figure() (which seemingly plays no role...) removes the segfault.

Noted while working on the tests for #11581.
Matplotlib master on Py3.6/Arch Linux.

@anntzer anntzer added the GUI: wx label Jul 5, 2018
@tacaswell tacaswell added this to the v3.0 milestone Jul 5, 2018
@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Jul 5, 2018
@tacaswell
Copy link
Member

Linked with #11578 ?

@anntzer
Copy link
Contributor Author

anntzer commented Jul 5, 2018

I don't think so (note the restricted conditions in which this occurs)?
It may well not even be a regression.

@tacaswell
Copy link
Member

I can reproduce with with 2.2.2 both from pypi and from arch packages (and a range of 4.0.x wxpython versions) so this is not a recent regression on our part.

My guess at what is going on is that as part of closing the second figure we are cleaning up some part of Wx global state that the first figure is still using. If you don't include the other open figure the state isn't shared and everything exits happily.

I suspect that this is a nastier version of the 'wx segfaults at exit' bug we have had in the past.

@tacaswell tacaswell added Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. and removed Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labels Jul 6, 2018
@anntzer
Copy link
Contributor Author

anntzer commented Jul 6, 2018

Remove the RC tag or not? (I vote for it)

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

Successfully merging a pull request may close this issue.

2 participants