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
seg fault when screenshot of 3D plot #711
Comments
I am not able to reproduce this but there is another issue that I run into. The issue is that the window has a zero size. This is really a Qt issue as the mainloop is not running. Can you try this on an IPython session with |
Is this what you mean?
|
I tried this on my ubuntu machine with VTK-8.1.1 (from pip), Python 3.6.0, mayavi master, pyqt5 5.10.1 and I get an error but no segfault. The error I am seeing is due to a deeper issue that without the UI toolkit running, there is no window open so the screen size is still zero but this does not segfault. I'll work on resolving the other issue with the size being zero but unfortunately, I am unable to reproduce your segfault. |
I've encountered a similar if not the same segfault error on
|
I encountered a similar/same segfault error on a different machine but very similar
Switching to |
Can you confirm that this modification fixes things? from pyface.api import GUI
from mayavi import mlab
mlab.test_plot3d()
GUI().process_events()
mlab.screenshot() Or a shell one-liner: python -c "from pyface.api import GUI; from mayavi import mlab; mlab.test_plot3d(); GUI().process_events(); mlab.screenshot()" Basically I suspect the problem is that the event loop is not started, and so the system is in some not-fully-rendered state when the screenshot is attempted. We work around this in PySurfer by forcing rendering with this little @prabhuramachandran assuming this does fix things, it's possible there is some way to check if the OpenGL contex (or some other thing) is actually valid before attempting the screenshot, and if it's not, use this trick / hack to process events so it becomes valid. Seems a bit iffy / too hacky, though, so maybe not worth it. |
@larsoner -- yes I figured the same thing (see my earlier comment) and want to fix it cleanly in mlab at some point. I am hoping to get to it at some point. Also, as of v 4.6.1, mlab has a |
This file: minimal_example_fail.py:
fails with the following stack:
To reproduce:
@larsoner @agramfort
The text was updated successfully, but these errors were encountered: