[llvm-bugs] [Bug 30510] New: clang-4.0: tools/clang/lib/Basic/SourceManager.cpp:1411: clang::SrcMgr::CharacteristicKind clang::SourceManager::getFileCharacteristic(clang::SourceLocation) const: Assertion `Loc.isValid() && "Can't get file characteristic of invalid loc!"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 23 23:28:22 PDT 2016


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

            Bug ID: 30510
           Summary: clang-4.0:
                    tools/clang/lib/Basic/SourceManager.cpp:1411:
                    clang::SrcMgr::CharacteristicKind
                    clang::SourceManager::getFileCharacteristic(clang::Sou
                    rceLocation) const: Assertion `Loc.isValid() && "Can't
                    get file characteristic of invalid loc!"' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rink at rink.nu
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17341
  --> https://llvm.org/bugs/attachment.cgi?id=17341&action=edit
Source file

I've recently cleaned out some header files for my OS and I was hit by an
assertion failure as illustrated below. This is clang r278597 - it is quite
possible that this is my own doing, but it shouldn't assert. Here goes:

/home/rink/build/src/llvm-build/bin/clang -m64 -march=athlon64 -mcmodel=large
-I../../../../../include -I../../../.. -I. -std=c99 -mno-red-zone
-fno-stack-protector -DKERNEL -Wall -Werror -c -o acpi-smp.o
../../../../arch/x86/acpi-smp.c
clang-4.0:
/home/rink/build/src/llvm/tools/clang/lib/Basic/SourceManager.cpp:1411:
clang::SrcMgr::CharacteristicKind
clang::SourceManager::getFileCharacteristic(clang::SourceLocation) const:
Assertion `Loc.isValid() && "Can't get file characteristic of invalid loc!"'
failed.
#0 0x00000000012a3ed5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x12a3ed5)
#1 0x00000000012a1bce llvm::sys::RunSignalHandlers()
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x12a1bce)
#2 0x00000000012a1d32 SignalHandler(int)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x12a1d32)
#3 0x00007f3da74f3eb0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10eb0)
#4 0x00007f3da62b2198 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x33198)
#5 0x00007f3da62b361a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3461a)
#6 0x00007f3da62ab0d7 (/lib/x86_64-linux-gnu/libc.so.6+0x2c0d7)
#7 0x00007f3da62ab182 (/lib/x86_64-linux-gnu/libc.so.6+0x2c182)
#8 0x00000000013ebd38
clang::SourceManager::getFileCharacteristic(clang::SourceLocation) const
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x13ebd38)
#9 0x0000000001fee782 clang::Sema::MergeTypedefNameDecl(clang::Scope*,
clang::TypedefNameDecl*, clang::LookupResult&)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1fee782)
#10 0x0000000001fee898 clang::Sema::ActOnTypedefNameDecl(clang::Scope*,
clang::DeclContext*, clang::TypedefNameDecl*, clang::LookupResult&, bool&)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1fee898)
#11 0x0000000001feee55 clang::Sema::ActOnTypedefDeclarator(clang::Scope*,
clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*,
clang::LookupResult&)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1feee55)
#12 0x000000000200f3e8 clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x200f3e8)
#13 0x000000000200f99a clang::Sema::ActOnDeclarator(clang::Scope*,
clang::Declarator&) (/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x200f99a)
#14 0x0000000001d737fd
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1d737fd)
#15 0x0000000001d80eca clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1d80eca)
#16 0x0000000001d83c24 clang::Parser::ParseSimpleDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool,
clang::Parser::ForRangeInit*)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1d83c24)
#17 0x0000000001d83f16 clang::Parser::ParseDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1d83f16)
#18 0x0000000001d64e71
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1d64e71)
#19 0x0000000001d65789
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1d65789)
#20 0x0000000001d5ad7b clang::ParseAST(clang::Sema&, bool, bool)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1d5ad7b)
#21 0x0000000001a11f37 clang::CodeGenAction::ExecuteAction()
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1a11f37)
#22 0x0000000001736a36 clang::FrontendAction::Execute()
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x1736a36)
#23 0x000000000170a726
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x170a726)
#24 0x00000000017bc975
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x17bc975)
#25 0x000000000086ada8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x86ada8)
#26 0x0000000000834780 main
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x834780)
#27 0x00007f3da629f700 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20700)
#28 0x00000000008676c9 _start
(/extra0/rink/build/src/llvm-build/bin/clang-4.0+0x8676c9)
Stack dump:
0.    Program arguments: /extra0/rink/build/src/llvm-build/bin/clang-4.0 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name acpi-smp.c -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -mcode-model large -target-cpu athlon64
-disable-red-zone -dwarf-column-info -debugger-tuning=gdb -coverage-file
/extra0/rink/github/ananas/kernel/arch/amd64/compile/TEST/acpi-smp.o
-resource-dir /extra0/rink/build/src/llvm-build/bin/../lib/clang/4.0.0 -I
../../../../../include -I ../../../.. -I . -D KERNEL -internal-isystem
/usr/local/include -internal-isystem
/extra0/rink/build/src/llvm-build/bin/../lib/clang/4.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -Wall
-Werror -std=c99 -fdebug-compilation-dir
/extra0/rink/github/ananas/kernel/arch/amd64/compile/TEST -ferror-limit 19
-fmessage-length 282 -fobjc-runtime=gcc -fdiagnostics-show-option -o acpi-smp.o
-x c ../../../../arch/x86/acpi-smp.c 
1.   
/extra0/rink/build/src/llvm-build/bin/../lib/clang/4.0.0/include/stdarg.h:30:34:
current parser token ';'
clang-4.0: error: unable to execute command: Aborted
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (trunk 278597)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/rink/build/src/llvm-build/bin
clang-4.0: 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-4.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-4.0: note: diagnostic msg: /tmp/acpi-smp-85d522.c
clang-4.0: note: diagnostic msg: /tmp/acpi-smp-85d522.sh

-- 
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/20160924/9181407d/attachment-0001.html>


More information about the llvm-bugs mailing list