[llvm-bugs] [Bug 27264] New: Assertion failure Val && "isa<> used on a null pointer" linking with -flto -g3

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 7 09:30:28 PDT 2016


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

            Bug ID: 27264
           Summary: Assertion failure Val && "isa<> used on a null
                    pointer" linking with -flto -g3
           Product: new-bugs
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: malcolm.parsons at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

ld:
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/include/llvm/Support/Casting.h:95:
static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
llvm::DIFile; From = llvm::DIScope]: Assertion `Val && "isa<> used on a null
pointer"' failed.
<0x35e20dc0> = !DIGlobalVariable(name: "char_", linkageName:
"_ZN5boost6spirit8standardL5char_E", scope: <0x877e768>, file: <0x6f5ab60>,
line: 236, type: <0x877e828>, isLocal: true, isDefinition: true, variable:
%"struct.boost::spirit::terminal.171"* @_ZN5boost6spirit8standardL5char_E.4473)
clang-3.8: error: unable to execute command: Aborted (core dumped)
clang-3.8: error: linker command failed due to signal (use -v to see
invocation)


Program received signal SIGABRT, Aborted.
0x00007f9e5051ecc9 in __GI_raise (sig=sig at entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007f9e5051ecc9 in __GI_raise (sig=sig at entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007f9e505220d8 in __GI_abort () at abort.c:89
#2  0x00007f9e50517b86 in __assert_fail_base (fmt=0x7f9e50668830 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n", 
    assertion=assertion at entry=0x7f9e4ea30948 "Val && \"isa<> used on a null
pointer\"", 
    file=file at entry=0x7f9e4ea30578
"/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/include/llvm/Support/Casting.h",
line=line at entry=95, 
    function=function at entry=0x7f9e4ea31040 <llvm::isa_impl_cl<llvm::DIFile,
llvm::DIScope const*>::doit(llvm::DIScope const*)::__PRETTY_FUNCTION__> "static
bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
llvm::DIFile; From = llvm::DIScope]") at assert.c:92
#3  0x00007f9e50517c32 in __GI___assert_fail (assertion=0x7f9e4ea30948 "Val &&
\"isa<> used on a null pointer\"", 
    file=0x7f9e4ea30578
"/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/include/llvm/Support/Casting.h",
line=95, 
    function=0x7f9e4ea31040 <llvm::isa_impl_cl<llvm::DIFile, llvm::DIScope
const*>::doit(llvm::DIScope const*)::__PRETTY_FUNCTION__> "static bool
llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = llvm::DIFile;
>From = llvm::DIScope]") at assert.c:101
#4  0x00007f9e4cef8f6d in llvm::isa_impl_cl<llvm::DIFile, llvm::DIScope
const*>::doit (Val=0x0)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/include/llvm/Support/Casting.h:95
#5  0x00007f9e4cef8ed5 in llvm::isa_impl_wrap<llvm::DIFile, llvm::DIScope
const*, llvm::DIScope const*>::doit (Val=@0x7fff1dc50608: 0x0)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/include/llvm/Support/Casting.h:122
#6  0x00007f9e4cef8e42 in llvm::isa_impl_wrap<llvm::DIFile, llvm::DIScope
const* const, llvm::DIScope const*>::doit (
    Val=@0x7fff1dc50658: 0x0) at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/include/llvm/Support/Casting.h:114
#7  0x00007f9e4cef8d45 in llvm::isa<llvm::DIFile, llvm::DIScope const*>
(Val=@0x7fff1dc50658: 0x0)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/include/llvm/Support/Casting.h:134
#8  0x00007f9e4cef88e8 in llvm::DIScope::getRawFile (this=0x0)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/include/llvm/IR/DebugInfoMetadata.h:430
#9  0x00007f9e4cef88be in llvm::DIScope::getFile (this=0x0)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/include/llvm/IR/DebugInfoMetadata.h:415
#10 0x00007f9e4d1bd314 in llvm::DIScope::getDirectory (this=0x0)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/include/llvm/IR/DebugInfoMetadata.h:509
#11 0x00007f9e4d8af67c in llvm::DwarfCompileUnit::constructImportedEntityDIE
(this=0xc99a3f0, Module=0x35e2cd48)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:659
#12 0x00007f9e4d838910 in llvm::DwarfDebug::constructAndAddImportedEntityDIE
(this=0x31297ae0, TheCU=..., N=0x35e2cd48)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:456
#13 0x00007f9e4d838f17 in llvm::DwarfDebug::beginModule (this=0x31297ae0)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:500
#14 0x00007f9e4d836d53 in llvm::DwarfDebug::DwarfDebug (this=0x31297ae0,
A=0x3d5cc400, M=0x6a7a5e0)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:272
#15 0x00007f9e4d81a48f in llvm::AsmPrinter::doInitialization (this=0x3d5cc400,
M=...)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:256
#16 0x00007f9e4d3f53c2 in llvm::X86AsmPrinter::doInitialization
(this=0x3d5cc400, M=...)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/Target/X86/X86AsmPrinter.h:123
#17 0x00007f9e4e4e439c in llvm::FPPassManager::doInitialization
(this=0x253b2b50, M=...)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/IR/LegacyPassManager.cpp:1580
#18 0x00007f9e4e4e4528 in (anonymous namespace)::MPPassManager::runOnModule
(this=0x403df830, M=...)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/IR/LegacyPassManager.cpp:1612
#19 0x00007f9e4e4e4d27 in llvm::legacy::PassManagerImpl::run (this=0x3cdb17b0,
M=...)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/IR/LegacyPassManager.cpp:1730
#20 0x00007f9e4e4e4f33 in llvm::legacy::PassManager::run (this=0x7fff1dc510a0,
M=...)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/IR/LegacyPassManager.cpp:1761
#21 0x00007f9e4dbe583a in codegen (M=0x6a7a5e0, OS=...,
TheTarget=0x7f9e50344ce0 <llvm::TheX86_64Target>, CPU=..., Features=..., 
    Options=..., RM=llvm::Reloc::Static, CM=llvm::CodeModel::Default,
OL=llvm::CodeGenOpt::Aggressive, 
    FileType=llvm::TargetMachine::CGFT_ObjectFile) at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/CodeGen/ParallelCG.cpp:39
#22 0x00007f9e4dbe5e72 in llvm::splitCodeGen (M=std::unique_ptr<llvm::Module>
containing 0x6a7a5e0, OSs=..., CPU=..., Features=..., 
    Options=..., RM=llvm::Reloc::Static, CM=llvm::CodeModel::Default,
OL=llvm::CodeGenOpt::Aggressive, 
    FileType=llvm::TargetMachine::CGFT_ObjectFile) at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/CodeGen/ParallelCG.cpp:56
#23 0x00007f9e4c979132 in codegen (M=std::unique_ptr<llvm::Module> containing
0x0)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/tools/gold/gold-plugin.cpp:840
#24 0x00007f9e4c979cad in allSymbolsReadHook (ApiFile=0x0)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/tools/gold/gold-plugin.cpp:943
#25 0x00007f9e4c979da2 in all_symbols_read_hook () at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/tools/gold/gold-plugin.cpp:955
#26 0x00000000005ef55f in all_symbols_read (this=<optimised out>) at
../../gcc-5.3.0/gold/plugin.cc:359
#27 gold::Plugin_manager::all_symbols_read (this=0x23c83a0,
workqueue=0x7fff1dc58410, task=<optimised out>, input_objects=<optimised out>, 
    symtab=<optimised out>, dirpath=<optimised out>, mapfile=0x0,
last_blocker=0x2584628) at ../../gcc-5.3.0/gold/plugin.cc:534
#28 0x00000000005ef694 in gold::Plugin_hook::run (this=0x25845e0,
workqueue=0x7fff1dc58410) at ../../gcc-5.3.0/gold/plugin.cc:1420
#29 0x000000000064282d in gold::Workqueue::find_and_run_task
(this=0x7fff1dc58410, thread_number=0) at ../../gcc-5.3.0/gold/workqueue.cc:319
#30 0x0000000000642b8a in gold::Workqueue::process (this=0x7fff1dc58410,
thread_number=0) at ../../gcc-5.3.0/gold/workqueue.cc:495
#31 0x0000000000413fa9 in main (argc=224, argv=0x7fff1dc58618) at
../../gcc-5.3.0/gold/main.cc:252




#11 0x00007f9e4d8af67c in llvm::DwarfCompileUnit::constructImportedEntityDIE
(this=0xc99a3f0, Module=0x35e2cd48)
    at
/home/mparsons/dev/toolchain/clang/llvm-3.8.0.src/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:659
659      addSourceLine(*IMDie, Module->getLine(),
Module->getScope()->getFilename(),
660                    Module->getScope()->getDirectory());

(gdb) p *Module
$1 = {
  <llvm::DINode> = {
    <llvm::MDNode> = {
      <llvm::Metadata> = {
        SubclassID = 22 '\026', 
        Storage = 0, 
        SubclassData16 = 8, 
        SubclassData32 = 0
      }, 
      members of llvm::MDNode: 
      NumOperands = 3, 
      NumUnresolved = 0, 
      Context = {
        Ptr = {
          Val = {
            Value = 140733692844800
          }
        }
      }
    }, <No data fields>}, 
  members of llvm::DIImportedEntity: 
  Line = 178
}

(gdb) p Module->getRawScope()
$2 = (llvm::Metadata *) 0x0

(gdb) p Module->getOperand(0)
$3 = (const llvm::MDOperand &) @0x35e2cd30: {
  MD = 0x0
}

(gdb) p Module->getOperand(1)
$4 = (const llvm::MDOperand &) @0x35e2cd38: {
  MD = 0x35e20dc0
}

(gdb) call Module->getOperand(1).MD->dump()
<0x35e20dc0> = !DIGlobalVariable(name: "char_", linkageName:
"_ZN5boost6spirit8standardL5char_E", scope: <0x877e768>, file: <0x6f5ab60>,
line: 236, type: <0x877e828>, isLocal: true, isDefinition: true, variable:
%"struct.boost::spirit::terminal.171"* @_ZN5boost6spirit8standardL5char_E.4473)

(gdb) p Module->getOperand(2)
$5 = (const llvm::MDOperand &) @0x35e2cd40: {
  MD = 0x0
}

(gdb) p Module->getName()
$6 = {
  Data = 0x0, 
  Length = 0
}

Boost was compiled by gcc 5.3.0 without -flto or -g.
The main program is compiled by Clang 3.8.0 with -flto -O3 -g3.

-- 
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/20160407/d1cdc942/attachment-0001.html>


More information about the llvm-bugs mailing list