New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang crashes on x86_64-linux-gnu at O1 and above in 32-bit and 64-bit modes (Assertion `Offset <= PieceOffset && "overlapping or duplicate pieces"' failed) #26522
Comments
*** This bug has been marked as a duplicate of bug llvm/llvm-bugzilla-archive#26163 *** |
Hi David, This bug was reported one day earlier than llvm/llvm-bugzilla-archive#26163 . May I know why this bug was resolved as a duplicate of that one? |
llvm/llvm-bugzilla-archive#26163 was already marked as fixed, I figured that marking #26522 as duplicate would generate less email than marking #26522 as fixed and llvm/llvm-bugzilla-archive#26163 as the duplicate. This would also be a little weird to anyone investigating the chronology of r257979 seeing as how it refers to llvm/llvm-bugzilla-archive#26163 , not #26522 . |
I encounter this bug again. As the test case is similar to what I have reported, so I just reopen this bug report. $: clang-trunk -v
clang-3.9: error: unable to execute command: Aborted (core dumped) PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: $: cat small.c int main() { return 0; } |
+Keno who looked at llvm/llvm-bugzilla-archive#26163 |
Thanks, I'll take a look tomorrow. |
Patch at http://reviews.llvm.org/D16742. |
Landed as r259696. Which reminds me that this probably needs to be put on the release branch if it hasn't already. |
mentioned in issue llvm/llvm-bugzilla-archive#26163 |
Extended Description
The following code crashes clang trunk at -O1 and above in both 32-bit and 64-bit modes.
$: clang-trunk -v
clang version 3.9.0 (trunk 257643)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.2.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.2.1
Found candidate GCC installation: /usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.3
Found candidate GCC installation: /usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.4
Found candidate GCC installation: /usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.2
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@MX32
Selected multilib: .;@m64
$:
$: clang-trunk -O1 -g small.c
clang: /tmp/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1561: void llvm::DebugLocEntry::finalize(const llvm::AsmPrinter &, DebugLocStream::ListBuilder &, const llvm::DIBasicType ): Assertion `Offset <= PieceOffset && "overlapping or duplicate pieces"' failed.
0 clang 0x0000000003095008 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 clang 0x0000000003095777
2 libpthread.so.0 0x00007f7473224340
3 libc.so.6 0x00007f747222ecc9 gsignal + 57
4 libc.so.6 0x00007f74722320d8 abort + 328
5 libc.so.6 0x00007f7472227b86
6 libc.so.6 0x00007f7472227c32
7 clang 0x000000000265c65a llvm::DebugLocEntry::finalize(llvm::AsmPrinter const&, llvm::DebugLocStream::ListBuilder&, llvm::DIBasicType const) + 906
8 clang 0x000000000265bde7 llvm::DwarfDebug::collectVariableInfo(llvm::DwarfCompileUnit&, llvm::DISubprogram const*, llvm::DenseSet<std::pair<llvm::DILocalVariable const*, llvm::DILocation const*>, llvm::DenseMapInfo<std::pair<llvm::DILocalVariable const*, llvm::DILocation const*> > >&) + 1063
9 clang 0x000000000265dd90 llvm::DwarfDebug::endFunction(llvm::MachineFunction const*) + 352
10 clang 0x000000000263e231 llvm::AsmPrinter::EmitFunctionBody() + 7025
11 clang 0x0000000002318b98
12 clang 0x000000000273e089 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 153
13 clang 0x0000000002fd90d4 llvm::FPPassManager::runOnFunction(llvm::Function&) + 564
14 clang 0x0000000002fd931b llvm::FPPassManager::runOnModule(llvm::Module&) + 43
15 clang 0x0000000002fd97e5 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 869
16 clang 0x0000000000a168dd clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*) + 9693
17 clang 0x00000000009f6f38
18 clang 0x0000000000cab776 clang::ParseAST(clang::Sema&, bool, bool) + 582
19 clang 0x0000000000789d35 clang::FrontendAction::Execute() + 69
20 clang 0x0000000000752d91 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1153
21 clang 0x00000000007318dc clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3068
22 clang 0x00000000007277a8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 1176
23 clang 0x000000000072ff93 main + 12707
24 libc.so.6 0x00007f7472219ec5 __libc_start_main + 245
25 clang 0x0000000000727234
Stack dump:
0. Program arguments: /usr/local/clang-trunk/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.24 -momit-leaf-frame-pointer -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -resource-dir /usr/local/clang-trunk/bin/../lib/clang/3.9.0 -internal-isystem /usr/local/include -internal-isystem /usr/local/clang-trunk/bin/../lib/clang/3.9.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O1 -fdebug-compilation-dir /data2/c-hunter-results/C/instrument-bugs/REDUCED/20160114-clang-trunk-m64-g-O3-build-051234/delta -ferror-limit 19 -fmessage-length 238 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/small-ee55a9.o -x c small.c
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.9.0 (trunk 257643)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
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: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/small-e5dff4.c
clang: note: diagnostic msg: /tmp/small-e5dff4.sh
clang: note: diagnostic msg:
$:
$: cat small.c
struct S0 {
int f0;
short f5;
} b;
static int a;
void fn1(char p1) {
struct S0 c = {3};
if (a)
b = c;
c.f0 = p1;
}
int main() { return 0; }
$:
The text was updated successfully, but these errors were encountered: