prusa3d / PrusaSlicer

G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
https://www.prusa3d.com/prusaslicer/
GNU Affero General Public License v3.0
7.69k stars 1.93k forks source link

SegmentationFault if window made too narrow #8768

Open sdfgeoff opened 2 years ago

sdfgeoff commented 2 years ago

Description of the bug

If you resize the prusaslicer window to make it really narrow, then prusaslicer will crash with a segfault.

Project file & How to reproduce

Resize it! https://user-images.githubusercontent.com/13490050/186985383-31ff1569-b0cb-4d3d-a79c-09af764b1741.mp4

It's worth noting that the reproducability of this bug will depend on your window manager. GTK provides the ability to ask the window manager not to be resized below a certain amount (and prusa-slicer does this: in floating mode the window cannot be be shrunk enough to experience the bug), but this is a size request and some window managers (eg i3wm) allow shrinking below this requested value.

Checklist of files included above

Version of PrusaSlicer

PrusaSlicer-2.4.2+UNKNOWN based on Slic3r (with GUI support)

Operating system

ArchLinux with i3wm as window manager

Printer model

Snapmaker

DragonFinlay commented 2 years ago

I'm not entirely sure whether this is an actual issue with PrusaSlicer itself, or rather the fact that you can exceed shrinking limits using that window manager. Did you find any other software that shows the same behavior?

sdfgeoff commented 2 years ago

No other software that I can think of exhibits this behaviour. (Even other GTK programs are fine). Of course, at narrow sizes, many programs become awkward to use (eg buttons don't display all the text, lots of sideways scrollbars etc.) but they don't crash.

I use a 1920x1080 screen and if I try to have 3 things open next to each other (ie a window width of 640) then it crashes.

ngrigoriev commented 1 year ago

I have just observed this behavior when starting 2.5.0 manually on Linux with i3wm. And then after reading this issue I have started it on an empty desktop and it did not crash. Indeed, it crashes when getting only 1/3 of 4K screen.