[LLVMdev] bytecode reader assertion failure

Ryan M. Lefever lefever at crhc.uiuc.edu
Fri Feb 23 14:53:07 PST 2007

I am still diagnosing the cause of the assertion failure and will submit 
a bug when I better understand the problem.

Reid Spencer wrote:
> Ryan,
> This looks like a bug. Could you file it, please?
> Reid.
> On Thu, 2007-02-22 at 19:47 -0600, Ryan M. Lefever wrote:
>>I have a compiler transform that I have been working on that produces 
>>bytecode that passes the verifier.  However, when I try to read that 
>>bytecode back in, I get the assertion failure below.
>>llvm::BytecodeReader::ParseConstantPoolValue(unsigned int):
>>Assertion `(!isa<Constant>(Result) || 
>>!cast<Constant>(Result)->isNullValue()) || !hasImplicitNull(TypeID) && 
>>"Cannot read null values from bytecode!"' failed.
>>So, I ran gdb on opt.  I was able to get the following information from opt:
>>(gdb) print Result
>>$7 = (class llvm::Constant *) 0x96ad9d0
>>(gdb) call Result->dump()
>>  [41 x sbyte *] zeroinitializer
>>(gdb) print hasImplicitNull(TypeID)
>>$5 = true
>>Does anyone have any insight into what the problem is or how to go about 
>>  fixing it?  It seems diffcult to get context for what is going on, 
>>since the bytecode has not yet been fully read.  Any help would be 
>>greatly appreciated!
>>The full output of the assertion failure is given below:
>>opt -simplifycfg -deadargelim -globaldce -verify -f -o /dev/null tmp.bc
>>opt: Reader.cpp:1978: llvm::Value* 
>>llvm::BytecodeReader::ParseConstantPoolValue(unsigned int): Assertion 
>>`(!isa<Constant>(Result) || !cast<Constant>(Result)->isNullValue()) || 
>>!hasImplicitNull(TypeID) && "Cannot read null values from bytecode!"' 
>>opt((anonymous namespace)::PrintStackTrace()+0x1a)[0x8645bae]
>>opt((anonymous namespace)::SignalHandler(int)+0x112)[0x8645e74]
>>std::allocator<llvm::BytecodeReader::ValueList*> >&, 
>>std::vector<llvm::PATypeHolder, std::allocator<llvm::PATypeHolder> >&, 
>>opt(llvm::BytecodeReader::ParseBytecode(unsigned char const*, unsigned 
>>int, std::basic_string<char, std::char_traits<char>, 
>>std::allocator<char> > const&, std::basic_string<char, 
>>std::char_traits<char>, std::allocator<char> >*)+0x539)[0x856f6c1]
>>std::char_traits<char>, std::allocator<char> >*)+0xeb)[0x855b569]
>>std::char_traits<char>, std::allocator<char> > const&, 
>>std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, 
>>std::char_traits<char>, std::allocator<char> > const&, 
>>std::basic_string<char, std::char_traits<char>, std::allocator<char> 
>> >*)+0x20)[0x855b88e]
>>LLVM Developers mailing list
>>LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Ryan M. Lefever  [http://www.ews.uiuc.edu/~lefever]

More information about the llvm-dev mailing list