[cfe-dev] Error during parsing

Eli Friedman eli.friedman at gmail.com
Fri Mar 25 11:58:47 PDT 2011


2011/3/25 Petr Šilhavík <silhape2 at fel.cvut.cz>:
> Dear Clang developers,
>
> I am developing a tool for visualizing state machines (library
> BOOST/Statechart) using LLVM and Clang release 2.8. I have no problem with
> compilation.
>
> But when I try to use the program it returns SIGSEGV during parsing one of
> the header files of stdlib (file c++locale.h).
>
> Stack dump:
>
> 0.    /usr/include/c++/4.4/i486-linux-gnu/bits/c++locale.h:85:5: current
> parser token '__builtin_va_start'
>
> 1.    /usr/include/c++/4.4/i486-linux-gnu/bits/c++locale.h:56:1
> <Spelling=/usr/include/c++/4.4/i486-linux-gnu/bits/c++config.h:114:38>:
> parsing namespace 'std'
>
> 2.    /usr/include/c++/4.4/i486-linux-gnu/bits/c++locale.h:69:3: parsing
> function body '__convert_from_v'
>
> 3.    /usr/include/c++/4.4/i486-linux-gnu/bits/c++locale.h:69:3: in
> compound statement ('{}')
>
> Segmentation fault (SIGSEGV)
>
>
> When I use debugger I found out that there is a problem with function:
> clang::ASTContext::getTypedefType. This function has as parameter NULL
> pointer. This should be the reason why it crashes. The backtrace output of
> debugger is:
>
> #0  0x00000000007593af in clang::ASTContext::getTypedefType
> (this=0x7fffffffc8b0, Decl=0x0, Canonical=...)
>     at /home/sojka/boost-statechart-viewer/clang/lib/AST/ASTContext.cpp:1806
> #1  0x00000000005916d5 in clang::Sema::InitBuiltinVaListType
> (this=0x7fffffffbd00) at
> /home/sojka/boost-statechart-viewer/clang/lib/Sema/SemaDecl.cpp:780

This looks like the definition of va_list is somehow broken.  Missing
a call to CompilerInvocation::getPreprocessorOpts()?

-Eli




More information about the cfe-dev mailing list