[Bug 273956] KERN_PROC_VMMAP does not read all mapped files
- In reply to: bugzilla-noreply_a_freebsd.org: "[Bug 273956] KERN_PROC_VMMAP does not read all mapped files"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 20 Sep 2023 18:17:40 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273956
--- Comment #5 from Ed Maste <emaste@freebsd.org> ---
Ok, I can stop it there:
(lldb) b parse_procselfmaps
Breakpoint 1: where = memcheck-amd64-freebsd`parse_procselfmaps + 37 at
aspacemgr-linux.c:3926:12, address = 0x0000000038133885
(lldb) run
Process 30476 launched:
'/home/emaste/src/valgrind/memcheck/memcheck-amd64-freebsd' (x86_64)
Process 30476 stopped
* thread #1, name = 'memcheck-amd64-f', stop reason = breakpoint 1.1
frame #0: 0x0000000038133885
memcheck-amd64-freebsd`parse_procselfmaps(record_mapping=(memcheck-amd64-freebsd`read_maps_callback
at aspacemgr-linux.c:1533), record_gap=0x0000000000000000) at
aspacemgr-linux.c:3926:12
3923
3924 foffset = ino = 0; /* keep gcc-4.1.0 happy */
3925
-> 3926 oid[0] = VKI_CTL_KERN;
3927 oid[1] = VKI_KERN_PROC;
3928 oid[2] = VKI_KERN_PROC_VMMAP;
3929 oid[3] = sr_Res(VG_(do_syscall0)(__NR_getpid));
and see this mapping:
PID START END PRT RES PRES REF SHD FLAG TP PATH
30476 0x38000000 0x380c4000 r-- 196 2535 3 1 CN--- vn
/usr/home/emaste/src/valgrind/memcheck/memcheck-amd64-freebsd
30476 0x380c4000 0x38273000 r-x 431 0 1 0 C---- vn
/usr/home/emaste/src/valgrind/memcheck/memcheck-amd64-freebsd
30476 0x38273000 0x3a851000 rw- 9 9 1 0 ----- sw
30476 0x838a5f000 0x858a3f000 --- 0 0 0 0 ----- gd
30476 0x858a3f000 0x858a5f000 rw- 1 1 1 0 ---D- sw
30476 0x8592e4000 0x8592e5000 r-x 1 1 116 0 ----- ph
30476 0x7ffffffff000 0x800000000000 --- 0 0 0 0 ----- gd
ELF phdrs show:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz
Flg Align
PHDR 0x000040 0x0000000038000040 0x0000000038000040 0x000188
0x000188 R 0x8
LOAD 0x000000 0x0000000038000000 0x0000000038000000 0x0c31d4
0x0c31d4 R 0x1000
LOAD 0x0c31e0 0x00000000380c41e0 0x00000000380c41e0 0x1adf8f
0x1adf8f R E 0x1000
LOAD 0x271170 0x0000000038273170 0x0000000038273170 0x000a90
0x25dcfe0 RW 0x1000
GNU_EH_FRAME 0x0941e0 0x00000000380941e0 0x00000000380941e0 0x006a2c
0x006a2c R 0x4
GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000
0x000000 RW 0x0
NOTE 0x0001c8 0x00000000380001c8 0x00000000380001c8 0x000030
0x000030 R 0x4
So the `rw-` mapping doesn't disappear, it just becomes `sw`.
Will update with more later
--
You are receiving this mail because:
You are the assignee for the bug.