Installing sweethome3d makes flatpak run segfault

I run Steam through Flatpak, and recently it started segfaulting immediately on launch, before any Steam code could run. I found that any flatpak run command had the same problem, even their recommending debugging command of flatpak run --command=sh --devel <application-id>. (flatpak update, list, etc. all still worked fine.)

I tested my NixOS generations to see where it went wrong, and it was with the installation of sweethome3d.application. When I strace a segfaulting flatpak command, I see it enumerating the filesystem with a ton of calls to readlink, newfstatat, openat, fstat, getdents64, etc. Just before the segfault, it’s looking in the nix store directory for sweethome3d. gdb shows that it crashes in a call to get_nix_closure, which makes me think this is happening even before any flatpak code runs - unless our flatpak is heavily patched?

Sadly, I can only reproduce this with sweethome3d in the current system closure; it doesn’t happen if it’s only present in a nix shell nixpkgs#sweethome3d.application - flatpak works OK there.

I see that the sweethome3d wrapper script sets up XDG_DATA_DIRS and LD_LIBRARY_PATH, then calls java with the appropriate jar; I don’t see anything specifically weird about sweethome3d, in other words.

Anyone have an idea about why this might happen? I’m on NixOS unstable.

I made an account here just to thank you.

I could not for the life of me figure out what was wrong with flatpak.

It was exactly this! I removed sweethome3d.application and everything now works perfectly. No idea what the issue is with that package at the moment. It seemed to work fine on nixpkgs-23.05 and broke when I upgraded to 24.05 recently.

1 Like