<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 - LLDB "image list" accumulates duplicate loader+vdso images on restart"
   href="https://bugs.llvm.org/show_bug.cgi?id=51467">51467</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLDB "image list" accumulates duplicate loader+vdso images on restart
          </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@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rprichard@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jdevlieghere@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm using lldb with a dynamically-linked glibc hello world program:

$ cat hello.c
#include <stdio.h>

int main() {
  printf("hi\n");
  return 0;
}
$ gcc hello.c -g

Each time I restart the program in lldb, "image list" accumulates another copy
of the [vdso] image and the loader image
(/usr/lib/x86_64-linux-gnu/ld-2.31.so):

$ /x/clang12/bin/lldb a.out
(lldb) target create "a.out"
Current executable set to '/x/mess/a.out' (x86_64).
(lldb) image list
[  0] A57BBE87-FECC-2529-B8F0-06376F8C9954-4C7B7916 0x0000000000000000
/x/mess/a.out 
(lldb) b main
Breakpoint 1: where = a.out`main + 4 at hello.c:4:3, address =
0x0000000000001139
(lldb) run
Process 639200 launched: '/x/mess/a.out' (x86_64)
Process 639200 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x0000555555555139 a.out`main at hello.c:4:3
   1    #include <stdio.h>
   2    
   3    int main() {
-> 4      printf("hi\n");
   5      return 0;
   6    }
(lldb) image list
[  0] A57BBE87-FECC-2529-B8F0-06376F8C9954-4C7B7916 0x0000555555554000
/x/mess/a.out 
[  1] 9F75E12B-5CDE-458E-4DDF-E16FC31565F2-C6E3306F 0x00007ffff7fd2000
/usr/lib/x86_64-linux-gnu/ld-2.31.so 
      /usr/lib/debug/.build-id/9f/75e12b5cde458e4ddfe16fc31565f2c6e3306f.debug
[  2] D3D446F7-5BA5-351B-D4C9-2782DF0761ED-0B51B041 0x00007ffff7fd0000 [vdso]
(0x00007ffff7fd0000)
[  3] FC3F27BB-2B0B-F376-A564-0FA0ECC65A1E-16634CFB 0x00007ffff7ddc000
/lib/x86_64-linux-gnu/libc.so.6 
      /usr/lib/debug/.build-id/fc/3f27bb2b0bf376a5640fa0ecc65a1e16634cfb.debug
(lldb) run
There is a running process, kill it and restart?: [Y/n] y
Process 639200 exited with status = 9 (0x00000009) 
Process 639398 launched: '/x/mess/a.out' (x86_64)
Process 639398 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x0000555555555139 a.out`main at hello.c:4:3
   1    #include <stdio.h>
   2    
   3    int main() {
-> 4      printf("hi\n");
   5      return 0;
   6    }
(lldb) image list
[  0] A57BBE87-FECC-2529-B8F0-06376F8C9954-4C7B7916 0x0000555555554000
/x/mess/a.out 
[  1] 9F75E12B-5CDE-458E-4DDF-E16FC31565F2-C6E3306F 0x00007ffff7fd2000
/usr/lib/x86_64-linux-gnu/ld-2.31.so 
      /usr/lib/debug/.build-id/9f/75e12b5cde458e4ddfe16fc31565f2c6e3306f.debug
[  2] D3D446F7-5BA5-351B-D4C9-2782DF0761ED-0B51B041 0x00007ffff7fd0000 [vdso]
(0x00007ffff7fd0000)
[  3] FC3F27BB-2B0B-F376-A564-0FA0ECC65A1E-16634CFB 0x00007ffff7ddc000
/lib/x86_64-linux-gnu/libc.so.6 
      /usr/lib/debug/.build-id/fc/3f27bb2b0bf376a5640fa0ecc65a1e16634cfb.debug
[  4] 9F75E12B-5CDE-458E-4DDF-E16FC31565F2-C6E3306F 0x00007ffff7fd2000
/usr/lib/x86_64-linux-gnu/ld-2.31.so 
      /usr/lib/debug/.build-id/9f/75e12b5cde458e4ddfe16fc31565f2c6e3306f.debug
[  5] D3D446F7-5BA5-351B-D4C9-2782DF0761ED-0B51B041 0x00007ffff7fd0000 [vdso]
(0x00007ffff7fd0000)
(lldb) run
There is a running process, kill it and restart?: [Y/n] y
Process 639398 exited with status = 9 (0x00000009) 
Process 639416 launched: '/x/mess/a.out' (x86_64)
Process 639416 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
    frame #0: 0x0000555555555139 a.out`main at hello.c:4:3
   1    #include <stdio.h>
   2    
   3    int main() {
-> 4      printf("hi\n");
   5      return 0;
   6    }
(lldb) image list
[  0] A57BBE87-FECC-2529-B8F0-06376F8C9954-4C7B7916 0x0000555555554000
/x/mess/a.out 
[  1] 9F75E12B-5CDE-458E-4DDF-E16FC31565F2-C6E3306F 0x00007ffff7fd2000
/usr/lib/x86_64-linux-gnu/ld-2.31.so 
      /usr/lib/debug/.build-id/9f/75e12b5cde458e4ddfe16fc31565f2c6e3306f.debug
[  2] D3D446F7-5BA5-351B-D4C9-2782DF0761ED-0B51B041 0x00007ffff7fd0000 [vdso]
(0x00007ffff7fd0000)
[  3] FC3F27BB-2B0B-F376-A564-0FA0ECC65A1E-16634CFB 0x00007ffff7ddc000
/lib/x86_64-linux-gnu/libc.so.6 
      /usr/lib/debug/.build-id/fc/3f27bb2b0bf376a5640fa0ecc65a1e16634cfb.debug
[  4] 9F75E12B-5CDE-458E-4DDF-E16FC31565F2-C6E3306F 0x00007ffff7fd2000
/usr/lib/x86_64-linux-gnu/ld-2.31.so 
      /usr/lib/debug/.build-id/9f/75e12b5cde458e4ddfe16fc31565f2c6e3306f.debug
[  5] D3D446F7-5BA5-351B-D4C9-2782DF0761ED-0B51B041 [vdso][0x0000000000000000]
[vdso] (0x00007ffff7fd0000)
[  6] 9F75E12B-5CDE-458E-4DDF-E16FC31565F2-C6E3306F 0x00007ffff7fd2000
/usr/lib/x86_64-linux-gnu/ld-2.31.so 
      /usr/lib/debug/.build-id/9f/75e12b5cde458e4ddfe16fc31565f2c6e3306f.debug
[  7] D3D446F7-5BA5-351B-D4C9-2782DF0761ED-0B51B041 0x00007ffff7fd0000 [vdso]
(0x00007ffff7fd0000)

I'll also attached a file with dyld logging enabled.</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>