<html>
<head>
<base href="https://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 --- - LLDB GUI segfault when continuing with the thread frame list expanded"
href="https://llvm.org/bugs/show_bug.cgi?id=26842">26842</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LLDB GUI segfault when continuing with the thread frame list expanded
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</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>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@lists.llvm.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kknb1056@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=15986" name="attach_15986" title="Example backtrace of a crash, plus the proposed patch to fix">attachment 15986</a> <a href="attachment.cgi?id=15986&action=edit" title="Example backtrace of a crash, plus the proposed patch to fix">[details]</a></span>
Example backtrace of a crash, plus the proposed patch to fix
I have a fix for this, but I wasn't sure if the correct etiquette is to file a
bug report before posting a patch to lldb-commits?
If the frame stack changes while the list is expanded in the Threads window,
there will be a high likelihood of a segfault. For example, expanding the list
and then "continue" to another breakpoint where the list is different. I can
give a specific program and instructions if required but any program should do
it. An example stack trace is attached.
This is with the version of lldb shipped with XCode 7.2.1 (lldb-340.4.119.1) as
well as the current head (as at 04/Mar/16).
The problem is that, when creating the updated list it is done with
vector<TreeItem>::resize( <new size>, <new value> );
(via calls to TreeItem::Resize in IOHandler.cpp lines 3312 and 3422). The
intention of the code is to fill the m_children vector with copies of <new
value>, but std::vector::resize only uses the <new value> for new values -
items already in the vector are left untouched. Hence all items up to the old
size will have invalid pointers to parent etcetera, and subsequent Draw calls
will screw up.
I propose to insert a call to TreeItem::ClearChildren() immediately before the
TreeItem::Resize(..) calls so that all children correctly take on the new
value.
A patch is attached, but I could only append one file so it's after the
backtrace.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>