<html>
<head>
<base href="https://bugs.llvm.org/">
</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-format: crash with SIGFPE when TabWidth is set to 0 and line starts with tab"
href="https://bugs.llvm.org/show_bug.cgi?id=41964">41964</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-format: crash with SIGFPE when TabWidth is set to 0 and line starts with tab
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>8.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>Formatter
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mateusz.szychowski@blackstarsoftware.com
</td>
</tr>
<tr>
<th>CC</th>
<td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>clang-format 8.0 crashes with SIGFPE (floating point exception) when formatting
following file:
app.cpp:
void a() {
//line starts with '\t'
}
$ clang-format -style='{TabWidth: 0}' app.cpp
Stack dump:
0. Program arguments: clang-format -style={TabWidth: 0} app.cpp
/lib/x86_64-linux-gnu/libLLVM-8.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1f)[0x7f25b84aadff]
/lib/x86_64-linux-gnu/libLLVM-8.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x50)[0x7f25b84a9250]
/lib/x86_64-linux-gnu/libLLVM-8.so.1(+0x976208)[0x7f25b84ab208]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x13f40)[0x7f25bb789f40]
clang-format[0x46419c]
clang-format[0x463d48]
clang-format[0x439e0a]
clang-format[0x43191c]
clang-format[0x42402b]
clang-format[0x424773]
clang-format[0x40c757]
clang-format[0x40ba14]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb)[0x7f25b7627b6b]
clang-format[0x40b50a]
Floating point exception (core dumped)
reproduced on:
Manjaro Linux (Linux 5.1.1-2-MANJARO)
Arch Linux Docker Image
Ubuntu 19.04 Docker Image
Ubuntu 18.04 (with clang-format 7)</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>