Skip to content
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 at -O0 (and above) on x86_64-linux-gnu #19373

Closed
zhendongsu opened this issue Feb 28, 2014 · 1 comment
Closed

clang crashes at -O0 (and above) on x86_64-linux-gnu #19373

zhendongsu opened this issue Feb 28, 2014 · 1 comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category

Comments

@zhendongsu
Copy link

Bugzilla Link 18999
Resolution FIXED
Resolved on Feb 28, 2014 05:12
Version trunk
OS All
CC @d0k,@hfinkel

Extended Description

The current clang trunk crashes when compiling the following testcase at -O0 (and above) in both 32-bit and 64-bit modes on x86_64-linux-gnu.

This is a regression from clang 3.4.

$ clang-trunk -v
clang version 3.5 (trunk 202395)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.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.6
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.1
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
$
$ clang-3.4 -O0 -c small.c
$
$ clang-trunk -O0 -c small.c
0 clang 0x00000000023992f5 llvm::sys::PrintStackTrace(_IO_FILE*) + 37
1 clang 0x0000000002399ae3
2 libpthread.so.0 0x00007fcb78bcecb0
3 clang 0x0000000000e125f7 clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::sema::AnalysisBasedWarnings::Policy, clang::sema::FunctionScopeInfo*, clang::Decl const*, clang::BlockExpr const*) + 2903
4 clang 0x0000000000a91943 clang::Sema::PopFunctionScopeInfo(clang::sema::AnalysisBasedWarnings::Policy const*, clang::Decl const*, clang::BlockExpr const*) + 99
5 clang 0x0000000000b36e2e clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) + 3342
6 clang 0x0000000000a62f48 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 280
7 clang 0x00000000009f07dd clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) + 2093
8 clang 0x0000000000a0278d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1389
9 clang 0x00000000009efd59 clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 697
10 clang 0x00000000009ef7b3 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) + 403
11 clang 0x00000000009eeb67 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) + 2615
12 clang 0x00000000009ee05e clang::Parser::ParseTopLevelDecl(clang::OpaquePtrclang::DeclGroupRef&) + 446
13 clang 0x00000000009eaa00 clang::ParseAST(clang::Sema&, bool, bool) + 256
14 clang 0x000000000085a34e clang::CodeGenAction::ExecuteAction() + 142
15 clang 0x00000000006b0ea0 clang::FrontendAction::Execute() + 112
16 clang 0x000000000068be5d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 925
17 clang 0x000000000067273f clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2959
18 clang 0x0000000000669c5c cc1_main(char const**, char const**, char const*, void*) + 700
19 clang 0x00000000006707f8 main + 9864
20 libc.so.6 0x00007fcb779d776d __libc_start_main + 237
21 clang 0x00000000006698b9
Stack dump:
0. Program arguments: /usr/local/clang-trunk/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name small.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.22 -coverage-file /data2/c-hunter-results/C/trans-bugs/20140227-clang-m32-m64-O0-O1-O2-O3-Os-build-test152841/small.o -resource-dir /usr/local/clang-trunk/bin/../lib/clang/3.5 -internal-isystem /usr/local/include -internal-isystem /usr/local/clang-trunk/bin/../lib/clang/3.5/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -fdebug-compilation-dir /data2/c-hunter-results/C/trans-bugs/20140227-clang-m32-m64-O0-O1-O2-O3-Os-build-test152841 -ferror-limit 19 -fmessage-length 131 -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o small.o -x c small.c

  1. parser at end of file
  2. small.c:3:1: parsing function body 'foo'
    clang: error: unable to execute command: Segmentation fault (core dumped)
    clang: error: clang frontend command failed due to signal (use -v to see invocation)
    clang version 3.5 (trunk 202395)
    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: 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-75d5d5.c
clang: note: diagnostic msg: /tmp/small-75d5d5.sh
clang: note: diagnostic msg:


$


int
foo ()
{
lbl:
if (1)
goto lbl;
}

@d0k
Copy link
Member

d0k commented Feb 28, 2014

Fixed in r202491.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
EsmeYi added a commit that referenced this issue Feb 18, 2022
EsmeYi added a commit that referenced this issue Feb 21, 2022
…same address by symbol types.

Fix the Buildbot failure #19373.

Differential Revision: https://reviews.llvm.org/D117642
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

2 participants