<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:emaste@freebsd.org" title="emaste@freebsd.org">emaste@freebsd.org</a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - test_step_out_of_malloc_into_function_b_with_dwarf (TestThreadAPI.ThreadAPITestCase) fails with FreeBSD malloc"
   href="http://llvm.org/bugs/show_bug.cgi?id=17944">bug 17944</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Assignee</td>
           <td>lldb-dev@cs.uiuc.edu
           </td>
           <td>emaste@freebsd.org
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - test_step_out_of_malloc_into_function_b_with_dwarf (TestThreadAPI.ThreadAPITestCase) fails with FreeBSD malloc"
   href="http://llvm.org/bugs/show_bug.cgi?id=17944#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - test_step_out_of_malloc_into_function_b_with_dwarf (TestThreadAPI.ThreadAPITestCase) fails with FreeBSD malloc"
   href="http://llvm.org/bugs/show_bug.cgi?id=17944">bug 17944</a>
              from <span class="vcard"><a class="email" href="mailto:emaste@freebsd.org" title="emaste@freebsd.org">emaste@freebsd.org</a>
</span></b>
        <pre>Our breakpoint ends up at the inlined malloc_init, so we have an extra frame in
bt:

(lldb) breakpoint list
Current breakpoints:
1: name = 'malloc', locations = 1, resolved = 1, hit count = 1
  1.1: where = libc.so.7`malloc + 9 [inlined] malloc_init at malloc.c:5949,
address = 0x0000000800dda809, resolved, hit count = 1 

(lldb) bt
* thread #1: tid = 101976, 0x0000000800dda809 libc.so.7`malloc [inlined]
malloc_init at malloc.c:5397, stop reason = breakpoint 1.1
  * frame #0: 0x0000000800dda809 libc.so.7`malloc [inlined] malloc_init at
malloc.c:5397
    frame #1: 0x0000000800dda809 libc.so.7`malloc(size=1024) + 9 at
malloc.c:5949
    frame #2: 0x00000000008006e5 a.out`b(val=1) + 37 at main2.cpp:29
    frame #3: 0x0000000000800680 a.out`a(val=1) + 32 at main2.cpp:19
    frame #4: 0x0000000000800772 a.out`main(argc=1, argv=0x00007fffffffd510) +
34 at main2.cpp:44
    frame #5: 0x00000000008005d1 a.out`_start(ap=<unavailable>,
cleanup=<unavailable>) + 161 at crt1.c:97

malloc.c
  5388  /*                                                                      
  5389   * FreeBSD's pthreads implementation calls malloc(3), so the malloc     
  5390   * implementation has to take pains to avoid infinite recursion during  
  5391   * initialization.                                                      
  5392   */                                                                     
  5393  static inline bool                                                      
  5394  malloc_init(void)                                                       
  5395  {                                                                       
  5396                                                                          
  5397          if (malloc_initialized == false)                                
  5398                  return (malloc_init_hard());                            
  5399                                                                          
  5400          return (false);                                                 
  5401  }                                                                       

  5944  void *                                                                  
  5945  malloc(size_t size)                                                     
  5946  {                                                                       
  5947          void *ret;                                                      
  5948                                                                          
  5949          if (malloc_init()) {                                            
  5950                  ret = NULL;                                             
  5951                  goto OOM;                                               
  5952          }</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>