<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - clang crashes with -ferror-limit=1"
href="http://llvm.org/bugs/show_bug.cgi?id=21945">21945</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang crashes with -ferror-limit=1
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>alastair.donaldson@imperial.ac.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=13560" name="attach_13560" title="Example illustrating the issue">attachment 13560</a> <a href="attachment.cgi?id=13560&action=edit" title="Example illustrating the issue">[details]</a></span>
Example illustrating the issue
Doing:
clang -ferror-limit=1 example.c
on the attached causes clang to crash with a stack dump (Windows stack dump and
other info below)
The issue is reproducible with 3.5, trunk, and the Apple version of clang.
We found this issue indirectly using Csmith.
C:\temp>clang -ferror-limit=1 example.c
example.c:2:5: error: unknown type name 'uint'; did you mean 'int'?
uint g_275;
^~~~
int
fatal error: too many errors emitted, stopping now [-ferror-limit=]
Stack dump:
0. Program arguments: C:\prog\llvm35-build\Release\bin\clang.exe -cc1
-triple i686-pc-windows-m
svc -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
example.c -mrelocatio
n-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -target-cpu pentiu
m4 -dwarf-column-info -resource-dir
C:\prog\llvm35-build\Release\bin\..\lib\clang\3.5.0 -internal-is
ystem C:\prog\llvm35-build\Release\bin\..\lib\clang\3.5.0\include
-internal-isystem C:\Program Files
(x86)\Microsoft Visual Studio 11.0\VC\include -internal-isystem C:\Program
Files (x86)\Windows Kits
\8.1\include -fdebug-compilation-dir C:\temp -ferror-limit 1 -fmessage-length
100 -mstackrealign -fm
s-extensions -fms-compatibility -fms-compatibility-version=17.00
-fdelayed-template-parsing -fobjc-r
untime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o
C:\Users\afd\AppData\Local\Temp\example-
0cae7c.o -x c example.c
1. example.c:8:54: current parser token ';'
2. example.c:7:1: parsing function body 'func_45'
3. example.c:7:1: in compound statement ('{}')
0x00EB7722 (0x01FEA5B0 0x01FEA0F0 0x01D0B73C 0x00E987C2)
0x00EA351E (0x01FEA5B0 0x01D0B970 0x01D0B810 0x01D0BA30)
0x00E987C2 (0x01D0B810 0x01D0C184 0x01FEA5B0 0x01FEA5B0)
0x00E99889 (0x01FEA5B0 0x01D0B810 0x01FEA5E8 0x01D0B970)
0x00EBEB82 (0x01D0B810 0x01FEA5E8 0x01D0C004 0x01D0C004)
0x00E9D84B (0x01FEA5E8 0x01FEA5E8 0x01D0C004 0x01D0C184)
0x00EA7828 (0x01FEA5E8 0x01FEA150 0x01D0C0B0 0x00E98420)
0x00E9F955 (0x01FEA5E8 0x01FEA5E8 0x01D0C2DC 0x01D0C184)
0x00E98420 (0x01D0C2DC 0x01D0C184 0x01FEA5E8 0x01FEA5E8)
0x00E98F8A (0x01D0C184 0x01FEA5E8 0x01D0C2DC 0x01D0C370)
0x00E990AD (0x01D0C2D4 0x01FE2F30 0x01FEA5E8 0x01D0C370)
0x00CE07A3 (0x01D0C370 0x01FE2F30 0x01FEA5E8 0x00000020)
0x00CE073B (0x01D0C370 0x01FE2F30 0x01FEA5E8 0x01FEA5E8)
0x00CD9A48 (0x02004950 0x01FEA5E8 0x01FEA140 0x0000004B)
0x00CD6830 (0x02004950 0x01FEA618 0x0000004B 0x01FEA618)
0x00CD88E4 (0x01FEA618 0x0000004B 0x01FEA100 0x01FEA570)
0x00B64421 (0x01D0C4FC 0x01FEA618 0x0000004B 0x00000000)
0x00B066F8 (0x01FEA570 0x01FEA600 0x00000000 0x01D0D200)
0x009ED760 (0x01D0D384 0x01D0D364 0x00000000 0x01D0DB14)
0x009ECA21 (0x01D0DB14 0x01D0D8B0 0x00000007 0x00000000)
0x009F55C7 (0x01D0DB14 0x01D0DC8C 0x00000007 0x01D0DB10)
0x009ED058 (0x01D0DB14 0x01D0DC8C 0x00000007 0x01D0DB10)
0x00A14A5A (0x01D0DB38 0x01D0DC8C 0x00000000 0x00000000)
0x00A14371 (0x01D0DC14 0x01D0DC8C 0x00000000 0x00000000)
0x00A11229 (0x01D0DD80 0x00000000 0x01FEA4F0 0x01D0E410)
0x00A1299E (0x01FEA4F0 0x01D0DE08 0x0201A960 0x01D0E410)
0x009DC9F1 (0x01D0DEC0 0x01D0DEA0 0x01D0E384 0x01D0E410)
0x009EC7E0 (0x01D0E6A8 0x01D0E410 0x00000000 0x00000001)
0x009DB967 (0x01D0E6A8 0x01D0E688 0x01D0E410 0x00000003)
0x009DBA74 (0x01D0E6A8 0x01D0E688 0x00000000 0x00000003)
0x009DC216 (0x01D0E6A8 0x01D0E688 0x00000000 0x00000000)
0x009DDD16 (0x01D0E6E4 0x01FC7AB8 0x01FBF470 0x01FC7AB8)
0x009D8FE7 (0x02004950 0x00000000 0x00000000 0x01FBF470)
0x0064E0A1 (0x00000000 0x01FBF470 0x01FC7AB8 0x00635A7B)
0x0064DFDF (0x01FC7AB8 0x01FC6208 0x01FBF470 0x01FBF470)
0x006820E1 (0x01FBF470 0x0000002E 0x00000000 0x01D0F404)
0x0014595A (0x01D0F40C 0x01D0F4BC 0x01FC62C0 0x001426E0)
0x00144322 (0x0000002E 0x01FC4898 0x01FC0E88 0x82B50D13)
0x00F38AC1 (0x7E9EF000 0x01D0F9E0 0x77970BBB 0x7E9EF000)
0x769C919F (0x7E9EF000 0xF432F514 0x00000000 0x00000000), BaseThreadInitThunk()
+ 0xE bytes(s)
0x77970BBB (0xFFFFFFFF 0x7795C9D4 0x00000000 0x00000000),
RtlInitializeExceptionChain() + 0x84 bytes
(s)
0x77970B91 (0x00F38B29 0x7E9EF000 0x00000000 0x00000000),
RtlInitializeExceptionChain() + 0x5A bytes
(s)
clang.exe: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0 (219114)
Target: i686-pc-windows-msvc
Thread model: posix
clang.exe: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the
crash backtrace, preprocessed source, and associated run script.
clang.exe: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang.exe: note: diagnostic msg:
C:\Users\afd\AppData\Local\Temp\example-6fc34e.c
clang.exe: note: diagnostic msg:
C:\Users\afd\AppData\Local\Temp\example-6fc34e.sh
clang.exe: note: diagnostic msg:
********************</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>