Skip to content

clang.asan: unit tests fail #102

@mgondan

Description

@mgondan

to reproduce

cd swipl-devel
(change Ninja to "Unix\\ Makefiles" in scripts/configure script
mkdir build.clang.asan
cd build.clang.asan
../scripts/configure
make
ctest

The hello test with hello("世界", _Out) fails. I think it is the exception itself that fails:

% [3/256] cpp:hello ............................................................................................................. passed (0.001 sec)
% [4/256] cpp:hello ..AddressSanitizer: CHECK failed: asan_interceptors.cpp:463 "((__interception::real___cxa_throw)) != (0)" (0x0, 0x0) (tid=100242)
    #0 0x63ccdbb1efa5 in __asan::CheckUnwind() asan_rtl.cpp.o
    #1 0x63ccdbb39fe6 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/home/matthias/swipl-devel/build.clang.asan/src/swipl+0xf6fe6) (BuildId: 922187003c1a2d84768253af0e47d9750e11344f)
    #2 0x63ccdbaf7e64 in __cxa_throw (/home/matthias/swipl-devel/build.clang.asan/src/swipl+0xb4e64) (BuildId: 922187003c1a2d84768253af0e47d9750e11344f)
    #3 0x7f2ab8bb948f in PlEx_fail(__PL_queryRef*) /home/matthias/swipl-devel/packages/cpp/SWI-cpp2.cpp:100:5
    #4 0x7f2ab8bb8e85 in PlTerm::get_nchars[abi:cxx11](unsigned int) const /home/matthias/swipl-devel/packages/cpp/SWI-cpp2.cpp:120:3
    #5 0x7f2ab8b8aa08 in PlTerm::as_string[abi:cxx11](PlEncoding) const /home/matthias/swipl-devel/packages/cpp/SWI-cpp2.h:634:12
    #6 0x7f2ab8b8aa08 in pl_hello__2(PlTermv) /home/matthias/swipl-devel/packages/cpp/test_cpp.cpp:110:28
    #7 0x7f2ab8b8aa08 in _pl_hello__2(unsigned long, int, __PL_foreign_context*) /home/matthias/swipl-devel/packages/cpp/test_cpp.cpp:105:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions