<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 --- - inferior process exits due to SIGTRAP after detach on FreeBSD"
   href="http://llvm.org/bugs/show_bug.cgi?id=18894">18894</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>inferior process exits due to SIGTRAP after detach on FreeBSD
          </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>FreeBSD
          </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@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>emaste@freebsd.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Invoke lldb against some target e.g. /bin/sleep, set a breakpoint, run, then
detach when the breakpoint is hit.  The inferior dumps core with SIGTRAP.
(LLDB r201577)


Typescript:

joule% bin/lldb /bin/sleep 60           
Current executable set to '/bin/sleep' (x86_64).
(lldb) b main
Breakpoint 1: where = sleep`main + 20 at sleep.c:75, address =
0x0000000000400964
(lldb) run
Process 26485 launching
Process 26485 stopped
(lldb) Process 26485 launched: '/bin/sleep' (x86_64)
Process 26485 stopped
* thread #1: tid = 100436, 0x0000000000400964 sleep`main(argc=<unavailable>,
argv=0x00007fffffffd730) + 20 at sleep.c:75, stop reason = breakpoint 1.1
    frame #0: 0x0000000000400964 sleep`main(argc=<unavailable>,
argv=0x00007fffffffd730) + 20 at sleep.c:75
   72           if (argc != 2)
   73                   usage();
   74  
-> 75           if (sscanf(argv[1], "%lf%1s", &d, buf) != 1)
   76                   usage();
   77           if (d > INT_MAX)
   78                   usage();
(lldb) detach
Process 26485 detached
(lldb) Detaching from process 26485
(lldb) quit
joule% ls sleep.core 
sleep.core
joule% bin/lldb /bin/sleep -c sleep.core
Core file '/data/emaste/src/llvm/build/sleep.core' (x86_64) was loaded.
Process 0 stopped
* thread #1: tid = 0, 0x0000000000400965 sleep`main(argc=<unavailable>,
argv=0x00007fffffffd730) + 21 at sleep.c:75, name = 'sleep', stop reason =
signal SIGTRAP
    frame #0: 0x0000000000400965 sleep`main(argc=<unavailable>,
argv=0x00007fffffffd730) + 21 at sleep.c:75
   72           if (argc != 2)
   73                   usage();
   74  
-> 75           if (sscanf(argv[1], "%lf%1s", &d, buf) != 1)
   76                   usage();
   77           if (d > INT_MAX)
   78                   usage();
(lldb)</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>