[llvm-bugs] [Bug 40695] New: Random ICE in clang::SourceManager::getFileIDLocal

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 11 10:35:41 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40695

            Bug ID: 40695
           Summary: Random ICE in clang::SourceManager::getFileIDLocal
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: teppo at runbox.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 21470
  --> https://bugs.llvm.org/attachment.cgi?id=21470&action=edit
More stacktraces, plus source file & runscript. gzipped, to squeeze them below
file size limit.

I get random crashes while trying to build the trunk source code of Widelands (
http://wl.widelands.org/ ) using Debian Buster and clang 7.0.1.

The common denominator seems to be that execution always goes through
clang::SourceManager::getFileIDLocal during a crash.

== example stacktrace starts ==
Stack dump:
0.      Program arguments: /usr/lib/llvm-7/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name playersmanager.cc -mrelocation-model
static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -coverage-notes-file
/home/kiska/wldev/alt/widelands-repo/trunk/build/src/logic/CMakeFiles/logic.dir/playersmanager.cc.gcno
-resource-dir /usr/lib/llvm-7/lib/clang/7.0.1 -dependency-file
src/logic/CMakeFiles/logic.dir/playersmanager.cc.o.d -sys-header-deps -MT
src/logic/CMakeFiles/logic.dir/playersmanager.cc.o -isystem /usr/include/SDL2
-isystem /usr/include/GL -D WL_USE_GLVND -I ../src -I src -D DEBUG
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward
-internal-isystem /usr/include/clang/7.0.1/include/ -internal-isystem
/usr/local/include -internal-isystem /usr/lib/llvm-7/lib/clang/7.0.1/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-conversion
-Wno-exit-time-destructors -Wno-global-constructors -Wno-padded
-Wno-sign-conversion -Wno-missing-noreturn -Wno-switch-enum -Wno-weak-vtables
-Wno-unreachable-code -Wno-documentation -Werror=deprecated
-Werror=non-pod-varargs -Wint-to-void-pointer-cast
-Winconsistent-missing-override -Werror=format-security -Werror=return-type
-Werror=shadow -Werror=uninitialized -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/kiska/wldev/alt/widelands-repo/trunk/build
-ferror-limit 19 -fmessage-length 0 -fsanitize=address
-fsanitize-blacklist=/usr/lib/llvm-7/lib/clang/7.0.1/share/asan_blacklist.txt
-fsanitize-address-use-after-scope -fno-assume-sane-operator-new
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o
src/logic/CMakeFiles/logic.dir/playersmanager.cc.o -x c++
../src/logic/playersmanager.cc -faddrsig 
1.      /usr/include/x86_64-linux-gnu/bits/mathcalls.h:332:1
<Spelling=/usr/include/math.h:283:3>: current parser token 'extern'
#0 0x00007fd0fc130c2f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x9cec2f)
#1 0x00007fd0fc12f160 llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x9cd160)
#2 0x00007fd0fc130f42 (/usr/lib/x86_64-linux-gnu/libLLVM-7.so.1+0x9cef42)
#3 0x00007fd0ff189670 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12670)
#4 0x00000000006bf101 clang::SourceManager::getFileIDLocal(unsigned int) const
(/usr/lib/llvm-7/bin/clang+0x6bf101)
#5 0x00000000006b36a3 (/usr/lib/llvm-7/bin/clang+0x6b36a3)
#6 0x00000000006b3a6c
clang::DiagnosticsEngine::DiagStateMap::lookup(clang::SourceManager&,
clang::SourceLocation) const (/usr/lib/llvm-7/bin/clang+0x6b3a6c)
#7 0x00000000006b99d7 clang::DiagnosticIDs::getDiagnosticSeverity(unsigned int,
clang::SourceLocation, clang::DiagnosticsEngine const&) const
(/usr/lib/llvm-7/bin/clang+0x6b99d7)
#8 0x00000000013b5f6a
clang::Sema::ActOnDocumentableDecls(llvm::ArrayRef<clang::Decl*>)
(/usr/lib/llvm-7/bin/clang+0x13b5f6a)
#9 0x00000000013b5c50
clang::Sema::BuildDeclaratorGroup(llvm::MutableArrayRef<clang::Decl*>)
(/usr/lib/llvm-7/bin/clang+0x13b5c50)
#10 0x00000000013b592e clang::Sema::FinalizeDeclaratorGroup(clang::Scope*,
clang::DeclSpec const&, llvm::ArrayRef<clang::Decl*>)
(/usr/lib/llvm-7/bin/clang+0x13b592e)
#11 0x00000000010d24dd clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/usr/lib/llvm-7/bin/clang+0x10d24dd)
#12 0x00000000010baf4a
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/lib/llvm-7/bin/clang+0x10baf4a)
#13 0x00000000010ba938
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/lib/llvm-7/bin/clang+0x10ba938)
#14 0x00000000010b989c
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/lib/llvm-7/bin/clang+0x10b989c)
#15 0x00000000010e43aa clang::Parser::ParseLinkage(clang::ParsingDeclSpec&,
clang::DeclaratorContext) (/usr/lib/llvm-7/bin/clang+0x10e43aa)
#16 0x00000000010baf8c
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/lib/llvm-7/bin/clang+0x10baf8c)
#17 0x00000000010ba938
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/lib/llvm-7/bin/clang+0x10ba938)
#18 0x00000000010b989c
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/lib/llvm-7/bin/clang+0x10b989c)
#19 0x00000000010b866e
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/lib/llvm-7/bin/clang+0x10b866e)
#20 0x00000000010b4187 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/llvm-7/bin/clang+0x10b4187)
#21 0x0000000000acdf0f clang::FrontendAction::Execute()
(/usr/lib/llvm-7/bin/clang+0xacdf0f)
#22 0x0000000000a8f238
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/llvm-7/bin/clang+0xa8f238)
#23 0x0000000000b5c426
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/llvm-7/bin/clang+0xb5c426)
#24 0x00000000006aa011 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-7/bin/clang+0x6aa011)
#25 0x00000000006a84a7 main (/usr/lib/llvm-7/bin/clang+0x6a84a7)
#26 0x00007fd0fb2a509b __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2409b)
#27 0x00000000006a5aca _start (/usr/lib/llvm-7/bin/clang+0x6a5aca)
clang: error: unable to execute command: Illegal instruction
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.1-4 (tags/RELEASE_701/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ 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/playersmanager-dd3225.cpp
clang: note: diagnostic msg: /tmp/playersmanager-dd3225.sh
clang: note: diagnostic msg: 

********************
ninja: build stopped: subcommand failed.

== example ends here ==

More similar stacktraces (and the files from /tmp/) attached.

Unsure if this is a clang bug, but reporting anyway after seeing the request to
do so multiple times. I know that clang can be and regularly is used to build
Widelands => something in my system provokes this, or not a clang bug at all.

-- 
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/20190211/c7779441/attachment-0001.html>


More information about the llvm-bugs mailing list