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

FreeCAD v1.0.0 fails to start - segmentation fault #366299

Open
Joshua265 opened this issue Dec 18, 2024 · 5 comments
Open

FreeCAD v1.0.0 fails to start - segmentation fault #366299

Joshua265 opened this issue Dec 18, 2024 · 5 comments
Labels
0.kind: bug Something is broken

Comments

@Joshua265
Copy link

Describe the bug

I'm unable to start FreeCad v1.0.0.
When trying to start it, I get the following error:

$ freecad --verbose
FreeCAD 1.0.0, Libs: 1.0.0RUnknown
(C) 2001-2024 FreeCAD contributors
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.

Program received signal SIGSEGV, Segmentation fault.
#0  /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libc.so.6(+0x40620) [0x7f0560247620]
#1  [0x7ffc91e29a10]

Steps To Reproduce

Steps to reproduce the behavior:

  1. Add the freecad or freecad-wayland package from nixpkgs 24.11 or unstable
  2. Start it

I coudn't reproduce this on my laptop (Intel CPU with integrated Graphics). There it works well.
The Issue only happened on my Desktop with NVIDIA GPU, but i have no idea if this is related to the GPU or another problem entirely.
Both machines run on a similar nix-config.

Expected behavior

I expect FreeCAD to start without issues.

Additional context

Running v0.21 from nixpkgs 24.05 works (except some NVIDIA Flickering™)

Also I found this old issue, which looks related #42790

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.66, NixOS, 24.11 (Vicuna), 24.11.20241216.3945713`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.10`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/etc/nix/path/nixpkgs`

I'm using flakes and use a NVIDIA GPU.

Notify maintainers

@gebner
@AndersonTorres
@srounce


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@Joshua265 Joshua265 added the 0.kind: bug Something is broken label Dec 18, 2024
@liberodark
Copy link
Contributor

On my side in 24.11 that work :

freecad --verbose
FreeCAD 1.0.0, Libs: 1.0.0RUnknown
(C) 2001-2024 FreeCAD contributors
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.

@srounce
Copy link
Contributor

srounce commented Dec 20, 2024

I'm also using an Nvidia GPU (2080) and am having no issues with FreeCAD. What card are you running on the desktop?

Are you using multiple versions of Nixpkgs in your flake inputs by any chance?

@Joshua265
Copy link
Author

Thank you guys for the quick response, I really hoped someone else encountered the same issue...

I'm running a RTX 3090 with stable drivers (565.77).

I am using unstable and 24.11 in my flakes, but there seems to be an issue with cura, therefore I am using that with 24.05.

I did some debugging of the launch, and had some interesting findings:

Using gdb with

$ gdb --args freecad
(gdb) run

actually runs the program without issues.

Running valgrind --trace-children=yes freecad actually encountered the issue:

Logs
==1085025== Memcheck, a memory error detector
==1085025== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1085025== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==1085025== Command: freecad
==1085025== 
==1085025== Memcheck, a memory error detector
==1085025== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1085025== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==1085025== Command: /nix/store/ffq5vq0vxc5py7id8nkh72vxq6bplid7-freecad-1.0.0/bin/.FreeCAD-wrapped_
==1085025== 
==1085025== Memcheck, a memory error detector
==1085025== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1085025== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==1085025== Command: /nix/store/ffq5vq0vxc5py7id8nkh72vxq6bplid7-freecad-1.0.0/bin/.FreeCAD-wrapped
==1085025== 
==1085025== Memcheck, a memory error detector
==1085025== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1085025== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==1085025== Command: /nix/store/ffq5vq0vxc5py7id8nkh72vxq6bplid7-freecad-1.0.0/bin/..FreeCAD-wrapped-wrapped
==1085025== 
==1085025== realloc() with size 0
==1085025==    at 0x484E492: realloc (in /nix/store/jlcmn1sc1k1ryzk2lzxs3af4m1ghmdy6-valgrind-3.23.0/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1085025==    by 0x11012CFE: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libnvidia-glcore.so.565.77)
==1085025==    by 0x10473936: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libGLX_nvidia.so.565.77)
==1085025==    by 0x104CEC61: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libGLX_nvidia.so.565.77)
==1085025==    by 0x10473012: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libGLX_nvidia.so.565.77)
==1085025==    by 0x4036FFF: ??? (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x400438C: call_init (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x40044CB: _dl_init (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x4001585: _dl_catch_exception (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x400B0CD: dl_open_worker (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x40014F0: _dl_catch_exception (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x400B45B: _dl_open (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==  Address 0x100c1030 is 0 bytes after a block of size 0 alloc'd
==1085025==    at 0x48467D9: malloc (in /nix/store/jlcmn1sc1k1ryzk2lzxs3af4m1ghmdy6-valgrind-3.23.0/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1085025==    by 0x11012CEE: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libnvidia-glcore.so.565.77)
==1085025==    by 0x10473936: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libGLX_nvidia.so.565.77)
==1085025==    by 0x104CEC61: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libGLX_nvidia.so.565.77)
==1085025==    by 0x10473012: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libGLX_nvidia.so.565.77)
==1085025==    by 0x4036FFF: ??? (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x400438C: call_init (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x40044CB: _dl_init (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x4001585: _dl_catch_exception (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x400B0CD: dl_open_worker (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x40014F0: _dl_catch_exception (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x400B45B: _dl_open (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025== 
==1085025== posix_memalign() invalid size value: 0
==1085025==    at 0x484EF00: posix_memalign (in /nix/store/jlcmn1sc1k1ryzk2lzxs3af4m1ghmdy6-valgrind-3.23.0/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1085025==    by 0x11012D35: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libnvidia-glcore.so.565.77)
==1085025==    by 0x10473936: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libGLX_nvidia.so.565.77)
==1085025==    by 0x104CEC61: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libGLX_nvidia.so.565.77)
==1085025==    by 0x10473012: ??? (in /nix/store/jddpjvnl554s1bids0xacq7ribm69k90-nvidia-x11-565.77-6.6.66/lib/libGLX_nvidia.so.565.77)
==1085025==    by 0x4036FFF: ??? (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x400438C: call_init (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x40044CB: _dl_init (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x4001585: _dl_catch_exception (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x400B0CD: dl_open_worker (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x40014F0: _dl_catch_exception (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025==    by 0x400B45B: _dl_open (in /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2)
==1085025== 
FreeCAD 1.0.0, Libs: 1.0.0RUnknown
(C) 2001-2024 FreeCAD contributors
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.

libEGL warning: egl: failed to create dri2 screen
warning: queue 0x16a1ef40 destroyed while proxies still attached:
  wl_display#1 still attached
==1085025== Use of uninitialised value of size 8
==1085025==    at 0x34059DCB: ??? (in /memfd:sljit (deleted))
==1085025== 
==1085025== Jump to the invalid address stated on the next line
==1085025==    at 0x0: ???
==1085025==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==1085025== 
Program received signal SIGSEGV, Segmentation fault.
#0  /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libc.so.6(+0x40620) [0xad45620]

I have no idea about the Memory Error, but libEGL sounded like an OpenGL issue to me. Therefore I checked my OpenGL information and running freecad with nixGL.

$ glxinfo -B | grep -i '\(direct rendering\|opengl\|profile\)'
direct rendering: Yes
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 565.77
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 4.6.0 NVIDIA 565.77
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 565.77
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
$ nix run --override-input nixpkgs nixpkgs/nixos-21.11 --impure github:nix-community/nixGL -- freecad
warning: not writing modified lock file of flake 'github:nix-community/nixGL':
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/441dc5d512153039f19ef198e662e4f3dbb9fd65?narHash=sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g%3D' (2022-08-15)
  → 'github:NixOS/nixpkgs/eabc38219184cc3e04a974fe31857d8e0eac098d?narHash=sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE%3D' (2022-08-02)
FreeCAD 1.0.0, Libs: 1.0.0RUnknown
(C) 2001-2024 FreeCAD contributors
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.

Program received signal SIGSEGV, Segmentation fault.
#0  /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/libc.so.6(+0x40620) [0x7fb77fc47620]
#1  [0x7fffaa4c0820]

Sadly that did not resolve the issue yet. I'm still curious, why it works when running gdb.

@DasenB
Copy link
Contributor

DasenB commented Dec 22, 2024

I dot have the exact same problem on my Laptop (Thinkapd X1 Extreme Gen5 with GeForce RTX 3050 Ti)

@srounce
Copy link
Contributor

srounce commented Dec 25, 2024

I am using unstable and 24.11 in my flakes

In the past I've run into issues with other Python applications where different versions of glibc were targeted by the host application and the C/C++ components of various python modules being loaded, this has tended to be when mixing and matching versions of Nixpkgs. Can you confirm everything is definitely using the same glibc version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

4 participants