ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
636 stars 74 forks source link

[PORTAL] segfault before menu is shown #1573

Closed ghost closed 7 years ago

ghost commented 10 years ago

Hello,

Portal on Linux segfaults before the main menu is shown. Backtrace places the segfault inside libc strstr() function:

traps: hl2_linux[30250] general protection ip:f7dca71d sp:ffff88e8 error:0 in libc-2.18.so[f7c9f000+1a2000]

(gdb) file /lib32/libc.so.6 Reading symbols from /lib32/libc-2.18.so...Reading symbols from /usr/lib64/debug/lib32/libc-2.18.so.debug...done. done. (gdb) core hl2_linux-30250-1000-100.1386769881.core warning: core file may not match specified executable file.

Core was generated by `/mnt/data/.home/mano/.local/share/Steam/SteamApps/common/Portal/hl2_linux -game'. Program terminated with signal 11, Segmentation fault.

0 0xf7dca71d in __strstr_sse42 (s1=0xffff8aa9 "ound/music/", s2=0xf6e92b3e "/../") at ../sysdeps/x86_64/multiarch/strstr.c:385

385 ../sysdeps/x86_64/multiarch/strstr.c: No such file or directory.

System is 64-bit gentoo, nvidia-331.20 drivers. Vanilla half-life2 runs fine.

Game update: AppID 400 "Portal", ProcID 30246, IP 0.0.0.0:0

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. SDL video target is 'x11' SDL video target is 'x11' SDL failed to create GL compatibility profile (whichProfile=0)!

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.

(steam:30097): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. Using breakpad crash handler Setting breakpad minidump AppID = 400 Forcing breakpad minidump interfaces to load Looking up breakpad interfaces from steamclient Calling BreakpadMiniDumpSystemInit Looking up breakpad interfaces from steamclient Calling BreakpadMiniDumpSystemInit Steam_SetMinidumpSteamID: Caching Steam ID: 76561197970788443 [API loaded yes] Steam_SetMinidumpSteamID: Setting Steam ID: 76561197970788443 Did not detect any valid joysticks. [1211/145107:ERROR:resource_bundle.cc(411)] Failed to load /mnt/data/.home/mano/.local/share/Steam/SteamApps/common/Portal/cef_gtk.pak Some features may not be available. [1211/145107:WARNING:proxy_service.cc(646)] PAC support disabled because there is no system implementation Focused window is now 0, 0 OnFocusWindowChanged to unknown window type: k_EWindowTypeNonSteamDesktop, 0 Could not load program cache file glbaseshaders.cfg Could not find base GL shader cache file CGLMShaderPair::SetProgramPair: Centroid masks differ at link time of vertex shader lightmappedgeneric_vs20 and pixel shader decalbasetimeslightmapalphablendselfillum2_ps20b! Loaded program cache file "glshaders.cfg", total keyvalues: 183, total successfully linked: 183 Precache: Took 560 ms, Vertex 486, Pixel 906 ConVarRef mat_dxlevel doesn't point to an existing ConVar Game.so loaded for "Half-Life 2" This system supports the OpenGL extension GL_EXT_framebuffer_object. This system supports the OpenGL extension GL_EXT_framebuffer_blit. This system supports the OpenGL extension GL_EXT_framebuffer_multisample. This system DOES NOT support the OpenGL extension GL_APPLE_fence. This system supports the OpenGL extension GL_NV_fence. This system supports the OpenGL extension GL_ARB_sync. This system supports the OpenGL extension GL_EXT_draw_buffers2. This system supports the OpenGL extension GL_EXT_bindable_uniform. This system DOES NOT support the OpenGL extension GL_APPLE_flush_buffer_range. This system supports the OpenGL extension GL_ARB_map_buffer_range. This system supports the OpenGL extension GL_ARB_vertex_buffer_object. This system supports the OpenGL extension GL_ARB_occlusion_query. This system DOES NOT support the OpenGL extension GL_APPLE_texture_range. This system DOES NOT support the OpenGL extension GL_APPLE_client_storage. This system DOES NOT support the OpenGL extension GL_ARB_uniform_buffer. This system supports the OpenGL extension GL_ARB_vertex_array_bgra. This system supports the OpenGL extension GL_EXT_vertex_array_bgra. This system supports the OpenGL extension GL_ARB_framebuffer_object. This system DOES NOT support the OpenGL extension GL_GREMEDY_string_marker. This system supports the OpenGL extension GL_ARB_debug_output. This system supports the OpenGL extension GL_EXT_direct_state_access. This system DOES NOT support the OpenGL extension GL_NV_bindless_texture. This system DOES NOT support the OpenGL extension GL_AMD_pinned_memory. This system supports the OpenGL extension GL_EXT_framebuffer_multisample_blit_scaled. This system supports the OpenGL extension GL_EXT_texture_sRGB_decode. This system supports the OpenGL extension GL_NVX_gpu_memory_info. This system DOES NOT support the OpenGL extension GL_ATI_meminfo. This system supports the OpenGL extension GL_EXT_texture_compression_s3tc. This system supports the OpenGL extension GL_EXT_texture_compression_dxt1. This system DOES NOT support the OpenGL extension GL_ANGLE_texture_compression_dxt3. This system DOES NOT support the OpenGL extension GL_ANGLE_texture_compression_dxt5. This system supports the OpenGL extension GLX_EXT_swap_control_tear. GL_NV_bindless_texture: DISABLED GL_AMD_pinned_memory: DISABLED GL_EXT_texture_sRGB_decode: AVAILABLE GL_NVX_gpu_memory_info: AVAILABLE GL_ATI_meminfo: UNAVAILABLE GL_NVX_gpu_memory_info: Total Dedicated: 2097152, Total Avail: 2097152, Current Avail: 1874268 GL_MAX_SAMPLES_EXT: 64 CShaderDeviceMgrBase::GetRecommendedConfigurationInfo: CPU speed: 3400 MHz, Processor: GenuineIntel GlobalMemoryStatus: 4294967295 CShaderDeviceMgrBase::GetRecommendedConfigurationInfo: CPU speed: 3400 MHz, Processor: GenuineIntel GlobalMemoryStatus: 4294967295 IDirect3DDevice9::Create: BackBufWidth: 1920, BackBufHeight: 1080, D3DFMT: 3, BackBufCount: 1, MultisampleType: 4, MultisampleQuality: 0 GL sampler object usage: ENABLED GL prefer MapBufferRange: NO IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000004) differs from mask derived from shader name (0x0000000C) for shader ps-file shatteredglass_ps20b ps-index 168 ps-combo 0 IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000004) differs from mask derived from shader name (0x0000000C) for shader ps-file shatteredglass_ps20b ps-index 168 ps-combo 1 IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000004) differs from mask derived from shader name (0x0000000C) for shader ps-file shatteredglass_ps20b ps-index 168 ps-combo 2 IDirect3DDevice9::CreatePixelShader: shaderapi's centroid mask (0x00000004) differs from mask derived from shader name (0x0000000C) for shader ps-file shatteredglass_ps20b ps-index 168 ps-combo 3 Unable to remove /mnt/data/.home/mano/.local/share/Steam/SteamApps/common/Portal/portal/gamestats.log! Unable to remove /mnt/data/.home/mano/.local/share/Steam/SteamApps/common/Portal/portal/gamestats.log! maxplayers set to 1 Error: Material "debug/debugluxels" uses unknown shader "DebugLuxels" Error: Materiasaving roaming config store to 'sharedconfig.vdf' roaming config store 2 saved successfully ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred Uploading dump (out-of-process) [proxy ''] /tmp/dumps/crash_20131211145105_1.dmp /mnt/data/.home/mano/.local/share/Steam/SteamApps/common/Portal/hl2.sh: line 67: 30250 Segmentation fault (core dumped) ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@" Game removed: AppID 400 "Portal", ProcID 30250 Focused window is now 1, 0 OnFocusWindowChanged to unknown window type: k_EWindowTypeSteamDesktop, 0 Focused window is now 0, 0 OnFocusWindowChanged to unknown window type: k_EWindowTypeNonSteamDesktop, 0 Finished uploading minidump (out-of-process): success = yes response: CrashID=bp-b1753676-9baa-4912-b2b4-aed182131211

ghost commented 10 years ago

To be more precise: Portal linux starts, shows the Valve logo, then the blurred background while it's loading data. When it is supposed to un-blur the background and show the menu, it segfaults. Also, it seems to depend on what is shown in the background: When the first testchamber is shown, it crashes. Very rarely it shows the "cake and computer" screen (like after beating the game), and does NOT crash.

ghost commented 10 years ago

After installing the latest development version of glibc, the bug is gone. (glibc removed the SSE42 version of strstr() since it was slower than the sse2 version). It seems portal has found a new way to trigger a bug in the now gone SSE42 strstr version.

ghost commented 10 years ago

turns out this is an issue with gcc not sufficiently aligning sse-using variables on 32bit code. There's a bit of back and forth on the glibc list as to how to proceed, and the consensus was to remove sse42-versions altogether because of quadratic complexity.

kernelOfTruth commented 10 years ago

something very similar seems to happen with the new Portal2 Beta,

suspected that it was related to glibc 2.18:

[ 9893.164360] traps: portal2_linux[14806] general protection ip:f7687e3b sp:ffb4cf38 error:0 in libc-2.18.so[f7555000+1a6000]

portal2.sh: line 46: 14735 Segmentation fault ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"

@mlauss how did you get the "latest development version of glibc"

glibc-9999 (which sounds scary), or glibc-2.19 ?

thanks

ghost commented 10 years ago

install glibc-2.19, it contains the necessary "fix".

kernelOfTruth commented 10 years ago

thanks for the answer @mlauss !

that worked perfectly, the game was stable for several sections/levels :)

kisak-valve commented 7 years ago

Closing per the least comment.

aerusso commented 6 years ago

I'd like to reopen this. I get exactly these same symptoms on Debian unstable starting with libc6 2.26-1 (works with 2.25-6). I opened a Debian bug, but there's been no interest in it.

Attached gdb, and it superficially looks closely related:


Thread 1 "hl2_linux" received signal SIGSEGV, Segmentation fault.
__strpbrk_sse42 (s=0xf5c2efd6 "rb", a=0xf5c34806 "wa+")
    at ../sysdeps/x86_64/multiarch/strcspn-c.c:96
96      ../sysdeps/x86_64/multiarch/strcspn-c.c: No such file or directory.
(gdb) ```
ghost commented 6 years ago

Which gcc version do you have? There's gcc bug #81481 which results in glibc's strspn() function being miscompiled. I don't see any issue with a glibc-2.27 snapshot rebuilt with patched gcc-7.2

kisak-valve commented 6 years ago

Hello @aerusso, feel free to open a new issue report if you want the issue tracked here, but with the symptoms you have described, it's unlikely to be an issue with Portal because you've already isolated the issue to glibc.

As for troubleshooting, the .dmp files are Breakpad's minidumps and you can use minidump_stackwalk to make a human-readable backtrace from it, or you can use the GAME_DEBUGGER env variable to have Portal use a different debugger. From outside of Steam it would be something like GAME_DEBUGGER=gdb ~/.local/share/Steam/ubuntu12_32/steam-runtime/run.sh ./hl2.sh to get the game into a similar environment to how it's run from Steam.

aerusso commented 6 years ago

Thanks for looking at this. Apparently someone else hit this bug a few days ago, and everything @mlauss said seems to be the case.

@kisak-valve: I agree. Thanks for telling me how to set up the runtime environment, that may be useful later.