<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 22, 2014, at 9:11 AM, Ben Langmuir <<a href="mailto:blangmuir@apple.com">blangmuir@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">On Apr 22, 2014, at 12:13 AM, Evgeniy Stepanov <</span><a href="mailto:eugeni.stepanov@gmail.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">eugeni.stepanov@gmail.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">> wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi,<br><br>This is crashing on ASan bootstrap bot with what looks like NULL dereference.<br></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Thanks for letting me know.  I’m bootstrapping an asanified clang to try to reproduce this, because this is not breaking for me even with more liberal asserts sprinkled into printDiagsToStderr().</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></blockquote><div><br></div>Hopefully fixed in r206909.</div><div><br><blockquote type="cite"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Ben</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/3112/steps/check-clang%20asan/logs/stdio">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/3112/steps/check-clang%20asan/logs/stdio</a><br><br>Crashing test: Clang :: Index/pch-with-errors.c<br><br>$ ASAN_SYMBOLIZER_PATH=../llvm_build0/bin/llvm-symbolizer<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/./bin/c-index-test<br>-write-pch /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/tools/clang/test/Index/Output/pch-with-errors.c.tmp.pch<br>foobar.c<br>ASAN:SIGSEGV<br>=================================================================<br>==12621==ERROR: AddressSanitizer: SEGV on unknown address<br>0x0000000006b0 (pc 0x7f7c8294870d sp 0x7f7c7e817980 bp 0x7f7c7e817ad0<br>T2)<br>  #0 0x7f7c8294870c in CXDiagnosticSetImpl<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/libclang/CIndexDiagnostic.h:31<br>  #1 0x7f7c8294870c in CXDiagnosticImpl<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/libclang/CIndexDiagnostic.h:100<br>  #2 0x7f7c8294870c in getASTContext<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/libclang/CIndexDiagnostic.h:119<br>  #3 0x7f7c8294870c in<br>clang::cxindex::printDiagsToStderr(clang::ASTUnit*)<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/libclang/CIndex.cpp:6719<br>  #4 0x7f7c82925b4b in clang_parseTranslationUnit_Impl(void*)<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/libclang/CIndex.cpp:2795<br>  #5 0x7f7c841a170b in llvm::CrashRecoveryContext::RunSafely(void<br>(*)(void*), void*)<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Support/CrashRecoveryContext.cpp:316<br>  #6 0x7f7c841a1ac0 in RunSafelyOnThread_Dispatch(void*)<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Support/CrashRecoveryContext.cpp:347<br>  #7 0x7f7c84239d4f in ExecuteOnThread_Dispatch(void*)<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Support/Threading.cpp:75<br>  #8 0x7f7c81c27181 in start_thread<br>(/lib/x86_64-linux-gnu/libpthread.so.0+0x8181)<br>  #9 0x7f7c81131b5c in clone (/lib/x86_64-linux-gnu/libc.so.6+0xfab5c)<br><br>AddressSanitizer can not provide additional info.<br>SUMMARY: AddressSanitizer: SEGV<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/libclang/CIndexDiagnostic.h:31<br>CXDiagnosticSetImpl<br>Thread T2 created by T1 here:<br>  #0 0x42a2fe in __interceptor_pthread_create<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:176<br>  #1 0x7f7c84239c6c in llvm::llvm_execute_on_thread(void (*)(void*),<br>void*, unsigned int)<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Support/Threading.cpp:96<br>  #2 0x7f7c841a1985 in<br>llvm::CrashRecoveryContext::RunSafelyOnThread(void (*)(void*), void*,<br>unsigned int) /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Support/CrashRecoveryContext.cpp:352<br>  #3 0x7f7c82923d55 in RunSafely<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/libclang/CIndex.cpp:6688<br>  #4 0x7f7c82923d55 in clang_parseTranslationUnit2<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/libclang/CIndex.cpp:2845<br>  #5 0x4b45b3 in write_pch_file<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/c-index-test/c-index-test.c:3685<br>  #6 0x4b6fd4 in cindextest_main<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/c-index-test/c-index-test.c:4052<br>  #7 0x4b9f57 in thread_runner<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/c-index-test/c-index-test.c:4075<br>  #8 0x7f7c84239d4f in ExecuteOnThread_Dispatch(void*)<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Support/Threading.cpp:75<br>  #9 0x7f7c81c27181 in start_thread<br>(/lib/x86_64-linux-gnu/libpthread.so.0+0x8181)<br><br>Thread T1 created by T0 here:<br>  #0 0x42a2fe in __interceptor_pthread_create<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:176<br>  #1 0x7f7c84239c6c in llvm::llvm_execute_on_thread(void (*)(void*),<br>void*, unsigned int)<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Support/Threading.cpp:96<br>  #2 0x4ba0a0 in main<br>/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/c-index-test/c-index-test.c:4093<br>  #3 0x7f7c81058ed4 in __libc_start_main<br>(/lib/x86_64-linux-gnu/libc.so.6+0x21ed4)<br><br>On Sat, Apr 19, 2014 at 12:39 AM, Ben Langmuir <blangmuir@apple.com> wrote:<br><blockquote type="cite">Author: benlangmuir<br>Date: Fri Apr 18 15:39:48 2014<br>New Revision: 206644<br><br>URL: http://llvm.org/viewvc/llvm-project?rev=206644&view=rev<br>Log:<br>Don't read CompilerInstance fields that don't exist in ASTUnit<br><br>When transferring data from a CompilerInstance in an error path we need<br>to consider cases where the various fields are uninitialized.<br><br>Modified:<br>  cfe/trunk/lib/Frontend/ASTUnit.cpp<br><br>Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp<br>URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=206644&r1=206643&r2=206644&view=diff<br>==============================================================================<br>--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)<br>+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Fri Apr 18 15:39:48 2014<br>@@ -1717,11 +1717,14 @@ void ASTUnit::transferASTDataFromCompile<br> // Steal the created target, context, and preprocessor.<br> TheSema.reset(CI.takeSema());<br> Consumer.reset(CI.takeASTConsumer());<br>-  Ctx = &CI.getASTContext();<br>-  PP = &CI.getPreprocessor();<br>+  if (CI.hasASTContext())<br>+    Ctx = &CI.getASTContext();<br>+  if (CI.hasPreprocessor())<br>+    PP = &CI.getPreprocessor();<br> CI.setSourceManager(0);<br> CI.setFileManager(0);<br>-  Target = &CI.getTarget();<br>+  if (CI.hasTarget())<br>+    Target = &CI.getTarget();<br> Reader = CI.getModuleManager();<br> HadModuleLoaderFatalFailure = CI.hadModuleLoaderFatalFailure();<br>}<br><br><br>_______________________________________________<br>cfe-commits mailing list<br>cfe-commits@cs.uiuc.edu<br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></blockquote></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">cfe-commits mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="mailto:cfe-commits@cs.uiuc.edu" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">cfe-commits@cs.uiuc.edu</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></blockquote></div><br></body></html>