<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 exits with assertion error on specific block comment"
href="https://bugs.llvm.org/show_bug.cgi?id=34236">34236</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang-format exits with assertion error on specific block comment
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</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>Formatter
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>euhlmann@vmware.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>Created <span class=""><a href="attachment.cgi?id=19004" name="attach_19004" title="The input that causes the error">attachment 19004</a> <a href="attachment.cgi?id=19004&action=edit" title="The input that causes the error">[details]</a></span>
The input that causes the error
With the following input (attached), clang-format exits with an assertion
error.
/* */ /*
* a a
* a a*/
If any one character is removed, everything works fine, but this specific input
fails.
Error text:
Assertion failed: (PreviousOriginalWhitespaceEndOffset <=
OriginalWhitespaceStartOffset), function calculateLineBreakInformation, file
/Users/euhlmann/clang/llvm/tools/clang/lib/Format/WhitespaceManager.cpp, line
112.
0 clang-format 0x000000010a8768ac
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60
1 clang-format 0x000000010a876e29
PrintStackTraceSignalHandler(void*) + 25
2 clang-format 0x000000010a872a09 llvm::sys::RunSignalHandlers() +
425
3 clang-format 0x000000010a877362 SignalHandler(int) + 354
4 libsystem_platform.dylib 0x00007fffa3f0eb3a _sigtramp + 26
5 libsystem_platform.dylib 0x01007f89a9600f50 _sigtramp + 91169840
6 libsystem_c.dylib 0x00007fffa3d93420 abort + 129
7 libsystem_c.dylib 0x00007fffa3d5a893 basename_r + 0
8 clang-format 0x000000010aa4b4c3
clang::format::WhitespaceManager::calculateLineBreakInformation() + 1187
9 clang-format 0x000000010aa4af9c
clang::format::WhitespaceManager::generateReplacements() + 172
10 clang-format 0x000000010a9c9595 clang::format::(anonymous
namespace)::Formatter::analyze(clang::format::TokenAnnotator&,
llvm::SmallVectorImpl<clang::format::AnnotatedLine*>&,
clang::format::FormatTokenLexer&) + 1077
11 clang-format 0x000000010a9f9c49
clang::format::TokenAnalyzer::process() + 1737
12 clang-format 0x000000010a9c9036
clang::format::reformat(clang::format::FormatStyle const&, llvm::StringRef,
llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef,
clang::format::FormattingAttemptStatus*)::$_6::operator()(clang::format::Environment
const&) const + 134
13 clang-format 0x000000010a9c8fa4 clang::tooling::Replacements
std::__1::__invoke_void_return_wrapper<clang::tooling::Replacements>::__call<clang::format::reformat(clang::format::FormatStyle
const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>,
llvm::StringRef, clang::format::FormattingAttemptStatus*)::$_6&,
clang::format::Environment
const&>(clang::format::reformat(clang::format::FormatStyle const&,
llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef,
clang::format::FormattingAttemptStatus*)::$_6&&&, clang::format::Environment
const&&&) + 84
14 clang-format 0x000000010a9c8f20
std::__1::__function::__func<clang::format::reformat(clang::format::FormatStyle
const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>,
llvm::StringRef, clang::format::FormattingAttemptStatus*)::$_6,
std::__1::allocator<clang::format::reformat(clang::format::FormatStyle const&,
llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef,
clang::format::FormattingAttemptStatus*)::$_6>, clang::tooling::Replacements
(clang::format::Environment const&)>::operator()(clang::format::Environment
const&) + 64
15 clang-format 0x000000010a991be2
std::__1::function<clang::tooling::Replacements (clang::format::Environment
const&)>::operator()(clang::format::Environment const&) const + 66
16 clang-format 0x000000010a990db9
clang::format::reformat(clang::format::FormatStyle const&, llvm::StringRef,
llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef,
clang::format::FormattingAttemptStatus*) + 1161
17 clang-format 0x000000010a723d23
clang::format::format(llvm::StringRef) + 6019
18 clang-format 0x000000010a721a17 main + 4455
19 libdyld.dylib 0x00007fffa3cff235 start + 1
Abort trap: 6</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>