[LLVMbugs] [Bug 19515] New: Crash in SmallVector.h from driver while reporting another crash

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 22 16:38:33 PDT 2014


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

            Bug ID: 19515
           Summary: Crash in SmallVector.h from driver while reporting
                    another crash
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: douglas_yung at playstation.sony.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

While running clang, I am hitting an assertion failure in the compiler driver
while it is trying to report another crash in the front-end.

Clang information:
-    Host: AMD64
-    Target: AMD64
-    Host OS: Linux (Ubuntu 13.10)
-    SVN Revision: 204763 (This failure has also been observed in revision
206712)

The assert that failed is the following:

clang: /home/snc/llvm/llvm/include/llvm/ADT/SmallVector.h:145: const T&
llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2>
>::operator[](unsigned int) const [with T = const char*;
<template-parameter-1-2> = void; llvm::SmallVectorTemplateCommon<T,
<template-parameter-1-2> >::const_reference = const char* const&]: Assertion
`begin() + idx < end()' failed.

To reproduce this failure, compile the code from PR19514 (reproduced here for
convenience) with the command line “clang –c repro.cpp –lstdc++”.

struct A { };
struct D { int fld4; };
struct B: virtual D, A { };
struct C: B, A { void vf1 (); };
void C::vf1 () { }

Note that this will produce two assertion failures in the compiler, the first
is in the front-end and is filed as PR19514, and the second is in the driver
which is the subject of this bug.

The crash in the driver produces the following output:

…
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0 (trunk 204763)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: /home/snc/llvm/llvm/include/llvm/ADT/SmallVector.h:145: const T&
llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2>
>::operator[](unsigned int) const [with T = const char*;
<template-parameter-1-2> = void; llvm::SmallVec
torTemplateCommon<T, <template-parameter-1-2> >::const_reference = const char*
const&]: Assertion `begin() + idx < end()' failed.
0  clang           0x00000000036cd47a llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  clang           0x00000000036cd6f7
2  clang           0x00000000036cd0ab
3  libpthread.so.0 0x00007fb1e2ac6bb0
4  libc.so.6       0x00007fb1e1d03f77 gsignal + 55
5  libc.so.6       0x00007fb1e1d075e8 abort + 328
6  libc.so.6       0x00007fb1e1cfcd43
7  libc.so.6       0x00007fb1e1cfcdf2
8  clang           0x0000000000e857b1
9  clang           0x0000000000e82574
10 clang           0x0000000000fcd24b
clang::driver::Driver::generateCompilationDiagnostics(clang::driver::Compilation&,
clang::driver::Command const*) + 825
11 clang           0x0000000000e8c70b main + 3672
12 libc.so.6       0x00007fb1e1ceede5 __libc_start_main + 245
13 clang           0x0000000000e7e189
Stack dump:
0.      Program arguments: /home/snc/llvm/build/Debug+Asserts/bin/clang -c
repro.cpp -lstdc++

As an aside, removing the “-lstdc++” seems to prevent this second assert from
happening.

-- 
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/20140422/7270c223/attachment.html>


More information about the llvm-bugs mailing list