<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I m' not sure, but it may be related to this (around line 1390 ~1400) :<div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span style="color: #aa0d91">if</span> (!HTMLDiag.<span style="color: #2e0d6e">empty</span>()) {</div></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000">    </span>// FIXME: The HTMLDiagnosticClient uses the Preprocessor for</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000">    </span>//  (optional) syntax highlighting, but we don't have a preprocessor yet.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000">    </span>//  Fix this dependency later.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">    DiagClient.<span style="color: #2e0d6e">reset</span>(CreateHTMLDiagnosticClient(HTMLDiag, <span style="color: #1c00cf">0</span>, <span style="color: #1c00cf">0</span>));</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><br></div><div><div>Le 7 août 08 à 19:18, Nico Weber a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><blockquote type="cite">I started playing around with clang today, and hit a crash in the<br></blockquote><blockquote type="cite">HTMLDiagnostics. Unfortunately I don't have the time to reduce the<br></blockquote><blockquote type="cite">test case right now, but nevertheless I wanted to draw your attention<br></blockquote><blockquote type="cite">to this (maybe it's something obvious for people who know the code).<br></blockquote><blockquote type="cite">I'll try to come up with a testcase that relies only on open source<br></blockquote><blockquote type="cite">code for people to reproduce.<br></blockquote><br>It seems this (or at least something related) happens with any input  <br>file that produces a warning:<br><br>Macintosh-3:clang nico$ cat test.c<br>int main() {<br>   char b[10] = "";<br>   printf(b);<br>}<br>Macintosh-3:clang nico$ gdb ../../Debug/bin/clang GNU gdb  <br>6.3.50-20050815 (Apple version gdb-768) (Tue Oct  2 04:07:49 UTC 2007)<br>Copyright 2004 Free Software Foundation, Inc.<br>GDB is free software, covered by the GNU General Public License, and  <br>you are<br>welcome to change it and/or distribute copies of it under certain  <br>conditions.<br>Type "show copying" to see the conditions.<br>There is absolutely no warranty for GDB.  Type "show warranty" for  <br>details.<br>This GDB was configured as "i386-apple-darwin"...Reading symbols for  <br>shared libraries .... done<br>^P<br>(gdb) run -fsyntax-only -html-diags=/Users/nico test.c<br>Starting program: /Users/nico/src/llvm-svn/Debug/bin/clang -fsyntax- <br>only -html-diags=/Users/nico test.c<br>Reading symbols for shared libraries +++. done<br>1 diagnostic generated.<br>Assertion failed: (FileID-1 < FileIDs.size() && "Invalid FileID!"),  <br>function getFIDInfo, file /Users/nico/src/llvm-svn/tools/clang/ <br>Driver/../include/clang/Basic/SourceManager.h, line 453.<br><br>Program received signal SIGABRT, Aborted.<br>0x966eeb9e in __kill ()<br>(gdb) bt<br>#0  0x966eeb9e in __kill ()<br>#1  0x966eeb91 in kill$UNIX2003 ()<br>#2  0x96765ec2 in raise ()<br>#3  0x9677547f in abort ()<br>#4  0x96767063 in __assert_rtn ()<br>#5  0x00005422 in clang::SourceManager::getFIDInfo (this=0xd02090,  <br>FileID=1070333358) at SourceManager.h:453<br>#6  0x00005458 in clang::SourceManager::getContentCache  <br>(this=0xd02090, FileID=1070333358) at SourceManager.h:458<br>#7  0x0000e2e0 in clang::SourceManager::getBuffer (this=0xd02090,  <br>FileID=1070333358) at SourceManager.h:286<br>#8  0x0000bd77 in (anonymous namespace)::HTMLDiagnostics::HandlePiece  <br>(this=0xd01fd0, R=@0xbffff468, BugFileID=1070333358, P=@0xd073e0,  <br>num=1, max=1) at HTMLDiagnostics.cpp:338<br>#9  0x0000c611 in (anonymous namespace)::HTMLDiagnostics::ReportDiag  <br>(this=0xd01fd0, D=@0xd07310) at HTMLDiagnostics.cpp:182<br>#10 0x0000d242 in (anonymous  <br>namespace)::HTMLDiagnostics::~HTMLDiagnostics (this=0xd01fd0) at  <br>HTMLDiagnostics.cpp:98<br>#11 0x00030729 in std::auto_ptr<clang::DiagnosticClient>::~auto_ptr  <br>(this=0xbffff784) at memory:259<br>#12 0x0003073d in std::auto_ptr<clang::DiagnosticClient>::~auto_ptr  <br>(this=0xbffff784) at memory:259<br>#13 0x0002eb1e in main (argc=4, argv=0xbffff804) at clang.cpp:1515<br>(gdb) The program is running.  Exit anyway? (y or n) y<br><br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br><br></div></blockquote></div><br></div></body></html>