[Scummvm-tracker] [ScummVM :: Bugs] #15015: COMMON: AGS games lead to a reproducable crash on exiting ScummVM

ScummVM :: Bugs trac at scummvm.org
Mon Mar 18 19:28:09 UTC 2024


#15015: COMMON: AGS games lead to a reproducable crash on exiting ScummVM
--------------------+--------------------------
Reporter:  raziel-  |       Owner:  (none)
    Type:  defect   |      Status:  new
Priority:  normal   |   Component:  Engine: AGS
 Version:           |  Resolution:
Keywords:           |        Game:
--------------------+--------------------------
Comment (by PushmePullyu):

 I have pushed some code that tests if statics are destroyed on DSO unload
 here:
 [https://github.com/PushmePullyu/sotest/tree/main]

 You will have to adjust the compiler flags in build-linux.sh to your
 system (and maybe change the SONAME define in sotest.cpp).

 Output on my system:
 ./sotest
 {{{
 sotest.cpp:35: int main(): Registering cleanup function
 sotest.cpp:43: int main(): Loading SO
 sotest.cpp:48: int main(): Getting function pointer from SO
 sotest.cpp:53: int main(): Calling SO function
 libfoo.cpp:11: void someSOFunc(): This is someSOFunc()
 libfoo.cpp:6: void someSOFuncWithStatic(): This is someSOFuncWithStatic()
 testclass.cpp:9: TestClass::TestClass(const char*): TestClass ctor:
 context: libfoo, this=0x7f5647ca4080
 sotest.cpp:56: int main(): Calling local function
 sotest.cpp:27: void localFuncWithStatic(): This is localFuncWithStatic()
 testclass.cpp:9: TestClass::TestClass(const char*): TestClass ctor:
 context: sotest, this=0x4040c0
 sotest.cpp:59: int main(): Unloading SO
 testclass.cpp:13: TestClass::~TestClass(): TestClass dtor: context:
 libfoo, this=0x7f5647ca4080
 sotest.cpp:62: int main(): Calling SDL_Quit
 sotest.cpp:65: int main(): Returning from main
 testclass.cpp:13: TestClass::~TestClass(): TestClass dtor: context:
 sotest, this=0x4040c0
 sotest.cpp:23: void cleanup(): This is cleanup()
 }}}

 To see whether gcc was built with cxa_atexit, you can use -v:

 {{{
 g++ -v 2>&1 | grep -io '[^[:space:]]*cxa_atexit'
 }}}
 Output:

 {{{
 --enable-__cxa_atexit
 }}}


 If it was, {{{-fuse-cxa-atexit}}} should be passed by default.

 Or:

 {{{
 g++ -Q --help=c++ | grep -iF atexit
 }}}
 Output:

 {{{
   -fuse-cxa-atexit                      [available in C++, ObjC++]
 }}}


 You could also check your C lib / scummvm executable for the cxa_atexit
 symbol.
 E.g. on a Linux system using glibc:

 {{{
 nm -D /lib64/libc.so.6 | grep -iF cxa_atexit
 }}}
 Output:

 {{{
 000000000003fb70 T __cxa_atexit@@GLIBC_2.2.5
 }}}
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/15015#comment:14>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list