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

OpenScad 2019.04.07 hangs on "New" or "Open File" when running in 32bit userspace on 64bit Linux kernel #2933

Open
KlausKnopper opened this issue Apr 13, 2019 · 15 comments

Comments

@KlausKnopper
Copy link

@KlausKnopper KlausKnopper commented Apr 13, 2019

Recent issues of openscad (also nightly builds) hang indefinitely in the editor/preview view on 32bit Debian, intel i915 graphics. Stable version 2015.03 built with exactly the same libraries works on the same machine.

strace of version 2019.04.07 keeps looping in
3848 ioctl(11, DRM_IOCTL_I915_GEM_MADVISE, 0xfff0178c) = 0
3848 ioctl(11, DRM_IOCTL_I915_GEM_BUSY, 0xfff01724) = 0
...repeating...

The error might be similar to the previously reported QT5 crash on start issue on Windows machines, though the workaround of changing QT_OPENGL=(anything...) does not work here.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@t-paul
Copy link
Member

@t-paul t-paul commented Apr 14, 2019

Please add the details asked for in that FAQ entry: How_do_I_report_bugs?

That sounds like a tricky one, so we need to collect all the information we can. I don't see how to easily reproduce, or is it reproducable in some VM?

Loading

@KlausKnopper
Copy link
Author

@KlausKnopper KlausKnopper commented Apr 14, 2019

Loading

@t-paul
Copy link
Member

@t-paul t-paul commented Apr 14, 2019

I can't reproduce on a fresh installed debian-unstable, so an ISO showing the issue would be useful. I think that installed Gnome on Wayland, not sure if that is important.

Linux debian-unstable-32bit 4.19.0-4-686-pae #1 SMP Debian 4.19.28-2 (2019-03-15) i686 GNU/Linux

Library Info... (interesting memory amount ;-)

OpenSCAD Version: 2019.01-RC2
System information: Linux 4.19.0-4-686-pae #1 SMP Debian 4.19.28-2 (2019-03-15) i686 Debian GNU/Linux buster/sid 2 CPUs 16777216.00 TB RAM
User Agent: OpenSCAD/2019.01-RC2 (Linux i686; Debian GNU/Linux buster/sid)
Compiler: GCC "8.3.0" 32bit
MinGW build: No
Debug build: No
Boost version: 1_67
Eigen version: 3.3.7
CGAL version, kernels: 4.13, Cartesian, Extended_cartesian, Epeck
OpenCSG version: OpenCSG 1.4.2
Qt version: 5.11.3
QScintilla version: 2.10.4
InputDrivers: 
GLib version: 2.58.3
lodepng version: 20180910
libzip version: 1.5.1
fontconfig version: 2.13.1
freetype version: 2.9.1
harfbuzz version: 2.3.1
lib3mf version: 1.8.1

GLEW version: 2.1.0
OpenGL Version: 3.1 Mesa 18.3.4
GL Renderer: llvmpipe (LLVM 7.0, 128 bits)
GL Vendor: VMware, Inc.
RGBA(8880), depth(0), stencil(0)
GL_ARB_framebuffer_object: yes
GL_EXT_framebuffer_object: yes
GL_EXT_packed_depth_stencil: yes

Qt graphics widget: QOpenGLWidget
QSurfaceFormat: RGBA(8880), depth(0), stencil(0)

Loading

@donbright
Copy link
Member

@donbright donbright commented May 2, 2019

does it work with software rendering? (Is that even still a thing?)

IIRC you can test by running this:

 $ LIBGL_ALWAYS_SOFTWARE=1 openscad

Loading

@KlausKnopper
Copy link
Author

@KlausKnopper KlausKnopper commented May 2, 2019

LIBGL_ALWAYS_SOFTWARE=1 openscad-nightly

hangs the same way.

Loading

@t-paul
Copy link
Member

@t-paul t-paul commented May 2, 2019

Yes, I'm seeing that in my test VM too. I'm a bit stuck as it's not reproducible on a "normal" 32bit Debian VM. The only item remaining on my idea list is to get an AppImage going for 32bit and see what that is doing when run the Knoppix image.

Loading

@KlausKnopper
Copy link
Author

@KlausKnopper KlausKnopper commented Jul 23, 2019

Loading

@KlausKnopper KlausKnopper changed the title OpenScad 2019.04.07 hangs on "New" or "Open File" on Intel Graphics / Linux OpenScad 2019.04.07 hangs on "New" or "Open File" when running in 32bit userspace on 64bit Linux kernel Jul 30, 2019
@KlausKnopper
Copy link
Author

@KlausKnopper KlausKnopper commented Jul 30, 2019

Changed issue topic to reflect the recent findings.

Loading

@t-paul
Copy link
Member

@t-paul t-paul commented Oct 24, 2019

I still can't reproduce in any development environment. I've now installed a Debian 10/32-bit VM and updated the kernel to an amd64 variant.
Interestingly that totally broke booting into gdm so that seems to be affected by the issue too. After installing lxdm graphical login was possible. Compiling and running current master of OpenSCAD on that system works fine.

Loading

@KlausKnopper
Copy link
Author

@KlausKnopper KlausKnopper commented Oct 24, 2019

Loading

@t-paul
Copy link
Member

@t-paul t-paul commented Oct 24, 2019

Yep, I did:

dpkg --add-architecture amd64
apt-get update
apt-get --no-install-recommends install linux-image-amd64:amd64
uname -a
Linux debian10-32bit 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux

But maybe later booted into the wrong kernel again. I can now reproduce the issue and it seems it hangs inside swrast_dri.so. OpenSCAD does run when disabling the axis markers but the display is still not correct.
Unfortunately I don't think there's much that can be done on OpenSCAD side to fix the issue. Maybe there's a way to disable DRI but I could not find a setting for that yet.

Loading

@KlausKnopper
Copy link
Author

@KlausKnopper KlausKnopper commented Oct 25, 2019

Loading

@t-paul
Copy link
Member

@t-paul t-paul commented Oct 25, 2019

True, it's triggered by a change in OpenSCAD. Other applications are probably not a good reference as OpenSCAD still uses ancient OpenGL, partially even fixed pipeline which is probably (hopefully?) not used much anymore.
I tried to check with RenderDoc but this requires OpenGL 3.2+ context. So it might be OpenSCAD doing something wrong with the API but without tools that's going to be hard to find. Maybe someone reading this has pointers to other ways of validating OpenGL API calls?

Loading

@t-paul
Copy link
Member

@t-paul t-paul commented Oct 26, 2019

Hmm, git bisect produced

git bisect start
# bad: [6ec97fda154b0578688ab98723685c66af7a7a71] More MacOS builds.
git bisect bad 6ec97fda154b0578688ab98723685c66af7a7a71
# good: [be4fd23dc6b9f4de44c5a4c5cee94894dc139393] Cleaned out old 32-bit Mac builds
git bisect good be4fd23dc6b9f4de44c5a4c5cee94894dc139393
# good: [bf6153592bebd0299722b4c535ef827bdaeec5f1] make the default value of getVec3 explicit by overloading getVec3
git bisect good bf6153592bebd0299722b4c535ef827bdaeec5f1
# bad: [1434fb9ec370294aa18205c3bbdb8d21db89750e] Check only actual parameter sets for isEmpty().
git bisect bad 1434fb9ec370294aa18205c3bbdb8d21db89750e
# good: [c31b627be142f3304b8fa6870a53a3b10ce2c17a] Merge pull request #2638 from MichaelPFrey/para
git bisect good c31b627be142f3304b8fa6870a53a3b10ce2c17a
# bad: [9147d940f3464ae59b113689f8fde1c4df003cfc] Merge pull request #2708 from openscad/3d-printing-updates
git bisect bad 9147d940f3464ae59b113689f8fde1c4df003cfc
# good: [ed93d3fec5d11bedc06f5200a3a740a72c7b6c56] Merge pull request #2672 from openscad/3d-printing-init-dialog
git bisect good ed93d3fec5d11bedc06f5200a3a740a72c7b6c56
# good: [155f90406cb0a86840208567531596c4da03e810] move the "try catch" for readability and to make it more modular
git bisect good 155f90406cb0a86840208567531596c4da03e810
# good: [88417b32b873912ded901630c4198c0828911916] clean up
git bisect good 88417b32b873912ded901630c4198c0828911916
# bad: [69bf5a55475102be43c2ddc698198e85821332b3] Merge pull request #2697 from MichaelPFrey/ParaRangeCheck
git bisect bad 69bf5a55475102be43c2ddc698198e85821332b3
# good: [8b6e905f68d7ce19db1ef3e649dc85c25b315cd9] Merge pull request #2706 from openscad/amf-remove-experimental-flag
git bisect good 8b6e905f68d7ce19db1ef3e649dc85c25b315cd9
# good: [0d1bc651f0d4e407905f477d99965b17e2e2b144] clean up
git bisect good 0d1bc651f0d4e407905f477d99965b17e2e2b144
# bad: [d26ea931d7bb0583496e1245ef9c7fa3de871939] Merge pull request #2710 from openscad/input-driver-remove-experimental-flag
git bisect bad d26ea931d7bb0583496e1245ef9c7fa3de871939
# bad: [2b505f1dd943d0051db2130d5029bdb7ebf6d830] Change input-driver experimental flag to cover only the DBus driver (fixes #2704).
git bisect bad 2b505f1dd943d0051db2130d5029bdb7ebf6d830
# first bad commit: [2b505f1dd943d0051db2130d5029bdb7ebf6d830] Change input-driver experimental flag to cover only the DBus driver (fixes #2704).

Which seems pretty strange as the offending commit does not touch any of the display logic. Assuming it could have something to do with Qt initalizing stuff, I disabled the change in the bad commit and it worked afterwards. But after applying the similar change to master it did not help. And now even recompiling some of the good commits are broken. So I'm a bit at a loss here.

Loading

@t-paul
Copy link
Member

@t-paul t-paul commented Oct 27, 2019

So the issue is triggered when processing the custom QEvents created from the input driver code via QCoreApplication::postEvent(). It's not clear how that would deadlock in the OpenGL driver and I don't see a way to fix that yet.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants