kliment / Printrun

Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software
GNU General Public License v3.0
2.36k stars 995 forks source link

Gcode view: 2D mode crashing on fast layer change #1315

Open swiftgeek opened 1 year ago

swiftgeek commented 1 year ago
Traceback (most recent call last):
  File "/home/swiftgeek/tmp/Printrun-upstream/printrun/gviz.py", line 405, in paint
    self.repaint_everything()
  File "/home/swiftgeek/tmp/Printrun-upstream/printrun/gviz.py", line 331, in repaint_everything
    dc.SelectObject(self.blitmap)
wx._core.wxAssertionError: C++ assertion "cr && cairo_status(cr) == 0" failed at /usr/src/debug/wxwidgets/wxWidgets-3.2.1/src/gtk/bitmap.cpp(1399) in CairoCreate(): 
zsh: terminated  python ./pronterface.py

First it stops rendering while displaying traceback above after attempt to change layer, and after a bit more layer change attempts crashes entire pronterface

Easiest to trigger with mouse wheel

OS: Archlinux Python version: 3.10.9 wx-config --version: 3.2.1 wxpython: 4.2.0

rockstorm101 commented 1 year ago

Hi @swiftgeek I'm unable to replicate this, does it occur with a specific .gcode file? Could you provide it? Or please be more specific on how to reproduce it

swiftgeek commented 1 year ago

No specific file - I didn't find any file it doesn't occur with, simply changing layer fast with mouse wheel triggers it reliably here. Changing one layer at a time and letting it render before changing again doesn't break anything.

Similar thing happens for changing zoom level, which additionally produces following snippet as well as one above

Traceback (most recent call last):
  File "/home/swiftgeek/tmp/Printrun-upstream/printrun/gviz.py", line 405, in paint
    self.repaint_everything()
  File "/home/swiftgeek/tmp/Printrun-upstream/printrun/gviz.py", line 329, in repaint_everything
    self.blitmap = wx.Bitmap(int(width) + 1, int(height) + 1, -1)
wx._core.wxAssertionError: C++ assertion ""width > 0 && height > 0"" failed at /usr/src/debug/wxwidgets/wxWidgets-3.2.2/src/gtk/bitmap.cpp(541) in Create(): in
valid bitmap size
rockstorm101 commented 1 year ago

I'm unable to replicate this then. On the "Gcode view" tool, scrolling as fast as my mouse wheel allows and changing zoom level using Ctrl+Mouse Wheel does not produce the above either.

Out of curiosity:

-- Debian Sid Python 3.11.1 wxPython 4.2.0

swiftgeek commented 1 year ago