mockingbirdnest / Principia

𝑛-Body and Extended Body Gravitation for Kerbal Space Program
MIT License
771 stars 70 forks source link

Principia DLL won't load on Arch Linux #4131

Closed astro-angelfish closed 3 weeks ago

astro-angelfish commented 3 weeks ago

Originally posted on https://github.com/mockingbirdnest/Principia/issues/4130#issuecomment-2458924977. However it is not related to that issue.

Logs from KSP didn't provide any useful information, it just complains unable to find dll. I tried strace and got these: https://pastebin.com/FYiXGyBY

It seems like that the loader did not cooperate well with Linux ld or mono platform. I just did sudo pacman -Syu today before launching ksp, might changes the behavior of ld on finding libraries.

Some extra informations:

$ uname -a                         
Linux AL-1S 6.11.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 22 Oct 2024 18:31:38 +0000 x86_64 GNU/Linux
$ pacman -Q glibc                  
glibc 2.40+r16+gaa533d58ff-2
$ pacman -Q mono                       
mono 6.12.0.206-1
Steam Beta Branch:  Stable Client
Steam Version:  1730853027
Steam Client Build Date:  Wed, Nov 6 5:33 AM UTC -08:00
Steam Web Build Date:  Wed, Nov 6 8:21 AM UTC -08:00
Steam API Version:  SteamClient021

Other mods: https://pastebin.com/f9zgq9zt (Unlikely to be related to this issue).

pleroy commented 3 weeks ago

Arch requires a special setup, as documented in the FAQs.

astro-angelfish commented 3 weeks ago

Arch requires a special setup, as documented in the FAQs.

I forgot to mention that I've already did that:

$ ldd principia.so   
        linux-vdso.so.1 (0x00007259693ff000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007259693aa000)
        libc++.so.1 => /usr/lib/libc++.so.1 (0x0000725967cfd000)
        libc++abi.so.1 => /usr/lib/libc++abi.so.1 (0x0000725967cbd000)
        libunwind.so.1 => /usr/lib/libunwind.so.1 (0x0000725967ca3000)
        libm.so.6 => /usr/lib/libm.so.6 (0x0000725967bb4000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x0000725967b86000)
        libc.so.6 => /usr/lib/libc.so.6 (0x0000725967995000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x0000725969401000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x0000725967962000)
$ ls /usr/lib/libunwind.so.1
/usr/lib/libunwind.so.1
pleroy commented 3 weeks ago

It would be good to have an unfiltered strace (not grepping principia.so) as more likely than not the problem is with some dependent library, not with principia.so.

It would also be good to check the versions of the other libraries, notably libc++, libc++api, and libunwind.

Note however that Ubuntu is the only distro that we support, so the best that we can do is provide educated guesses. For what it's worth, #4004 had a complete strace which you might want to compare with yours.

astro-angelfish commented 3 weeks ago
$ pacman -Q libc++ libc++abi libunwind
libc++ 18.1.8-4
libc++abi 18.1.8-4
libunwind 1.8.1-3

These were my libraries.

Well things goes well by just use strace ./KSP.x86_64 2> ~/current-game/ksp-trace.txt and Principia seems to be working. But it just fails when ran by Steam. Either prime-run, strace or directly run itself did not reproduce the problem.

I'm going to provide logs with strace -p pid anyway instead of running it by strace or console. Seems to be problem with steam.

ksp-trace.zip

It is weird that strace complains openat(AT_FDCWD, "/usr/lib/libc++.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) at line 2071804 while I could find it with ls /usr/lib/libc++.so.1.

pleroy commented 3 weeks ago

We have had one report previously of Principia not running when launched from Steam, and running fine when launched manually. We never got to the bottom of this, in part because we are not going to debug Steam (which, as you know, only supports Ubuntu). I have to believe that somehow Steam is setting up a running environment that is not compatible with Arch.

BrokenButler commented 2 weeks ago

Just had the same issue on LinuxMint 22 (Based on Ubuntu 24.04), and figured out a workaround/solution launching the game executable from withing the folder in which it is located works indeed. But if you want Steam to count the hours and such you need to create a link to the KSP executable and then add the link to the launch options in steam ("absolute path to the link" %command%). CKAN doesn't seem to be able to launch it through steam this way (you may have to do some extra config for this), but launching from steam works and it counts the playtime as well as giving access to the overlay. I haven't had any issues with other mods not working with this setup yet either.

FeCocco commented 6 days ago

Just had the same issue on LinuxMint 22 (Based on Ubuntu 24.04), and figured out a workaround/solution launching the game executable from withing the folder in which it is located works indeed. But if you want Steam to count the hours and such you need to create a link to the KSP executable and then add the link to the launch options in steam ("absolute path to the link" %command%). CKAN doesn't seem to be able to launch it through steam this way (you may have to do some extra config for this), but launching from steam works and it counts the playtime as well as giving access to the overlay. I haven't had any issues with other mods not working with this setup yet either.

This worked on Fedora too, thank you!