[cfe-dev] BuiltinType 'unsigned int' causing ASTContext::getTypeInfo to segfault

Gabor Kozar kozargabor at gmail.com
Mon Oct 21 03:58:00 PDT 2013


Hi,



We're using Clang 3.3.

In a Static Analyzer checker, I'm trying to determine the size of a
Type. I use ASTContext::getTypeSize on it, which works fine... usually.
However, on a certain Suse Linux 11 environment, attempting to do so
causes a segmentation fault inside Clang. Here is the relevant part of
the stack trace:



0  clang-3.3               0x000000000136b592
llvm::sys::PrintStackTrace(_IO_FILE*) + 34

1  clang-3.3               0x000000000136b219

2  libpthread.so.0         0x00007ff45b1e75d0

3  clang-3.3               0x0000000001e3bc4e
clang::ASTContext::getTypeInfo(clang::Type const*) const + 62



The Type passed to it dumps to 'unsigned int' identifier, and is
actually a TypedefType, wrapping a BuiltinType representing unsigned
int. In other environments, this causes no problem.



We have no root access on this system, and the gcc 4.3 is preinstalled
- we have, however, created a fakeroot with gcc 4.7.1 and other
goodies. Unfortunately, we are unable to prevent Clang (and even gcc
4.7.1) from having gcc 4.3's headers in the include path. I do not know
if this is relevant, though - after all, builtin types shouldn't really
be affected by system headers, should they?



So any idea what's going on?



Thanks!



--
Gábor Kozár -- ShdNx
kozargabor at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131021/5470cc71/attachment.html>


More information about the cfe-dev mailing list