clang crashing with -g

hi

I got clang often crashing on this:

#0 0x0896de5c in llvm::isa_impl<clang::TagType, clang::Type> (Val=@0x9234f90) at Casting.h:54
54 return To::classof(&Val);
(gdb) p Val
$1 = (const clang::Type &) @0x9234f90: {_vptr$Type = 0x8fdd9d8, CanonicalType = {ThePtr = 153309072}, TC = 12}

the code in question is:

te <typename To, typename From>
inline bool isa_impl(const From &Val) {
     return To::classof(&Val);
}

where clang::TagType::classof is

  static bool classof(const Type *T) { return T->getTypeClass() == Tagged; }

and for clang::Type the getTypeClass method is:

  TypeClass getTypeClass() const { return static_cast<TypeClass>(TC); }

I also dont see any place where it can crash :frowning:

also, there is a strange thing that gdb shows me that Val is clang::Type which has TC == 5
but:

(gdb) p Val->TC
$2 = 12

I also would like to add that removing "-g" from clang's options makes this crash go away

can you help me?

thnx!

roman

hi
#0 0x0896de5c in llvm::isa_impl<clang::TagType, clang::Type> (Val=@0x9234f90) at Casting.h:54

This is deep in the middle of some extremely complicated template
instantiations; it's impossible to say anything without a stack trace.

I also would like to add that removing "-g" from clang's options makes this crash go away

This means it's probably a bug in codegen for debug info; it's still
experimental, so expect issues. The line information is pretty
reliable, but generating type information isn't; I think I have a hack
in my tree that adds an early return to type info generation so I can
use -g for the line number info.

-Eli

Hi Roman,

I’d like to help with this but as Eli says I need some more information. Could we get a stack trace and a -E processed input file (preferably in a bugzilla)?

Thanks,

  • Daniel

http://llvm.org/bugs/show_bug.cgi?id=2950