<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 --- - LLDB on linux does not handle expressions that generate signals"
href="http://llvm.org/bugs/show_bug.cgi?id=15278">15278</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LLDB on linux does not handle expressions that generate signals
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>enhancement
</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@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Reporter</th>
<td>daniel.malea@intel.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The test case in question is TestCallThatRestarts.py. The test not only fails,
but causes many tests that run after it to also fail. In order for the test
case to pass, we need proper handling of inferior threads on Linux
(llvm.org/PR14323) first.
The desired behaviour was explained by Jim Ingham in an email:
If you call a function, and your process gets a signal while evaluating that
expression, AND the process handling for that signal is "no-stop" then getting
that signal should not cause the expression evaluation to be aborted, we should
just restart and it should go on its way. If the process handling for that
signal is to print, we should still print that the signal was received, but
also go on our way. And finally, if the signal is set to stop, then we should
stop when we get the signal, and obey the "unwind-on-error" setting and either
unwind the expression stack or stop at the point the signal was received
accordingly.
There is one other complexity here: the way we run expressions is a little
tricky. We are trying to balance the user's desire that expression evaluation
run only the given expression, and not any other threads in the program, with
the fact that doing that can easily deadlock. So we run expressions in two
phases. We push the expression evaluation stack frame on the stack of the
currently selected thread, then we let just that thread run for some amount of
time. If the expression hasn't completed in that time, then we interrupt the
process (call Halt), switch all the threads back on, and run the expression on
all threads. There is also an optional timeout on the "all threads running"
phase, though for expression evaluation through the "expression" command or the
SB API's like SBFrame::EvaluateExpression the default timeout for the second
phase is infinite.
This little two-step leads to all sorts of annoying corner cases, like we call
Halt and before we can get a chance to halt, the expression evaluation returns
successfully, or we were in the process of deciding that the signal stop we got
was not a reason for stopping, and are about to auto-continue when the one
thread execution times out, so we halt on one thread and continue on another...
This patch was big because I was trying to work out all those issues.</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>