<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - AddressSanitizerFunctionPass assertion due to lifetime intrinsic"
   href="http://llvm.org/bugs/show_bug.cgi?id=17867">17867</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>AddressSanitizerFunctionPass assertion due to lifetime intrinsic
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Transformation Utilities
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nicholas@mxc.ca
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>echo 'int main() { unsigned char c = 0; return 0; }' |
llvm-commit/Debug+Asserts/bin/clang -x c - -fsanitize=address,use-after-scope

Produces this crash:

clang: AddressSanitizer.cpp:1476: void
{anonymous}::FunctionStackPoisoner::poisonStack(): Assertion `AI' failed.

By the way, I can't seem to reproduce this with just a .bc file and opt, even
with all the hidden flags. Please make sure that this is possible.

0x00007ffff69ec1e5 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff69ec1e5 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff69ef398 in __GI_abort () at abort.c:90
#2  0x00007ffff69e5272 in __assert_fail_base (
    fmt=0x7ffff6b22900 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x3ad4c04 "AI", 
    file=file@entry=0x3ad45ca "AddressSanitizer.cpp", line=line@entry=1476, 
    function=function@entry=0x3adb0a0 <(anonymous
namespace)::FunctionStackPoisoner::poisonStack()::__PRETTY_FUNCTION__> "void
{anonymous}::FunctionStackPoisoner::poisonStack()") at assert.c:92
#3  0x00007ffff69e5322 in __GI___assert_fail (assertion=0x3ad4c04 "AI", 
    file=0x3ad45ca "AddressSanitizer.cpp", line=1476, 
    function=0x3adb0a0 <(anonymous
namespace)::FunctionStackPoisoner::poisonStack()::__PRETTY_FUNCTION__> "void
{anonymous}::FunctionStackPoisoner::poisonStack()") at assert.c:101
#4  0x000000000212a6a1 in (anonymous
namespace)::FunctionStackPoisoner::poisonStack (this=0x7fffffffbf60) at
AddressSanitizer.cpp:1476
#5  0x0000000002124b92 in (anonymous
namespace)::FunctionStackPoisoner::runOnFunction (this=0x7fffffffbf60) at
AddressSanitizer.cpp:451
#6  0x0000000002129164 in (anonymous
namespace)::AddressSanitizer::runOnFunction (this=0x53055b0, F=...) at
AddressSanitizer.cpp:1243
#7  0x0000000003070aa2 in llvm::FPPassManager::runOnFunction (this=0x5305b80, 
    F=...) at PassManager.cpp:1530
(gdb) frame 4
#4  0x000000000212a6a1 in (anonymous
namespace)::FunctionStackPoisoner::poisonStack (this=0x7fffffffbf60) at
AddressSanitizer.cpp:1476
1476        assert(AI);
(gdb) p AllocaPoisonCallVec.size()
$3 = 2
(gdb) p i
$6 = 0
(gdb) p AllocaVec[i]
$7 = (llvm::AllocaInst *&) @0x7fffffffc158: 0x528a608
(gdb) p AllocaVec[i]->dump()
  %retval = alloca i32, align 4
$8 = void
(gdb) p APC
$9 = (const (anonymous namespace)::FunctionStackPoisoner::AllocaPoisonCall &)
@0x7fffffffc318: {
  InsBefore = 0x52e5608, 
  Size = 1, 
  DoPoison = false
}
(gdb) p ((llvm::Instruction*)APC.InsBefore)->dump()
  call void @llvm.lifetime.start(i64 1, i8* %c) #1
$11 = void</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>