Bug 270210 - cad/openscad segfault, possibly wrong version
Summary: cad/openscad segfault, possibly wrong version
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Michael Reifenberger
URL:
Keywords: crash, needs-qa
Depends on:
Blocks:
 
Reported: 2023-03-14 15:17 UTC by phryk-ports
Modified: 2024-03-15 08:50 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (mr)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description phryk-ports 2023-03-14 15:17:44 UTC
I'm on 13.1-RELEASE and OpenSCAD started always segfaulting when trying
to start after updating the package.

Additionally, `openscad -v` (which doesn't segfault, I assume it's a
GUI-specific problem) gives me `OpenSCAD version 2023.03.02`, even tho
the package version is `2021.01.01.20221206`, so I have the suspicion
that the wrong upstream commit is getting built.

I get the same issue with the `openscad-devel` pkg, but there I'd
at least assume a 2023.x version to be the right thing.

I think this might be a Qt problem. Initially I was able to defer
the segfault to after the initial dialog that lets you choose recently
opened files by unsetting `QT_QPA_PLATFORMTHEME` in my env, which usually
contains `qt5ct`.

But after installing openscad from a custom poudriere pkg repo (that
package had the same segfault issue) and going back to only the official
repo, including running `pkg upgrade -f`, I can't reproduce that behavior
anymore.
Comment 1 phryk-ports 2023-03-23 13:17:26 UTC
A friend told me how to get a backtrace from gdb, so I'm
adding it for completeness sake. Seems to confirm that
this is a GUI issue.


❯ gdb openscad
GNU gdb (GDB) 12.1 [GDB v12.1 for FreeBSD]
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd13.1".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from openscad...
(No debugging symbols found in openscad)
(gdb) run
Starting program: /usr/local/bin/openscad 
warning: Could not load shared library symbols for [vdso].
Do you need "set solib-search-path" or "set sysroot"?
[New LWP 105856 of process 64981]
[New LWP 105857 of process 64981]
[New LWP 105858 of process 64981]
[New LWP 105859 of process 64981]
[New LWP 105860 of process 64981]
[New LWP 105861 of process 64981]
[New LWP 105862 of process 64981]
[New LWP 105863 of process 64981]
[New LWP 105864 of process 64981]
[New LWP 105865 of process 64981]
[Detaching after fork from child process 71130]
[New LWP 105866 of process 64981]
[New LWP 105867 of process 64981]

Thread 1 received signal SIGSEGV, Segmentation fault.
Address not mapped to object.
0x0000000000e6ceed in ?? ()
(gdb) bt full
#0  0x0000000000e6ceed in ?? ()
No symbol table info available.
#1  0x00000008193c92b9 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#2  0x00000008193c860c in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#3  0x000000081933992d in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#4  0x0000000819376dd5 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#5  0x000000081937da6f in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#6  0x000000081918f488 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#7  0x00000008191a6107 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#8  0x0000000819319610 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#9  0x00000008193191fc in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#10 0x0000000819311774 in radeon_drm_winsys_create () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#11 0x0000000818b2f7e2 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#12 0x000000081924fda1 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#13 0x0000000818b36443 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#14 0x0000000818b330e4 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#15 0x0000000818252ae7 in ?? () from /usr/local/lib/libGLX_mesa.so.0
No symbol table info available.
#16 0x0000000818243d2d in ?? () from /usr/local/lib/libGLX_mesa.so.0
No symbol table info available.
#17 0x0000000818240bba in ?? () from /usr/local/lib/libGLX_mesa.so.0
No symbol table info available.
#18 0x000000081819ca38 in ?? () from /usr/local/lib/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so
No symbol table info available.
#19 0x00000008052a4bcb in QXcbWindow::create() () from /usr/local/lib/qt5/libQt5XcbQpa.so.5
No symbol table info available.
#20 0x0000000805297c4f in QXcbIntegration::createPlatformWindow(QWindow*) const () from /usr/local/lib/qt5/libQt5XcbQpa.so.5
No symbol table info available.
#21 0x00000008028b6acb in QWindowPrivate::create(bool, unsigned long long) () from /usr/local/lib/qt5/libQt5Gui.so.5
No symbol table info available.
#22 0x00000008022c2476 in QWidgetPrivate::create() () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#23 0x00000008022c103d in QWidget::create(unsigned long long, bool, bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#24 0x00000008022d4a69 in QWidgetPrivate::setVisible(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#25 0x00000008024954e0 in QDialog::setVisible(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#26 0x0000000802494c58 in QDialog::exec() () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#27 0x00000000005373ed in ?? ()
--Type <RET> for more, q to quit, c to continue without paging--
No symbol table info available.
#28 0x000000000053bcb8 in ?? ()
No symbol table info available.
#29 0x0000000000526e90 in ?? ()
No symbol table info available.
#30 0x0000000000526d90 in ?? ()
No symbol table info available.
#31 0x0000000000000000 in ?? ()
No symbol table info available.
Comment 2 Torfinn Ingolfsen 2024-02-21 20:04:34 UTC
Also happens when installing from a package:

root@kg-core2:~ # pkg info openscad\*
openscad-2021.01.01.20221206_4

tingo@kg-core2:~/work/999_temp $ openscad -v
OpenSCAD version 2023.10.04

gdb backtrace

tingo@kg-core2:~/work/999_temp $ gdb openscad
GNU gdb (GDB) 13.2 [GDB v13.2 for FreeBSD]
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd13.2".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from openscad...
(No debugging symbols found in openscad)
(gdb) run
Starting program: /usr/local/bin/openscad 
warning: Could not load shared library symbols for [vdso].
Do you need "set solib-search-path" or "set sysroot"?
[New LWP 267663 of process 18739]
[New LWP 267664 of process 18739]
[New LWP 267665 of process 18739]
[New LWP 267666 of process 18739]
[New LWP 267667 of process 18739]
[New LWP 267668 of process 18739]
[New LWP 267669 of process 18739]
[New LWP 267670 of process 18739]
[New LWP 267671 of process 18739]
[New LWP 267672 of process 18739]
[New LWP 267673 of process 18739]
[New LWP 267674 of process 18739]
[New LWP 267675 of process 18739]
[New LWP 267676 of process 18739]
[New LWP 267677 of process 18739]
[New LWP 267678 of process 18739]

Thread 1 received signal SIGSEGV, Segmentation fault.
Invalid permissions for mapped object.
0x0000000000e8d454 in ?? ()
(gdb) bt full
#0  0x0000000000e8d454 in ?? ()
No symbol table info available.
#1  0x0000000000e8c461 in ?? ()
No symbol table info available.
#2  0x00000008191238f9 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#3  0x0000000819122772 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#4  0x00000008190f96c2 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#5  0x0000000819105515 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#6  0x000000081910c16f in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#7  0x0000000818c084c4 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#8  0x0000000818c08c5d in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#9  0x0000000818c09099 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#10 0x0000000818b414d3 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#11 0x0000000818b3fc1f in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#12 0x0000000818b3f87e in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#13 0x0000000818b400a6 in ?? () from /usr/local/lib/dri/r600_dri.so
--Type <RET> for more, q to quit, c to continue without paging--c
No symbol table info available.
#14 0x0000000818998271 in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#15 0x0000000818997adb in ?? () from /usr/local/lib/dri/r600_dri.so
No symbol table info available.
#16 0x0000000802df5840 in ?? () from /usr/local/lib/qt5/libQt5Gui.so.5
No symbol table info available.
#17 0x0000000802df58d2 in QOpenGLExtensions::hasOpenGLExtension(QOpenGLExtensions::OpenGLExtension) const () from /usr/local/lib/qt5/libQt5Gui.so.5
No symbol table info available.
#18 0x00000008024f9464 in ?? () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#19 0x00000008024fa9f8 in QOpenGLWidget::resizeEvent(QResizeEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#20 0x00000008024d6c2d in QWidget::event(QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#21 0x00000008024fb0d6 in QOpenGLWidget::event(QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#22 0x000000080249d3d9 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#23 0x000000080249e7b5 in QApplication::notify(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#24 0x0000000000df89f7 in ?? ()
No symbol table info available.
#25 0x000000080342e9bd in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/local/lib/qt5/libQt5Core.so.5
No symbol table info available.
#26 0x00000008024cf80e in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#27 0x00000008024d5737 in QWidgetPrivate::show_helper() () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#28 0x00000008024d6673 in QWidgetPrivate::setVisible(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#29 0x00000008024d5a51 in QWidgetPrivate::showChildren(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#30 0x00000008024d575c in QWidgetPrivate::show_helper() () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#31 0x00000008024d6673 in QWidgetPrivate::setVisible(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#32 0x00000008024d5a51 in QWidgetPrivate::showChildren(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#33 0x00000008024d575c in QWidgetPrivate::show_helper() () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#34 0x00000008024d6673 in QWidgetPrivate::setVisible(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#35 0x00000008024d5a51 in QWidgetPrivate::showChildren(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#36 0x00000008024d575c in QWidgetPrivate::show_helper() () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#37 0x00000008024d6673 in QWidgetPrivate::setVisible(bool) () from /usr/local/lib/qt5/libQt5Widgets.so.5
No symbol table info available.
#38 0x0000000000dbf121 in ?? ()
No symbol table info available.
#39 0x0000000000535818 in ?? ()
No symbol table info available.
#40 0x000000000053a00f in ?? ()
No symbol table info available.
#41 0x0000000000525ee0 in ?? ()
No symbol table info available.
#42 0x0000000000525de0 in ?? ()
No symbol table info available.
#43 0x0000000000000000 in ?? ()
No symbol table info available.
(gdb) quit
A debugging session is active.

	Inferior 1 [process 18739] will be killed.

Quit anyway? (y or n) y

this on

tingo@kg-core2:~/work/999_temp $ freebsd-version -ku
13.2-RELEASE-p8
13.2-RELEASE-p9
Comment 3 Torfinn Ingolfsen 2024-02-22 18:16:23 UTC
Tried on a different machine, this one runs

tingo@kg-bsbox:/zs/tingo/work/bitraf/2024/20240222_openscad_test $ freebsd-version -ku
13.2-RELEASE-p8
13.2-RELEASE-p9

and has this graphics card

tingo@kg-bsbox:/zs/tingo/work/bitraf/2024/20240222_openscad_test $ pciconf -lv | grep -B 4 VGA
vgapci0@pci0:0:2:0:	class=0x030000 rev=0x02 hdr=0x00 vendor=0x8086 device=0x5916 subvendor=0x1849 subdevice=0x5916
    vendor     = 'Intel Corporation'
    device     = 'HD Graphics 620'
    class      = display
    subclass   = VGA

tingo@kg-bsbox:/zs/tingo/work/bitraf/2024/20240222_openscad_test $ pkg info openscad\*
openscad-2021.01.01.20221206_4

tingo@kg-bsbox:/zs/tingo/work/bitraf/2024/20240222_openscad_test $ openscad -v
OpenSCAD version 2023.11.10

and OpenSCAD doesn't crash - it works.
Comment 4 Torfinn Ingolfsen 2024-02-22 21:07:12 UTC
Another machine, also with Intel graphics

tingo@kg-elitebook$ pciconf -lv | grep -B 4 VGA
vgapci0@pci0:0:2:0:	class=0x030000 rev=0x09 hdr=0x00 vendor=0x8086 device=0x0166 subvendor=0x103c subdevice=0x18df
    vendor     = 'Intel Corporation'
    device     = '3rd Gen Core processor Graphics Controller'
    class      = display
    subclass   = VGA

and OpenSCAD works

tingo@kg-elitebook$ openscad -v
OpenSCAD version 2023.06.27
tingo@kg-elitebook$ openscad
libGL error: failed to authenticate magic 1
libGL error: failed to load driver: crocus

tingo@kg-elitebook$ freebsd-version -ku
13.2-RELEASE-p10
13.2-RELEASE-p10
Comment 5 Torfinn Ingolfsen 2024-02-22 21:51:28 UTC
(In reply to Torfinn Ingolfsen from comment #2)

For completeness, the graphics card in this machine is

root@kg-core2:~ # pciconf -lv | grep -B4 VGA
vgapci0@pci0:7:0:0:	class=0x030000 rev=0x00 hdr=0x00 vendor=0x1002 device=0x677b subvendor=0x1462 subdevice=0x8099
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Caicos PRO [Radeon HD 7450]'
    class      = display
    subclass   = VGA
Comment 6 Torfinn Ingolfsen 2024-02-24 14:16:57 UTC
another data point: OpenSCAD works fine on this laptop running FreeBSD 14.0-release

tingo@kg-starone:~/work/2024/0224_openscad_testing $ freebsd-version -ku
14.0-RELEASE-p5
14.0-RELEASE-p5

tingo@kg-starone:~/work/2024/0224_openscad_testing $ openscad -v
OpenSCAD version 2024.02.19
tingo@kg-starone:~/work/2024/0224_openscad_testing $ openscad
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!

tingo@kg-starone:~/work/2024/0224_openscad_testing $ pkg info opensc\*
openscad-2021.01.01.20221206_4

it has AMD graphics
tingo@kg-starone:~/work/2024/0224_openscad_testing $ pciconf -lv | grep -B 4 VGA
vgapci0@pci0:3:0:0:	class=0x030000 rev=0xc1 hdr=0x00 vendor=0x1002 device=0x1638 subvendor=0x1e50 subdevice=0x8015
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Cezanne [Radeon Vega Series / Radeon Vega Mobile Series]'
    class      = display
    subclass   = VGA
Comment 7 Torfinn Ingolfsen 2024-02-24 17:49:52 UTC
data point - another machine where OpenSCAD works

$ freebsd-version -ku
13.2-RELEASE-p10
13.2-RELEASE-p10

$ pciconf -lv | grep -B 4 VGA
vgapci0@pci0:3:0:0:	class=0x030000 rev=0xc5 hdr=0x00 vendor=0x1002 device=0x15dd subvendor=0x17aa subdevice=0x39fe
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series]'
    class      = display
    subclass   = VGA
--
none1@pci0:3:0:7:	class=0x000000 rev=0x00 hdr=0x00 vendor=0x1022 device=0x15e6 subvendor=0x1022 subdevice=0x15e4
    vendor     = 'Advanced Micro Devices, Inc. [AMD]'
    device     = 'Raven/Raven2/Renoir Non-Sensor Fusion Hub KMDF driver'
    class      = old
    subclass   = non-VGA display device

$ openscad -v
OpenSCAD version 2024.02.17
$ openscad
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
Comment 8 Torfinn Ingolfsen 2024-03-10 15:00:38 UTC
Switching from radeonkms to a different driver (amdgpu) seems to fix the problem in my case. The core1 machine still has that R5 230 card, amdgpu doesn't really support it, Xorg comes up in vesa 720x400 - but OpenSCAD works without crashing.

I put a Radeon R7 240 card in the core2 machine, adn switched to amdgpu in /etc/rc.conf. OpenSCAD doesn't crash.
The card shows up as

root@kg-core2:~ # pciconf -lv | grep -B 4 VGA
vgapci0@pci0:7:0:0:	class=0x030000 rev=0xc7 hdr=0x00 vendor=0x1002 device=0x6617 subvendor=0x1da2 subdevice=0xe263
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'Oland LE [Radeon R7 240]'
    class      = display
    subclass   = VGA
Comment 9 phryk-ports 2024-03-15 08:50:37 UTC
As additional feedback: The segfault resolved itself for me after one of the updates to libdrm, amdgpu and/or related graphics packages.