protonscr

Big Picture Segmentation Fault on openSUSE Tumbleweed

steamclosed Big PictureDistro Family: openSUSEWeb Component
ValveSoftware/steam-for-linux#9015 · opened 2022-12-18 by toalex77 · updated 2023-06-09 · 30 comments · github
Ttoalex77 2022-12-18 github

Your system information

  • Steam client version: Dec 15 2022 (1671236931)
  • Distribution: openSUSE Tumbleweed
  • Opted into Steam client beta?: No
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

When I switch to Big Picture, after few seconds, I get a segmentation fault.

Here a backtrace obtained with gdb:

Thread 1 "steam" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xf7d1eb80 (LWP 618)]
0xedce854b in std::__cxx11::moneypunct<char, false>::do_thousands_sep (this=0xffff5428) at /usr/src/debug/gcc-13.0.0+git197351/obj-x86_64-suse-linux/x86_64-suse-linux/32/libstdc++-v3/include/bits/locale_facets_nonio.h:1310
Downloading 0.07 MB source file /usr/src/debug/gcc-13.0.0+git197351/obj-x86_64-suse-linux/x86_64-suse-linux/32/libstdc++-v3/include/bits/locale_facets_nonio.h...
1310          { return _M_data->_M_thousands_sep; }
(gdb) bt
#0  0xedce854b in std::__cxx11::moneypunct<char, false>::do_thousands_sep (this=0xffff5428)
    at /usr/src/debug/gcc-13.0.0+git197351/obj-x86_64-suse-linux/x86_64-suse-linux/32/libstdc++-v3/include/bits/locale_facets_nonio.h:1310
#1  0xedd2bba4 in std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put (__v=2, __fill=<optimized out>, __io=..., __s=..., 
    this=0xede36894 <(anonymous namespace)::moneypunct_cf>) at /usr/src/debug/gcc-13.0.0+git197351/obj-x86_64-suse-linux/x86_64-suse-linux/32/libstdc++-v3/include/bits/locale_facets.h:2400
#2  std::ostream::_M_insert<long> (this=0xffff5528, __v=2) at /usr/src/debug/gcc-13.0.0+git197351/obj-x86_64-suse-linux/x86_64-suse-linux/32/libstdc++-v3/include/bits/ostream.tcc:73
#3  0xedd2be20 in std::ostream::operator<< (this=0xffff5528, __n=2)
    at /usr/src/debug/gcc-13.0.0+git197351/obj-x86_64-suse-linux/x86_64-suse-linux/32/libstdc++-v3/include/bits/ostream.tcc:112
#4  0xe7e7a632 in v8::internal::operator<<(std::ostream&, v8::internal::CallICState const&) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
#5  0xe7c70a8d in v8::internal::CallICStub::PrintState(std::ostream&) const () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
#6  0xe7c6fd4b in v8::internal::CodeStub::PrintName(std::ostream&) const () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
#7  0xe7c73599 in v8::internal::CodeStub::RecordCodeGeneration(v8::internal::Handle<v8::internal::Code>) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
#8  0xe7c761b1 in v8::internal::CodeStub::GetCode() () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
#9  0xe7e82201 in v8::internal::CallIC::initialize_stub(v8::internal::Isolate*, int, v8::internal::CallICState::CallType) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#10](/issue/ValveSoftware/steam-for-linux/10) 0xe802171e in v8::internal::FullCodeGenerator::EmitCall(v8::internal::Call*, v8::internal::CallICState::CallType) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#11](/issue/ValveSoftware/steam-for-linux/11) 0xe802201c in v8::internal::FullCodeGenerator::EmitCallWithLoadIC(v8::internal::Call*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#12](/issue/ValveSoftware/steam-for-linux/12) 0xe8032280 in v8::internal::FullCodeGenerator::VisitCall(v8::internal::Call*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#13](/issue/ValveSoftware/steam-for-linux/13) 0xe7c4deca in v8::internal::Call::Accept(v8::internal::AstVisitor*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#14](/issue/ValveSoftware/steam-for-linux/14) 0xe7d73864 in v8::internal::FullCodeGenerator::Visit(v8::internal::AstNode*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#15](/issue/ValveSoftware/steam-for-linux/15) 0xe7d77173 in v8::internal::FullCodeGenerator::VisitExpressionStatement(v8::internal::ExpressionStatement*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#16](/issue/ValveSoftware/steam-for-linux/16) 0xe7c4db27 in v8::internal::ExpressionStatement::Accept(v8::internal::AstVisitor*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#17](/issue/ValveSoftware/steam-for-linux/17) 0xe7d73864 in v8::internal::FullCodeGenerator::Visit(v8::internal::AstNode*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#18](/issue/ValveSoftware/steam-for-linux/18) 0xe7c4e0ce in v8::internal::AstVisitor::VisitStatements(v8::internal::ZoneList<v8::internal::Statement*>*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#19](/issue/ValveSoftware/steam-for-linux/19) 0xe801bccc in v8::internal::FullCodeGenerator::Generate() () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#20](/issue/ValveSoftware/steam-for-linux/20) 0xe7d74854 in v8::internal::FullCodeGenerator::MakeCode(v8::internal::CompilationInfo*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#21](/issue/ValveSoftware/steam-for-linux/21) 0xe7d0d935 in v8::internal::GetUnoptimizedCodeCommon(v8::internal::CompilationInfo*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#22](/issue/ValveSoftware/steam-for-linux/22) 0xe7d100c3 in v8::internal::Compiler::GetLazyCode(v8::internal::Handle<v8::internal::JSFunction>) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#23](/issue/ValveSoftware/steam-for-linux/23) 0xe7f4fa65 in v8::internal::Runtime_CompileLazy(int, v8::internal::Object**, v8::internal::Isolate*) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#24](/issue/ValveSoftware/steam-for-linux/24) 0x2480a2b6 in ?? ()
[#25](/issue/ValveSoftware/steam-for-linux/25) 0x2482fb5c in ?? ()
[#26](/issue/ValveSoftware/steam-for-linux/26) 0x2480a1fb in ?? ()
[#27](/issue/ValveSoftware/steam-for-linux/27) 0x24854ab0 in ?? ()
[#28](/issue/ValveSoftware/steam-for-linux/28) 0x2485310b in ?? ()
[#29](/issue/ValveSoftware/steam-for-linux/29) 0x2482fa55 in ?? ()
[#30](/issue/ValveSoftware/steam-for-linux/30) 0x2482b8ea in ?? ()
[#31](/issue/ValveSoftware/steam-for-linux/31) 0xe7d4d5da in v8::internal::Invoke(bool, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) ()
   from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#32](/issue/ValveSoftware/steam-for-linux/32) 0xe7d4e8c0 in v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, bool) () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#33](/issue/ValveSoftware/steam-for-linux/33) 0xe7c29b47 in v8::Script::Run() () from /home/alex/.local/share/Steam/ubuntu12_32/libv8.so
[#34](/issue/ValveSoftware/steam-for-linux/34) 0xc5285dd2 in ?? () from /home/alex/.local/share/Steam/ubuntu12_32/panorama/panorama.so
[#35](/issue/ValveSoftware/steam-for-linux/35) 0xc52b9513 in ?? () from /home/alex/.local/share/Steam/ubuntu12_32/panorama/panorama.so
[#36](/issue/ValveSoftware/steam-for-linux/36) 0xe9165392 in ?? () from /home/alex/.local/share/Steam/ubuntu12_32/steamui.so
[#37](/issue/ValveSoftware/steam-for-linux/37) 0xc5286d65 in ?? () from /home/alex/.local/share/Steam/ubuntu12_32/panorama/panorama.so
[#38](/issue/ValveSoftware/steam-for-linux/38) 0xc526d37f in ?? () from /home/alex/.local/share/Steam/ubuntu12_32/panorama/panorama.so
[#39](/issue/ValveSoftware/steam-for-linux/39) 0xc52701e2 in ?? () from /home/alex/.local/share/Steam/ubuntu12_32/panorama/panorama.so
[#40](/issue/ValveSoftware/steam-for-linux/40) 0xe894680b in ?? () from /home/alex/.local/share/Steam/ubuntu12_32/steamui.so
[#41](/issue/ValveSoftware/steam-for-linux/41) 0xe8948360 in ?? () from /home/alex/.local/share/Steam/ubuntu12_32/steamui.so
[#42](/issue/ValveSoftware/steam-for-linux/42) 0x5659ec99 in ?? ()
[#43](/issue/ValveSoftware/steam-for-linux/43) 0x5659fbae in ?? ()
[#44](/issue/ValveSoftware/steam-for-linux/44) 0x56589b30 in ?? ()
[#45](/issue/ValveSoftware/steam-for-linux/45) 0xf7a23295 in __libc_start_call_main (main=main@entry=0x56589b00, argc=argc@entry=1, argv=argv@entry=0xffffb2b4) at ../sysdeps/nptl/libc_start_call_main.h:58
[#46](/issue/ValveSoftware/steam-for-linux/46) 0xf7a23358 in __libc_start_main_impl (main=0x56589b00, argc=1, argv=0xffffb2b4, init=0x56a02bb0 <__libc_csu_init>, fini=0x56a02c20 <__libc_csu_fini>, rtld_fini=0xf7fcc990 <_dl_fini>, 
    stack_end=0xffffb2ac) at ../csu/libc-start.c:381
[#47](/issue/ValveSoftware/steam-for-linux/47) 0x5658e9f5 in _start ()

Steps for reproducing this issue:

  1. Start Steam Client on openSUSE Tumbleweed
  2. Switch to Big Picture mode
  3. Crash
Kkisak-valve maintainer 2022-12-18 github

Hello @toalex77, the top of your backtrace looks suspiciously like a libstdc++/gcc 13 random git build regression of some kind. It may be worthwhile to also mention this to your distro's package maintainer for libstdc++ and/or possibly upstream gcc.

Ttoalex77 2022-12-19 github

It seems that there are actually multiple versions of libstdc++6 on Tumbleweed and effectively, if I replace libstdc++6 (v. 13.0.0+git197351-1.1) with libstdc++6-gcc12 (v. 12.2.1+git537-1.2 with all dependencies), the issue disappear.

I reported also on openSUSE issue tracker https://bugzilla.opensuse.org/show_bug.cgi?id=1206503

Thanks.

DDarkWav 2022-12-22 github

For me the issue is gone on latest Steam Beta Update, it just happens on Stable Steam update.

Mmarxin 2023-01-10 github

I can confirm we already shipped libstdc++ from GCC 13 into Tumbleweed and that's why we see the crash.

Anyway, the issues started with https://github.com/gcc-mirror/gcc/commit/b3ac43a3c05744d62a963d656bed782fc867ad79.
@jwakely: Is the revision supposed to introduce an ABI change and thus we face the aforementioned issue where _M_data == nullptr?

Jjwakely 2023-01-10 github

Is the revision supposed to introduce an ABI change

No, and I don't see how it can introduce one. It only changes how we access values that are already present (using static_cast instead of dynamic_cast for facets guaranteed to be present, so the RTTI check is unnecessary). It shouldn't change what is accessed (or whether it's null), only how it's accessed. Are you 100% confident in the bisection result?

and thus we face the aforementioned issue where _M_data == nullptr?

Are you sure it's null, and not just garbage? The stack trace above doesn't actually show the value of _M_data where it faults. Edit: it's null

There's not enough info here to debug anything. How is the binary linked to libstdc++? Dynamically? Statically? If dynamically, is the new libstdc++.so.6 being used at runtime?

I need a reproducer really.

Jjwakely 2023-01-10 github

I need a reproducer really.

OK, I can reproduce a crash on Fedora using LD_LIBRARY_PATH=$HOME/gcc/13/lib steam so I should be able to debug this now.

Jjwakely 2023-01-10 github

But LD_LIBRARY_PATH=$HOME/gcc/13/lib DEBUGGER=gdb steam doesn't crash :confused:

Jjwakely 2023-01-10 github

Doh, that's because my client updated itself to the latest beta. Reverting to stable gets me back to crashing, including under gdb. I probably can't debug this for a few days though, I have a higher priority libstdc++ ABI issue to fix first.

Jjwakely 2023-01-10 github

Why is std::num_put even calling a member of std::moneypunct ?! Something is corrupted on the stack here.

Mmarxin 2023-01-10 github
(gdb) p this
$3 = (const std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > > * const) 0xede36894 <(anonymous namespace)::moneypunct_cf>
(gdb) info vtbl this
vtable for 'std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >' @ 0xede31888 (subobject @ 0xede36894):
[0]: 0xedcb9ae0 <std::__cxx11::moneypunct<char, false>::~moneypunct()>
[1]: 0xedcb9be0 <std::__cxx11::moneypunct<char, false>::~moneypunct()>
[2]: 0xedce8530 <std::__cxx11::moneypunct<char, false>::do_decimal_point() const>
[3]: 0xedce8540 <std::__cxx11::moneypunct<char, false>::do_thousands_sep() const>
[4]: 0xedce8c40 <std::__cxx11::moneypunct<char, false>::do_grouping() const>
[5]: 0xedce8f40 <std::__cxx11::moneypunct<char, false>::do_curr_symbol() const>
[6]: 0xedce8fa0 <std::__cxx11::moneypunct<char, false>::do_positive_sign() const>
[7]: 0xedce9000 <std::__cxx11::moneypunct<char, false>::do_negative_sign() const>
[8]: 0xedce8550 <std::__cxx11::moneypunct<char, false>::do_frac_digits() const>
[9]: 0xedce8560 <std::__cxx11::moneypunct<char, false>::do_pos_format() const>

it's called here:
│     2398        iter_type                                                                                                                                                                                                                                                    │
│     2399        put(iter_type __s, ios_base& __io, char_type __fill, long __v) const                                                                                                                                                                                         │
│  >  2400        { return this->do_put(__s, __io, __fill, __v); }                                                                                                                                                                                                             │
Mmarxin 2023-01-10 github

Are you 100% confident in the bisection result?

Yes, I'm pretty sure.

Jjwakely 2023-01-11 github

I wonder if we're seeing https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91057 here. It looks like some of the steam code is statically linked to libstdc++, maybe an older version that doesn't have that fix.

Jjwakely 2023-01-11 github

If I change the static_cast in std::__try_use_facet to be dynamic_cast then the segfault doesn't happen, but the dynamic_cast fails and returns a null pointer. This means that when an iostream object is constructed, it gets std::ios::_M_num_put == nullptr and writing numeric types to such a stream will throw std::bad_cast exceptions. This is what was happening with GCC 12 and previous GCC versions.

With GCC 13 the corrupted facet IDs result in a crash when the stream is constructed, instead of unusable streams. I think the bug with corrupted facet IDs was always present in steam, but the new GCC code is unable to cope with that corruption and crashes. IIUC this is only a problem when a multithreaded application is statically linked to the libstdc++.a from GCC 9 or older, but there's no way to detect that and make the new code more resilient. To support that case I think we need to revert the very significant performance improvements from https://github.com/gcc-mirror/gcc/commit/b3ac43a3c05744d62a963d656bed782fc867ad79 :cry:

Ssmcv 2023-01-11 github

Switch to Big Picture mode

To be clear, is this the old Big Picture (the blue one, as shown in https://help.steampowered.com/en/faqs/view/3725-76D3-3F31-FB63), or the new Big Picture (basically the Steam Deck UI, as shown in https://store.steampowered.com/news/app/593110/view/3394051164709183116)?

In the beta client, I believe both are available as steam -bigpicture -oldbigpicture and steam -bigpicture -newbigpicture respectively (and steam -gamepadui is the same as -bigpicture -newbigpicture).

Ttoalex77 2023-01-11 github

Switch to Big Picture mode

To be clear, is this the old Big Picture (the blue one, as shown in https://help.steampowered.com/en/faqs/view/3725-76D3-3F31-FB63), or the new Big Picture (basically the Steam Deck UI, as shown in https://store.steampowered.com/news/app/593110/view/3394051164709183116)?

In the beta client, I believe both are available as steam -bigpicture -oldbigpicture and steam -bigpicture -newbigpicture respectively (and steam -gamepadui is the same as -bigpicture -newbigpicture).

The old one.

Ssmcv 2023-01-11 github

IIUC this is only a problem when a multithreaded application is statically linked to the libstdc++.a from GCC 9 or older

Parts of Steam are linked to the libstdc++.a from gcc 9 (as provided by the Steam Runtime). This is not something that is avoidable any time soon. Steam can't rely on a dynamically-linked libstdc++ from the OS, because it still supports being run on OSs like Debian 10 (and openSUSE 15.4, I think) where the OS libstdc++ version is older than ours. It also can't ship its own dynamically-linked libstdc++, because that would break the dependencies of the graphics stack on OSs like Debian 11 (and openSUSE Tumbleweed) where the OS libstdc++ version is newer.

If there's a fix that can be backported into the Steam Runtime's gcc 9, or a symbol that can be removed from the dynamic symbol table as a workaround, then those might be good short-term solutions.

Ssmcv 2023-01-11 github

For me the issue is gone on latest Steam Beta Update, it just happens on Stable Steam update.

Is this still true for people who are seeing this? I think the beta has some linker-script fixes so that fewer symbols originating from the statically-linked libstdc++ will "leak" outside each module, so it would not be surprising if it avoided this crash.

If you're using Steam on a development distribution like openSUSE Tumbleweed or Debian unstable, consider using the beta, which usually reflects how the stable version will behave in a few weeks' or months' time. That would let you provide early feedback on new crashes and other issues before they hit stable, and then get the fixes for those issues as soon as they become available. It would also give you the ability to fall back to stable if there is a regression in the beta, whereas if a regression reaches the stable release, there's nowhere further to fall back to.

the old Big Picture

In a version that is affected, does the new Steam-Deck-style Big Picture (steam -bigpicture -newbigpicture or steam -gamepadui) have the same failure mode?

I don't think the old blue Big Picture (which seems to be called "panorama" internally) is necessarily going to remain available forever, so if this issue is specific to old Big Picture, it might solve itself eventually.

Mmarxin 2023-01-11 github

In a version that is affected, does the new Steam-Deck-style Big Picture (steam -bigpicture -newbigpicture

This one also crashes.

or steam -gamepadui) have the same failure mode?

While this is fine!

Jjwakely 2023-01-11 github

If there's a fix that can be backported into the Steam Runtime's gcc 9

Yes, that is possible, and I think that would be a good fix to backport (even if I end up reverting the dynamic_cast -> static_cast change in GCC 13). I can prepare that backport and give you a patch.

Ssmcv 2023-01-11 github

In a version that is affected, does the new Steam-Deck-style Big Picture (steam -bigpicture -newbigpicture

This one also crashes.

or steam -gamepadui) have the same failure mode?

While this is fine!

This confuses me: I would have expected those two to be equivalent. But perhaps the stable release is too old to understand the -newbigpicture argument?

Mmarxin 2023-01-11 github

This confuses me: I would have expected those two to be equivalent. But perhaps the stable release is too old to understand the -newbigpicture argument?

Dunno. I'm using 1.0.0.75-2.1 and if I pass an unknown argument there's no warning displayed. So hard to guess if the argument is supported or not.

Jjwakely 2023-01-12 github

If there's a fix that can be backported into the Steam Runtime's gcc 9

Yes, that is possible, and I think that would be a good fix to backport (even if I end up reverting the dynamic_cast -> static_cast change in GCC 13). I can prepare that backport and give you a patch.

Here is the backport to the releases/gcc-9 branch:
https://github.com/jwakely/gcc/commit/11da50077c91b6dec1793b9c4d6ccfdcf6b8ea32

Or as a pull req comparison thingy:
https://github.com/jwakely/gcc/compare/releases/gcc-9...jwakely:gcc:gcc-9-steam-facet-id-backport?expand=1

The _GLIBCXX_LONG_DOUBLE_COMPAT stuff is only needed for powerpc64 (and legacy targets like DEC alpha) so you could rip that out for x86 if you prefer.

Ssmcv 2023-01-12 github

Thanks, I'll look into whether we can get that into the Steam Runtime.

@TTimo, FYI, relevant branches here would be scout, heavy and soldier (all of which have gcc older than 9 as default, and a non-default backport of gcc 9 which has been forced to always link libstdc++ statically). I think everything in Steam is compiled with the g++-9 from scout, except for steamwebhelper which uses heavy. For fixes in our libstdc++ to take effect, potentially all C++ code in Steam would need recompiling, so we'd need to choose a suitable time in Steam's release cycle to make that happen.

Ssmcv 2023-01-13 github

Here is the backport to the releases/gcc-9 branch: jwakely/gcc@11da500

@jwakely: This is a backport of both cc386cf2 (r276762) and the subsequent bug fix 9cfc400f (r276840), am I correct?

Jjwakely 2023-01-13 github

Yes, that's correct, I combined them into one commit.

Ssmcv 2023-01-13 github

The _GLIBCXX_LONG_DOUBLE_COMPAT stuff is only needed for powerpc64 (and legacy targets like DEC alpha) so you could rip that out for x86 if you prefer.

I'd prefer to use the most straightforward possible backport of the same code that's in gcc 10, even if some of it isn't relevant on x86 - that seems lower-risk. It seems that what you provided is exactly that backport (but with the two changes squashed into one commit), so that's ideal.

Ssmcv 2023-01-23 github

Today's beta SDK for soldier (version 0.20230117.0) includes the backported change, but this will not yet have any practical effect for Steam users.

A future release of Steam will hopefully be recompiled with a g++-9 that includes the same backported change.

Ssmcv 2023-02-23 github

Yesterday's Steam beta 1677103459 (2023-02-22) is the first to ship with scout and heavy Steam Runtime SDKs that include the backported change in their g++-9. I can't confirm whether Steam was recompiled with this version of g++-9, but it hopefully was, which should fix the segfault for users of the Steam client beta branch.

This change should get into the general-availability branch of Steam with the next big update.

Ssmcv 2023-05-04 github

This change should get into the general-availability branch of Steam with the next big update.

I believe this happened a while ago.

Kkisak-valve maintainer 2023-06-09 github

Closing as fixed.

Error codes