<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Actually, I think that was enough :)  I think there was already a bug here, wherein after some error in ASTUnit we might try to load data from the CI that was not created yet.  Then in the below commit I added a new way to hit that bug.   Hopefully fixed in r206644.<div><div><br></div><div>Ben<br><div><br></div><div><br><div><div>On Apr 18, 2014, at 11:56 AM, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 18, 2014 at 9:48 AM, Ben Langmuir <span dir="ltr"><<a href="mailto:blangmuir@apple.com" target="_blank">blangmuir@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div class=""><div>
On Apr 17, 2014, at 6:40 PM, Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">Hi Ben, test/Index/pch-with-errors.c has been hitting an assertion "compiler instance has no astcontext!" since this commit.  The test doesn't actually fail due to the 'not' prefix on the clang command.  Any thoughts on how to fix this?</div>
</blockquote><div><br></div></div><div>Not off hand, I looked through my patch again and there is nothing obvious to me that would try to use the ASTContext before it is created.  I can’t reproduce this failure on my machine.  Could you send me the backtrace?</div>
</div></div></blockquote><div><br></div><div>Sure, but I doubt this will be very useful, because it's optimized and lacks line numbers:</div><div>libclang!_wassert+0x589 [f:\dd\vctools\crt\crtw32\misc\assert.c @ 369]</div>
<div>libclang!clang::ASTUnit::transferASTDataFromCompilerInstance+0x61</div><div>libclang!clang::ASTUnit::Parse+0x601</div><div>libclang!clang::ASTUnit::LoadFromCompilerInvocation+0x145</div><div>libclang!clang::ASTUnit::LoadFromCommandLine+0x696</div>
<div>libclang!clang_parseTranslationUnit2+0x8a7</div><div>libclang!llvm::CrashRecoveryContext::RunSafely+0x66</div><div><br></div><div>The test fails outright for me in debug mode, so I can't repro the assertion with a nice stack trace.  I usually build release+asserts.  This is the failing output:</div>
<div><br></div><div>""""</div><div><div>Command 6: "D:/src/llvm/build_debug/./bin\FileCheck.EXE" "-check-prefix=PCH-ERR" "D:\src\llvm\tools\clang\test\Index\pch-with-errors.c"</div>
<div>Command 6 Result: 1</div><div>Command 6 Output:</div><div><br></div><div>Command 6 Stderr:</div><div>D:\src\llvm\tools\clang\test\Index\pch-with-errors.c:41:13: error: expected string not found in input</div><div>// PCH-ERR: error: PCH file contains compiler errors</div>
<div>            ^</div><div><stdin>:1:1: note: scanning from here</div><div>fatal error: malformed block record in PCH file: 'D:\src\llvm\build_debug\tools\clang\test\Index\Output\pch-with-errors.c.tmp.h.pch'</div>
<div>^</div><div><stdin>:1:33: note: possible intended match here</div><div>fatal error: malformed block record in PCH file: 'D:\src\llvm\build_debug\tools\clang\test\Index\Output\pch-with-errors.c.tmp.h.pch'</div>
<div>                                ^</div></div><div>""""</div></div><br></div><div class="gmail_extra">Note that Takumi XFAILd the test on mingw64 as well in r206294, so I think there's an underlying problem here.</div>
</div>
</blockquote></div><br></div></div></div></body></html>