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

ERROR: AddressSanitizer: SEGV on unknown address #1189

Closed
psampathkumar opened this issue Aug 4, 2022 · 3 comments · Fixed by #1190
Closed

ERROR: AddressSanitizer: SEGV on unknown address #1189

psampathkumar opened this issue Aug 4, 2022 · 3 comments · Fixed by #1190
Labels
bug Something isn't working server This issue requires changes to the server
Milestone

Comments

@psampathkumar
Copy link
Contributor

Describe the bug
SEGV on unknown address in ASan..

To Reproduce
Steps to reproduce the behavior:

  1. Run autogame with ASan.

Expected behavior
No errors.

Platform and version (please complete the following information):

  • master

Additional context

==61644==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x7f1217c2e279 bp 0x000000000002 sp 0x7ffedde70c80 T0)
==61644==The signal is caused by a READ memory access.
==61644==Hint: this fault was caused by a dereference of a high value address (see register values below).  Disassemble the provided pc to learn which register was used.
    #0 0x7f1217c2e279 in bool __sanitizer::atomic_compare_exchange_strong<__sanitizer::atomic_uint8_t>(__sanitizer::atomic_uint8_t volatile*, __sanitizer::atomic_uint8_t::Type*, __sanitizer::atomic_uint8_t::Type, __sanitizer::memory_order) /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_atomic_clang.h:80
    #1 0x7f1217c2e279 in __asan::Allocator::AtomicallySetQuarantineFlagIfAllocated(__asan::AsanChunk*, void*, __sanitizer::BufferedStackTrace*) /usr/src/debug/gcc/libsanitizer/asan/asan_allocator.cpp:620
    #2 0x7f1217c2e279 in __asan::Allocator::Deallocate(void*, unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType) /usr/src/debug/gcc/libsanitizer/asan/asan_allocator.cpp:696
    #3 0x7f1217cc1740 in operator delete(void*, unsigned long) /usr/src/debug/gcc/libsanitizer/asan/asan_new_delete.cpp:164
    #4 0x5571f2e53535 in nation_type::~nation_type() /home/pranav/freeciv/freeciv21/common/nation.cpp:512
    #5 0x5571f2e5b080 in void std::_Destroy<nation_type>(nation_type*) /usr/include/c++/12.1.1/bits/stl_construct.h:151
    #6 0x5571f2e5b080 in void std::_Destroy_aux<false>::__destroy<nation_type*>(nation_type*, nation_type*) /usr/include/c++/12.1.1/bits/stl_construct.h:163
    #7 0x5571f2e5b080 in void std::_Destroy<nation_type*>(nation_type*, nation_type*) /usr/include/c++/12.1.1/bits/stl_construct.h:196
    #8 0x5571f2e5b080 in void std::_Destroy<nation_type*, nation_type>(nation_type*, nation_type*, std::allocator<nation_type>&) /usr/include/c++/12.1.1/bits/alloc_traits.h:850
    #9 0x5571f2e5b080 in std::vector<nation_type, std::allocator<nation_type> >::~vector() /usr/include/c++/12.1.1/bits/stl_vector.h:730
    #10 0x7f1216656e34  (/usr/lib/libc.so.6+0x3ae34)
    #11 0x7f1216656faf in exit (/usr/lib/libc.so.6+0x3afaf)
    #12 0x5571f2684085 in load_rulesets(char const*, char const*, bool, void (*)(char const*), bool, bool, bool) /home/pranav/freeciv/freeciv21/server/ruleset.cpp:8609
    #13 0x5571f2343c49 in srv_prepare /home/pranav/freeciv/freeciv21/server/server.cpp:197
    #14 0x5571f2343c49 in freeciv::server::server() /home/pranav/freeciv/freeciv21/server/server.cpp:318
    #15 0x5571f231babf in main /home/pranav/freeciv/freeciv21/server/civserver.cpp:404
    #16 0x7f121663f2cf  (/usr/lib/libc.so.6+0x232cf)
    #17 0x7f121663f389 in __libc_start_main (/usr/lib/libc.so.6+0x23389)
    #18 0x5571f2324d34 in _start (/home/pranav/freeciv/freeciv21/build/freeciv21-server+0x19edd34)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_atomic_clang.h:80 in bool __sanitizer::atomic_compare_exchange_strong<__sanitizer::atomic_uint8_t>(__sanitizer::atomic_uint8_t volatile*, __sanitizer::atomic_uint8_t::Type*, __sanitizer::atomic_uint8_t::Type, __sanitizer::memory_order)
@psampathkumar psampathkumar added bug Something isn't working Untriaged This issue or PR needs triaging labels Aug 4, 2022
@psampathkumar
Copy link
Contributor Author

Possibly introduced in #1138

@lmoureaux
Copy link
Contributor

Crash is here:

freeciv21/server/ruleset.cpp

Lines 8608 to 8609 in ee1e43a

// Cannot load even default ruleset, we're in completely unusable state
exit(EXIT_FAILURE);

Maybe triggered by a bad installation.

@psampathkumar
Copy link
Contributor Author

No, I ran a git bisect,
a856ad3 is the first bad commit.

@psampathkumar psampathkumar added server This issue requires changes to the server and removed Untriaged This issue or PR needs triaging labels Aug 4, 2022
@psampathkumar psampathkumar added this to the v3.0-beta.4 milestone Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server This issue requires changes to the server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants