[LLVMbugs] [Bug 19722] New: tools/clang/test/CXX/drs/dr4xx.cpp fails under asa in use-after-return mode

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 11 23:44:54 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19722

            Bug ID: 19722
           Summary: tools/clang/test/CXX/drs/dr4xx.cpp fails under asa in
                    use-after-return mode
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: richard-llvm at metafoo.co.uk
          Reporter: kcc at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following test fails on the asan bootstrap bot
(which uses ASAN_OPTIONS="detect_stack_use_after_return=1)

Exit Code: 1

Command Output (stderr):
--
error: 'note' diagnostics seen but not expected: 
  File
/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/test/CXX/drs/dr4xx.cpp
Line 39: in instantiation of default argument for 'A<dr401::D>' required here
1 error generated.

Richard Smith says: 
==================
The 'Converted' SmallVector of template arguments lives on the stack.
We choose whether to emit the note based on whether the template instantiation
context is equal to the previous one. 
That compares the (stack) addresses of the arrays of template arguments.

So we don't get the note in normal runs because the stack addresses happen to
be exactly the same, and we do get the note in any use-after-return run.
This is sort of a use-after-return bug, but it doesn't actually access the
stack memory, so ASan doesn't catch it.

This will incidentally be fixed by a patch I'm working on for a different
issue. 
==================

I am going to disable the faulty line in the test for now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140512/9f3ac7ec/attachment.html>


More information about the llvm-bugs mailing list