Multiple definition of global variable Credits #11

Closed
opened 2024-12-11 04:37:27 -05:00 by rich · 0 comments

I was trying to look at the CaveClientApp segfault on exit, so compiled the code with -fsanitize=address, this highlighted that the global variable Credits defined in CredisWindow.hpp is linked in to the main executable CaveClientApp and libCaveClient.so

Anyway, probably not the error I was looking for but felt like it needed logging.

==33788==ERROR: AddressSanitizer: odr-violation (0x5e05be3d4120):
[1] size=24 'Credits' /home/rich/Redacted/ReCaveGame/Client/include/Client/CreditsWindow.hpp:14:56 in /home/rich/Redacted/ReCaveGame/build/ClientApp/CaveClientApp
[2] size=24 'Credits' /home/rich/Redacted/ReCaveGame/Client/include/Client/CreditsWindow.hpp:14:56 in /home/rich/Redacted/ReCaveGame/build/Client/libCaveClient.so
These globals were registered at these points:
[1]:
#0 0x70679005306f in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:350
#1 0x5e05be37d9c7 in _sub_I_00099_1 (/home/rich/Redacted/ReCaveGame/build/ClientApp/CaveClientApp+0xdf9c7) (BuildId: 2e918de521cabbed8b9288eaeccdde83a0d2770d)
#2 0x70678e42a303 in call_init ../csu/libc-start.c:145
#3 0x70678e42a303 in __libc_start_main_impl ../csu/libc-start.c:347
#4 0x5e05be2fb664 in _start (/home/rich/Redacted/ReCaveGame/build/ClientApp/CaveClientApp+0x5d664) (BuildId: 2e918de521cabbed8b9288eaeccdde83a0d2770d)

[2]:
#0 0x70679005306f in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:350
#1 0x70678ff27244 in _sub_I_00099_1 (/home/rich/Redacted/ReCaveGame/build/Client/libCaveClient.so+0xa8244) (BuildId: 5a19620abd3528df1abf52e6f539c6bea3e97c72)
#2 0x70679074b71e in call_init elf/dl-init.c:74
#3 0x70679074b823 in call_init elf/dl-init.c:120
#4 0x70679074b823 in _dl_init elf/dl-init.c:121
#5 0x70679076559f (/lib64/ld-linux-x86-64.so.2+0x1f59f) (BuildId: 353e1b6cb0eebc08cf3ff812eae8a51b4efd684e)

==33788==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'Credits' at /home/rich/Redacted/ReCaveGame/Client/include/Client/CreditsWindow.hpp:14:56 in /home/rich/Redacted/ReCaveGame/build/ClientApp/CaveClientApp
==33788==ABORTING
rich@jam:~/Redacted/ReCaveGame/build/ClientApp$

I was trying to look at the CaveClientApp segfault on exit, so compiled the code with -fsanitize=address, this highlighted that the global variable Credits defined in CredisWindow.hpp is linked in to the main executable CaveClientApp and libCaveClient.so Anyway, probably not the error I was looking for but felt like it needed logging. ==33788==ERROR: AddressSanitizer: odr-violation (0x5e05be3d4120): [1] size=24 'Credits' /home/rich/Redacted/ReCaveGame/Client/include/Client/CreditsWindow.hpp:14:56 in /home/rich/Redacted/ReCaveGame/build/ClientApp/CaveClientApp [2] size=24 'Credits' /home/rich/Redacted/ReCaveGame/Client/include/Client/CreditsWindow.hpp:14:56 in /home/rich/Redacted/ReCaveGame/build/Client/libCaveClient.so These globals were registered at these points: [1]: #0 0x70679005306f in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:350 #1 0x5e05be37d9c7 in _sub_I_00099_1 (/home/rich/Redacted/ReCaveGame/build/ClientApp/CaveClientApp+0xdf9c7) (BuildId: 2e918de521cabbed8b9288eaeccdde83a0d2770d) #2 0x70678e42a303 in call_init ../csu/libc-start.c:145 #3 0x70678e42a303 in __libc_start_main_impl ../csu/libc-start.c:347 #4 0x5e05be2fb664 in _start (/home/rich/Redacted/ReCaveGame/build/ClientApp/CaveClientApp+0x5d664) (BuildId: 2e918de521cabbed8b9288eaeccdde83a0d2770d) [2]: #0 0x70679005306f in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:350 #1 0x70678ff27244 in _sub_I_00099_1 (/home/rich/Redacted/ReCaveGame/build/Client/libCaveClient.so+0xa8244) (BuildId: 5a19620abd3528df1abf52e6f539c6bea3e97c72) #2 0x70679074b71e in call_init elf/dl-init.c:74 #3 0x70679074b823 in call_init elf/dl-init.c:120 #4 0x70679074b823 in _dl_init elf/dl-init.c:121 #5 0x70679076559f (/lib64/ld-linux-x86-64.so.2+0x1f59f) (BuildId: 353e1b6cb0eebc08cf3ff812eae8a51b4efd684e) ==33788==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0 SUMMARY: AddressSanitizer: odr-violation: global 'Credits' at /home/rich/Redacted/ReCaveGame/Client/include/Client/CreditsWindow.hpp:14:56 in /home/rich/Redacted/ReCaveGame/build/ClientApp/CaveClientApp ==33788==ABORTING rich@jam:~/Redacted/ReCaveGame/build/ClientApp$
josh closed this issue 2025-02-03 01:43:02 -05:00
Sign in to join this conversation.
No description provided.