Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Sep 2023 18:17:40 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 273956] KERN_PROC_VMMAP does not read all mapped files
Message-ID:  <bug-273956-227-PsNR7JlEfW@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-273956-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-273956-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273956

--- Comment #5 from Ed Maste <emaste@freebsd.org> ---
Ok, I can stop it there:

(lldb) b parse_procselfmaps
Breakpoint 1: where =3D memcheck-amd64-freebsd`parse_procselfmaps + 37 at
aspacemgr-linux.c:3926:12, address =3D 0x0000000038133885
(lldb) run
Process 30476 launched:
'/home/emaste/src/valgrind/memcheck/memcheck-amd64-freebsd' (x86_64)
Process 30476 stopped
* thread #1, name =3D 'memcheck-amd64-f', stop reason =3D breakpoint 1.1
    frame #0: 0x0000000038133885
memcheck-amd64-freebsd`parse_procselfmaps(record_mapping=3D(memcheck-amd64-=
freebsd`read_maps_callback
at aspacemgr-linux.c:1533), record_gap=3D0x0000000000000000) at
aspacemgr-linux.c:3926:12
   3923
   3924     foffset =3D ino =3D 0; /* keep gcc-4.1.0 happy */
   3925
-> 3926     oid[0] =3D VKI_CTL_KERN;
   3927     oid[1] =3D VKI_KERN_PROC;
   3928     oid[2] =3D VKI_KERN_PROC_VMMAP;
   3929     oid[3] =3D 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=
=20
30476        0x838a5f000        0x858a3f000 ---    0    0   0   0 ----- gd=
=20
30476        0x858a3f000        0x858a5f000 rw-    1    1   1   0 ---D- sw=
=20
30476        0x8592e4000        0x8592e5000 r-x    1    1 116   0 ----- ph=
=20
30476     0x7ffffffff000     0x800000000000 ---    0    0   0   0 ----- gd=
=20

ELF phdrs show:

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  Me=
mSiz
  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

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-273956-227-PsNR7JlEfW>