ChokkaUoM / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

A number of ASan tests fail in UAR mode #358

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Do we support running ASan lit tests with 
ASAN_OPTIONS=detect_stack_use_after_return=1 ?
It seems like they worked at some point in the past, because this mode is 
exercised on the bootstrap bot. The bot was down for a long time, and now we've 
got the following failures:

    AddressSanitizer32 :: TestCases/contiguous_container.cc
    AddressSanitizer32 :: TestCases/longjmp.cc
    AddressSanitizer32 :: TestCases/stack-overflow.cc
    AddressSanitizer32 :: TestCases/throw_catch.cc
    AddressSanitizer64 :: TestCases/contiguous_container.cc
    AddressSanitizer64 :: TestCases/longjmp.cc
    AddressSanitizer64 :: TestCases/stack-overflow.cc
    AddressSanitizer64 :: TestCases/throw_catch.cc

stack-overflow is quite obvious - it expects that the stack grows down.

The rest seem to be related to the way setjmp + longjmp clears stack shadow - 
it seems to be less aggressive in UAR mode.

I'll disable UAR testing on the bot for now.

******************** TEST 'AddressSanitizer64 :: TestCases/throw_catch.cc' 
FAILED ********************
Script:
--
/code/llvm/build-asan2/./bin/clang --driver-mode=g++ -fsanitize=address 
-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer 
-fno-optimize-sibling-calls -gline-tables-only -m64 -O 
/code/llvm/projects/compiler-rt/test/asan/TestCases/throw_catch.cc -o 
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/throw_catch.cc.tmp &&  
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/throw_catch.cc.tmp
--
Exit Code: 134

Command Output (stderr):
--
Before: 0x7f8d23c00020 poisoned: 1
Throw:  0x7f8d23b00020
Catch
After:  0x7f8d23c00020 poisoned: 1
throw_catch.cc.tmp: 
/code/llvm/projects/compiler-rt/test/asan/TestCases/throw_catch.cc:54: void 
TestThrowInline(): Assertion `!__asan_address_is_poisoned(x + 32)' failed.
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/throw_catch.cc.script: line 1: 32528 Aborted                 (core dumped) 
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/throw_catch.cc.tmp

******************** TEST 'AddressSanitizer64 :: TestCases/longjmp.cc' FAILED 
********************
Script:
--
/code/llvm/build-asan2/./bin/clang --driver-mode=g++ -fsanitize=address 
-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer 
-fno-optimize-sibling-calls -gline-tables-only -m64 -O 
/code/llvm/projects/compiler-rt/test/asan/TestCases/longjmp.cc -o 
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/longjmp.cc.tmp &&  
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/longjmp.cc.tmp
--
Exit Code: 134

Command Output (stderr):
--

TestLongJmp
Before: 0x7fa542900020 poisoned: 1
After:  0x7fa542900020 poisoned: 1
longjmp.cc.tmp: 
/code/llvm/projects/compiler-rt/test/asan/TestCases/longjmp.cc:22: int main(): 
Assertion `!__asan_address_is_poisoned(x + 32)' failed.
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/longjmp.cc.script: line 1: 30303 Aborted                 (core dumped) 
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/longjmp.cc.tmp

******************** TEST 'AddressSanitizer64 :: 
TestCases/contiguous_container.cc' FAILED ********************
Script:
--
/code/llvm/build-asan2/./bin/clang --driver-mode=g++ -fsanitize=address 
-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer 
-fno-optimize-sibling-calls -gline-tables-only -m64 -O 
/code/llvm/projects/compiler-rt/test/asan/TestCases/contiguous_container.cc -o 
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/contiguous_container.cc.tmp &&  
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/contiguous_container.cc.tmp
--
Exit Code: 134

Command Output (stderr):
--
contiguous_container.cc.tmp: 
/code/llvm/projects/compiler-rt/test/asan/TestCases/contiguous_container.cc:62: 
void TestThrow(): Assertion `!__asan_address_is_poisoned(x + 14)' failed.
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/contiguous_container.cc.script: line 1: 27664 Aborted                 (core 
dumped) 
/code/llvm/build-asan2/projects/compiler-rt/test/asan/64bitConfig/TestCases/Outp
ut/contiguous_container.cc.tmp

Original issue reported on code.google.com by euge...@google.com on 27 Nov 2014 at 11:51

GoogleCodeExporter commented 9 years ago
I don't think any of these 4 tests ever worked with UAR.

Original comment by konstant...@gmail.com on 2 Dec 2014 at 11:20

GoogleCodeExporter commented 9 years ago
http://llvm.org/viewvc/llvm-project?view=revision&revision=223181 fixes the 
tests. 

Could you please now update the bots so that check-asan is run in two mode: 
with and w/o UAR? 

Original comment by konstant...@gmail.com on 3 Dec 2014 at 12:10

GoogleCodeExporter commented 9 years ago
http://llvm.org/viewvc/llvm-project?view=revision&revision=223223

Original comment by euge...@google.com on 3 Dec 2014 at 10:25

GoogleCodeExporter commented 9 years ago
One remaining failure in LSan tests: stale_stack_leak.cc
Patched it over with 
http://llvm.org/viewvc/llvm-project?view=revision&revision=223230
Sergey, please verify the fix and close the bug if it's OK.

Original comment by euge...@google.com on 3 Dec 2014 at 1:38

GoogleCodeExporter commented 9 years ago
The actual failure:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/5236/s
teps/check-all%20stage3%2Fasan-uar/logs/stdio

Original comment by euge...@google.com on 3 Dec 2014 at 1:38

GoogleCodeExporter commented 9 years ago
lgtm

Original comment by earth...@google.com on 3 Dec 2014 at 4:29

GoogleCodeExporter commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Original comment by ramosian.glider@gmail.com on 30 Jul 2015 at 9:14