<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 - Unable to attach, detach, and attach to the same PID. The second attach command fails."
href="https://bugs.llvm.org/show_bug.cgi?id=37199">37199</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Unable to attach, detach, and attach to the same PID. The second attach command fails.
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>6.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>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@lists.llvm.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mewbaz@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Problem description:
It is possible to attach to a process, detach from that process, but upon a
subsequent attempt to attach to the same process (after detaching), the attach
command fails, with "error: no error returned from Target::Attach, and target
has no process".
u@x220 ~> lldb --version
lldb version 6.0.0
u@x220 ~> sudo lldb
(lldb) attach 9594
Process 9594 stopped
* thread #1, name = 'target', stop reason = signal SIGSTOP
frame #0: 0x00007f11ca4ccb10 libc.so.6`__GI___nanosleep + 64
libc.so.6`__GI___nanosleep:
-> 0x7f11ca4ccb10 <+64>: cmpq $-0x1000, %rax ; imm = 0xF000
0x7f11ca4ccb16 <+70>: ja 0x7f11ca4ccb42 ; <+114>
0x7f11ca4ccb18 <+72>: movl %edx, %edi
0x7f11ca4ccb1a <+74>: movl %eax, 0xc(%rsp)
thread #2, name = 'target', stop reason = signal SIGSTOP
frame #0: 0x00007f11ca4ccb10 libc.so.6`__GI___nanosleep + 64
libc.so.6`__GI___nanosleep:
-> 0x7f11ca4ccb10 <+64>: cmpq $-0x1000, %rax ; imm = 0xF000
0x7f11ca4ccb16 <+70>: ja 0x7f11ca4ccb42 ; <+114>
0x7f11ca4ccb18 <+72>: movl %edx, %edi
0x7f11ca4ccb1a <+74>: movl %eax, 0xc(%rsp)
Executable module set to "/home/u/Desktop/ptrace-call-userspace/target".
Architecture set to: x86_64-pc-linux.
(lldb) c
Process 9594 resuming
(lldb) detach
Process 9594 detached
(lldb) attach 9594
error: no error returned from Target::Attach, and target has no process</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>