Ark icon indicating copy to clipboard operation
Ark copied to clipboard

ASAN/UBSAN do not work with GCC

Open SuperFola opened this issue 1 year ago • 1 comments

What happened?

In the CI, ASAN and UBSAN had to be disabled for GCC builds because it doesn't work (ODR violation with shared_ptr).

What ArkScript version are you seeing the problem on?

dev

Relevant code & log output

Relevant commit disabling ASAN/UBSAN on GCC: https://github.com/ArkScript-lang/Ark/commit/36a86a4ebc8892bf1e0843164bf294fc9c192bc1#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR55-R68

GCC logs (runtime)
  export ASAN_OPTIONS=use_odr_indicator=1
  bash .github/launch-tests
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    BUILD_TYPE: Debug
    SQLITE_VERSION: 3390100
=================================================================
==3205==ERROR: AddressSanitizer: odr-violation (0x56285b1a71a0):
  [1] size=16 '__tag' /usr/include/c++/10/bits/shared_ptr_base.h:513:48
  [2] size=16 '__tag' /usr/include/c++/10/bits/shared_ptr_base.h:513:48
These globals were registered at these points:
  [1]:
    #0 0x7f07550f1938 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
    #1 0x56285b16aae5 in _sub_I_00099_1.27591 (/home/runner/work/Ark/Ark/build/arkscript+0x518ae5)
    #2 0x56285b1a66bc in __libc_csu_init (/home/runner/work/Ark/Ark/build/arkscript+0x5546bc)
  [2]:
    #0 0x7f07550f1938 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
    #1 0x7f0754bc18bd in _sub_I_00099_1.32184 (/home/runner/work/Ark/Ark/build/libArkReactor.so+0x60c8bd)
    #2 0x7f0755ab7b99  (/lib64/ld-linux-x86-64.so.2+0x11b99)
==3205==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global '__tag' at /usr/include/c++/10/bits/shared_ptr_base.h:513:48
==3205==ABORTING
Error: Process completed with exit code 1.

Documentation

  • [X] I have read existing related documentation before submitting this report
  • [X] I have searched for an existing issue before posting

SuperFola avatar Jul 17 '22 18:07 SuperFola