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

Portal 2 segfaults when loading any level #62

Closed
alice-mkh opened this issue Feb 7, 2018 · 32 comments
Closed

Portal 2 segfaults when loading any level #62

alice-mkh opened this issue Feb 7, 2018 · 32 comments

Comments

@alice-mkh
Copy link

qhull warning: missing space after flag . (2e); reserved for menu. Skipped.
qhull error: the joggle for 'QJn', 1e-12, is below roundoff for distance computations, 1
qhull warning: unknown flag . (2e)
qhull warning: missing space after flag . (2e); reserved for menu. Skipped.
qhull error: the joggle for 'QJn', 2,4e-12, is below roundoff for distance computations, 1
qhull warning: unknown flag . (2e)

-----snip-------

qhull error: the joggle for 'QJn', 0,00034, is below roundoff for distance computations, 1
qhull warning: unknown flag . (2e)
qhull warning: missing space after flag . (2e); reserved for menu. Skipped.
qhull error: the joggle for 'QJn', 0,0004, is below roundoff for distance computations, 1
qhull warning: unknown flag . (2e)
qhull warning: missing space after flag . (2e); reserved for menu. Skipped.
qhull error: the joggle for 'QJn', 0,00048, is below roundoff for distance computations,
Thread 1 "portal2_linux" received signal SIGSEGV, Segmentation fault.
0xf46c9243 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/vphysics.so
Argument list to give program being debugged when it is started is "-game portal2 -steam".
(gdb) bt
0xf46c9243 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/vphysics.so
Argument list to give program being debugged when it is started is "-game portal2 -steam".
(gdb) bt
#0  0xf46c9243 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/vphysics.so
#1  0xf46c93f8 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/vphysics.so
#2  0xe9ad7fa2 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/portal2/bin/server.so
#3  0xe9ada057 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/portal2/bin/server.so
#4  0xe9a322f5 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/portal2/bin/server.so
#5  0xe9f9bbc0 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/portal2/bin/server.so
#6  0xe9f9c475 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/portal2/bin/server.so
#7  0xea029b88 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/portal2/bin/server.so
#8  0xe9e08cba in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/portal2/bin/server.so
#9  0xe9e09853 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/portal2/bin/server.so
#10 0xe9e09f91 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/portal2/bin/server.so
#11 0xe9d92d43 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/portal2/bin/server.so
#12 0xf4e09920 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/engine.so
#13 0xf4d20570 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/engine.so
#14 0xf4d3630d in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/engine.so
#15 0xf4d36a0b in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/engine.so
#16 0xf4d36a49 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/engine.so
#17 0xf4e1c34f in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/engine.so
#18 0xf4e1897d in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/engine.so
#19 0xf4e18a9d in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/engine.so
#20 0xf4e85f90 in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/engine.so
#21 0xf4e1a19f in ?? () from /home/exalm/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/Portal 2/bin/engine.so
#22 0xf6a2fc90 in ?? () from bin/launcher.so
#23 0xf6a2fc90 in ?? () from bin/launcher.so
#24 0xf6a1341a in LauncherMain () from bin/launcher.so
#25 0x08048564 in main ()

This doesn't happen on host system.

@cxrvh
Copy link

cxrvh commented May 2, 2018

It's seems to be a problem with the runtime.

Portal 2 works with the freedesktop-sdk unstable/1.8 runtime. Steam has to be rebuild, since the lib32 folder changed from /app/lib/32bit/ to /app/lib/i386-linux-gnu. The new runtime also fixed #63 & #64 and I was able to complete the single-player mode (but some Linux specific bugs occured, e.g. ValveSoftware/portal2#255 / ValveSoftware/portal2#289).

@nanonyme
Copy link
Collaborator

Please re-test, runtime is now updated

@Pixelnarium
Copy link

It still crashes.

@cxrvh
Copy link

cxrvh commented Aug 14, 2018

@Pixelnarium Which graphics driver are you using and does it crash when loading a level or before that?

I'm asking because on my system Portal 2 now crashes before loading the menu and I think it's a different (Mesa) problem. (I actually cannot start any Steam games anymore)

System: Fedora 28 with a Radeon HD7870 and Mesa.

Thread 9 "si_shader:1" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 1146]
0xf7e2decc in memcpy () from /app/lib/i386-linux-gnu/libc.so.6
Argument list to give program being debugged when it is started is "-game portal2 -steam".
(gdb) 
(gdb) bt
#0  0xf7e2decc in memcpy () from /app/lib/i386-linux-gnu/libc.so.6
#1  0xf498c43a in ?? () from /usr/lib/i386-linux-gnu/dri/radeonsi_dri.so
#2  0xf498c53c in ?? () from /usr/lib/i386-linux-gnu/dri/radeonsi_dri.so
#3  0xf498d723 in ?? () from /usr/lib/i386-linux-gnu/dri/radeonsi_dri.so
#4  0xf4efbe32 in ?? () from /usr/lib/i386-linux-gnu/dri/radeonsi_dri.so
#5  0xf7b91ea6 in ?? () from /app/lib/i386-linux-gnu/libpthread.so.0
#6  0xf7e8f2a6 in clone () from /app/lib/i386-linux-gnu/libc.so.6

EDITED: Don't reference unrelated issues (use code block instead of quote).

@nanonyme
Copy link
Collaborator

#130 is one possible source of crashes. I'm considering disabling Mesa shader cache for now since it seems to be causing a lot of issues

@Pixelnarium
Copy link

@cxrvh Intel Mesa driver and it crashes when loading a level. The menu loads but has strange sound ( issue #64 )

@cxrvh
Copy link

cxrvh commented Aug 14, 2018

Disabling shader cache fixes the menu crash. Thanks.

But the rest is the same: Only #63 is fixed, sound is still stuttering and it crashes when loading a level.
I tried using an old commit of the unstable runtime (it was working in May), but the Steam-flatpak seems not to be compatible with older versions.

@nanonyme
Copy link
Collaborator

nanonyme commented Aug 14, 2018

Shader cache is for now disabled, read #130 for details. Do you get the exact original stack trace now?

@Pixelnarium
Copy link

For me it is the same like in the first post... all those qhull errors and the crash in vphysics.so

@nanonyme
Copy link
Collaborator

Ok. Which graphics card do you have and open or closed source drivers?

@Pixelnarium
Copy link

Like I said above, I have an Intel GPU with the Mesa driver. When I want to start a new game it loads the level a little bit and then crashes.
dmesg just says portal2_linux[4700]: segfault at 0 ip 00000000f38d8243 sp 00000000ffa7bf30 error 4 in vphysics.so[f3891000+1b8000]

Personally I don't think that this error is related to the GPU. I have a strange feeling that the flatpak sandbox interferes with some floating point operations.

@nanonyme
Copy link
Collaborator

I have this game as well and open drivers, I can try to repro

@cxrvh
Copy link

cxrvh commented Aug 18, 2018

The bugs are fixed when using Fedora 27 instead of 28.

That's why I was able to play through the game. I booted the live image and Portal 2 started with the current 18.08 runtime. It also worked after updating Flatpak and its dependencies (to 0.99.3), but I didn't reboot the system (in case it's necessary for a correct update).

On Arch Linux I downgraded the kernel to 4.13.4 (as used in the Fedora 27 live image) but it did not fix the problems.

@nanonyme
Copy link
Collaborator

I tried to repro on my Fedora 28 Silverblue (atomic) and could not. kernel was 4.17.12-200.fc28.x86_64 with open drivers on radeonsi.

@cxrvh
Copy link

cxrvh commented Aug 20, 2018

On my system it works on Fedora 28 Silverblue, too. Both Fedora 28 versions seem to have the same packages installed (diff from rpm -qa, Silverblue has a few additional, my Fedora 28 has lots additional packages, everything else is the same).

Sound problems & crashes:

  • Fedora 28
  • Arch Linux (Plasma 5 instead of GNOME)

Runs:

  • Fedora 27
  • Fedora 28 Silverblue

@Pixelnarium
Copy link

I think you could compare the sysctl values between these systems. Flatpak itself mentiones kernel.unprivileged_userns_clone

@cxrvh
Copy link

cxrvh commented Aug 24, 2018

kernel.unprivileged_userns_clone is not available on Fedora but it doesn't change anything on Arch Linux either.

The sysctl values were mostly the same and I don't see any striking name in the sysctl-diff.txt.

I reinstalled Fedora 28 (both variants) and now the game crashes in Silverblue, too. I tried Portal 2 directly after installing Silverblue, with the newest updates applied and then after downgrading to the version I tested before (version 20180818), but it made no difference.

@nanonyme
Copy link
Collaborator

Did you also fully update both? Last I installed Silverblue, the tree was from April

@cxrvh
Copy link

cxrvh commented Aug 25, 2018

Yes, both variants are fully updated. But I can now reproduce the bugs:
The game crashes with a non-English locale.

It's running on Fedora and Arch Linux when Steam is started with --env=LANG=C. It also crashes on Fedora 27 with a non-English locale, I must've set the locale when I was playing it on Fedora 27.

@nanonyme
Copy link
Collaborator

Interresting. This is now the second set of locale-specific issues in addition to the connectivity issues in #112
You may wish to follow up #130, there's studying on how to interpret crashes from app at the end

@nanonyme
Copy link
Collaborator

Note I always change system language from Finnish to English USA the first thing I do because I dislike the localizations so that might explain why I didn't hit that

@pschichtel
Copy link

I can reproduce this issue as well

@cxrvh
Copy link

cxrvh commented Aug 25, 2018

It only depends on LC_NUMERIC or most likely only the decimal separator. It works when the locale uses a point (The example values are the result of printf "%'.2f" 54548):

Crashes

bs_BA.utf8: 54548,00
de_DE.utf8: 54.548,00
it_CH.utf8: 54'548,00

Runs

en_GB.utf8: 54,548.00
de_LI.utf8: 54'548.00
mfe_MU.utf8: 54 548.00

The backtrace looks exactly as in the initial report and I don't know what to do about libthread_db:

bash-4.4$ gdb -iex 'set auto-load safe-path /' portal2_linux core.295 --batch --eval-command=backtrace
[New LWP 295]
[New LWP 298]
[New LWP 300]
[New LWP 299]
[New LWP 301]
[New LWP 309]
[New LWP 297]
[New LWP 305]
[New LWP 326]
[New LWP 328]
[New LWP 303]
[New LWP 302]
[New LWP 332]
[New LWP 331]
[New LWP 333]
[New LWP 296]
[New LWP 334]
[New LWP 336]
[New LWP 304]

warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Core was generated by `/mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2_linux -game por'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xed1b6243 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/vphysics.so
[Current thread is 1 (LWP 295)]
#0  0xed1b6243 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/vphysics.so
#1  0xed1b63f8 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/vphysics.so
#2  0xe20deed2 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#3  0xe20e1127 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#4  0xe2038e30 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#5  0xe21f797d in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#6  0xe21f7c48 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#7  0xe220bca7 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#8  0xe2630ab8 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#9  0xe240fbea in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#10 0xe2410783 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#11 0xe2410ec1 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#12 0xe2399c73 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/portal2/bin/server.so
#13 0xed8f6920 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/engine.so
#14 0xed80d570 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/engine.so
#15 0xed82330d in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/engine.so
#16 0xed823a0b in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/engine.so
#17 0xed823a49 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/engine.so
#18 0xed90934f in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/engine.so
#19 0xed90597d in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/engine.so
#20 0xed905a9d in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/engine.so
#21 0xed972f80 in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/engine.so
#22 0xed90719f in ?? () from /mnt/data/Spiele/SteamLibrary/steamapps/common/Portal 2/bin/engine.so
#23 0xf6455c80 in ?? () from bin/launcher.so
#24 0xf6455c80 in ?? () from bin/launcher.so
#25 0xf643941a in LauncherMain () from bin/launcher.so
#26 0x08048564 in main ()

@nanonyme
Copy link
Collaborator

All the symbols in the trace belong to the game then.

nanonyme added a commit that referenced this issue Aug 25, 2018
Investigations in #62 revealed differences in LC_NUMERIC may result in crashes. Force it to be C (generic). Downside is numbers may look non-native but that's not a very high price to pay. 
Can be disabled through flatpak override --env=LC_NUMERIC= com.valvesoftware.Steam
@nanonyme
Copy link
Collaborator

Can someone here double-check that LC_NUMERIC=C works for you that were able to repro the crash?

@Maldela
Copy link

Maldela commented Aug 25, 2018

It works! Great job figuring that one out.

@nanonyme
Copy link
Collaborator

Update with workaround should be out around now

@Maldela
Copy link

Maldela commented Aug 25, 2018

Yes, just updated and now it works even without manually setting --env=LC_NUMERIC=C.

@Maldela
Copy link

Maldela commented Aug 25, 2018

By the way, this also fixes the stuttering audio and reverse y-axis always being on for me.

@pschichtel
Copy link

I wonder why this happens only with the Flatpak version. Why is Steam able to handle this correctly when running without Flatpak, but not with Flatpak?

@nanonyme
Copy link
Collaborator

I'm not sure but given how Steam network support breaks with unexpected /etc/localtime symlinking setups, I'm hardly surprised by anything anymore

@nanonyme
Copy link
Collaborator

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

No branches or pull requests

6 participants