[cfe-dev] libclang crash when reparsing

Erik Verbruggen erik.verbruggen at me.com
Wed Aug 3 09:24:30 PDT 2011


Attached is a patch that fixes this problem. It was made against trunk revĀ 136769. Should I close bug#10511 myself when the patch is accepted, or how does that work?

-- Erik.

On 26 Jul, 2011,at 04:57 PM, Douglas Gregor <dgregor at apple.com> wrote:


On Jul 26, 2011, at 7:32 AM, Erik Verbruggen wrote:

> Hello,
> 
> I'm using libclang, and when using clang_reparseTranslationUnit method, I (nearly?) always get a crash:
> 
> Assertion failed: ((LatestDecl->getLocation().isInvalid() || NewLatest->getLocation().isInvalid() || !Reader.SourceMgr.isBeforeInTranslationUnit( NewLatest->getLocation(), LatestDecl->getLocation())) && "The new latest is supposed to come after the previous latest"), function VisitRedeclarableTemplateDecl, file /data/clang-llvm/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp, line 1094.
> libclang: crash detected during reparsing
> 
> When I turn off CXTranslationUnit_CXXPrecompiledPreamble, things work fine (although quite a bit slower).
> 
> Does anybody have an idea how I can debug this, or in which direction I should look?

That sounds like a serious bug in the AST reader or writer. Debugging these can be fairly tricky; in this case, watching how that particular declaration ends up getting deserialized. If you could file a bug with reduced source code detailing the problem (which can be tricky, when dealing with preambles), we'd greatly appreciate it.

- Doug

_______________________________________________
cfe-dev mailing list
cfe-dev at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110803/9b51016e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-the-type-of-the-IntegerLiteral-for-bitfield-pad.patch
Type: application/octet-stream
Size: 1648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110803/9b51016e/attachment.obj>


More information about the cfe-dev mailing list