Boost logo

Boost :

Subject: [boost] UBSan question
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2019-01-16 01:00:35


Hi,

I am trying to correct for the errors reported by UBSAN in boost.test. A
lot of them were false positive, as ... in boost.test, we check the
capacity of the framework to catch various errors in the program.

I compile/run the tests with the following:

../../../b2 \
    --toolset=clang \
    cxxflags=-std=c++11 \
    cxxflags=-fno-omit-frame-pointer \
    cxxflags=-fsanitize=undefined \
    cxxflags=-fno-sanitize-recover=undefined \
    cxxflags=-fsanitize-recover=integer-divide-by-zero \
    cxxflags=-fsanitize-recover=float-divide-by-zero \
    linkflags=-fsanitize=undefined \
    linkflags=-fno-sanitize-recover=undefined \
    linkflags=-fsanitize-recover=integer-divide-by-zero \
    linkflags=-fsanitize-recover=float-divide-by-zero \
    linkflags=-fuse-ld=gold \
    variant=debug

I have an exception that is failing the tests on clang-6/ubuntu18.04
(UBSAN exiting the process), but not on gcc-8/ubuntu18.04 (full log below).

UndefinedBehaviorSanitizer:DEADLYSIGNAL
==8303==ERROR: UndefinedBehaviorSanitizer: FPE on unknown address

This FPE is happening for instance after reading from a null pointer.

I've searched on how to silence/blacklist this, but none of the
approaches worked so far, and I am not sure what is provoking this FPE.

Is there any UBsan specialist? Does anyone have an idea?

Thanks,
Raffi

clang-linux.compile.c++.without-pch
../../../bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/prg_exec_monitor-ts/system-exception-test.o
clang-linux.link
../../../bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test
testing.capture-output
../../../bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test.run
====== BEGIN OUTPUT ======
prg_exec_monitor-ts/system-exception-test.cpp:38:15: runtime error:
division by zero
    #0 0x42d03f
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x42d03f)
    #1 0x42f344
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x42f344)
    #2 0x42e8b1
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x42e8b1)
    #3 0x43dafa
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x43dafa)
    #4 0x43a6f2
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x43a6f2)
    #5 0x436d13
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x436d13)
    #6 0x43726f
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x43726f)
    #7 0x42d148
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x42d148)
    #8 0x42e216
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x42e216)
    #9 0x7f648e20fb96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #10 0x405859
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x405859)

UndefinedBehaviorSanitizer:DEADLYSIGNAL
==8303==ERROR: UndefinedBehaviorSanitizer: FPE on unknown address
0x00000042d049 (pc 0x00000042d049 bp 0x7ffe501ec660 sp 0x7ffe501ec630 T8303)
    #0 0x42d048
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x42d048)
    #1 0x42f344
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x42f344)
    #2 0x42e8b1
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x42e8b1)
    #3 0x43dafa
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x43dafa)
    #4 0x43a6f2
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x43a6f2)
    #5 0x436d13
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x436d13)
    #6 0x43726f
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x43726f)
    #7 0x42d148
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x42d148)
    #8 0x42e216
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x42e216)
    #9 0x7f648e20fb96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #10 0x405859
(/home/bambooagent/bamboo-agent-home/xml-data/build-dir/RS-BCB187-CLAN/library/bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test+0x405859)

UndefinedBehaviorSanitizer can not provide additional info.
==8303==ABORTING

EXIT STATUS: 1
====== END OUTPUT ======
(failed-as-expected)
../../../bin.v2/libs/test/test/system-exception-test.test/clang-linux-6.0.0/debug/threading-multi/visibility-hidden/system-exception-test.run


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk