Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Feb 2010 11:15:22 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Marcel Moolenaar <xcllnt@mac.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r203696 - in head: lib/libc/sys sys/kern sys/sys
Message-ID:  <20100210091522.GW9991@deviant.kiev.zoral.com.ua>
In-Reply-To: <86989446-64EF-411F-8E25-173DB6AEE10B@mac.com>
References:  <201002090552.o195qZcD074581@svn.freebsd.org> <20100209095722.GQ9991@deviant.kiev.zoral.com.ua> <65DCE552-7EFD-48F2-85A4-EA0F1F0638EE@mac.com> <20100209184043.GV9991@deviant.kiev.zoral.com.ua> <896B58E6-12EA-48AB-86C2-5BA9F0C59512@mac.com> <86989446-64EF-411F-8E25-173DB6AEE10B@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--9+ohdFDUqiMJzwPo
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Feb 09, 2010 at 04:11:43PM -0800, Marcel Moolenaar wrote:
>=20
> On Feb 9, 2010, at 11:17 AM, Marcel Moolenaar wrote:
>=20
> > Action items:
> >=20
> >>>> - vmspace should be referenced by vmspace_acquire_ref()
> >>>> - vm_map should be read-locked before iterating the map entries.
> >=20
> > I'll implement it and send a patch for review to avoid unnecessary
> > repository churn...
>=20
> Please review attached patch. I have a sample session of how
> a debugger can use the information (see XXX lines):
>=20
> hob% /usr/obj/nfs/bsddbg/trunk/bdb/bdb images/abort/abort
> [cursor=3D0x2000000000000560:0]
> bdb> run
> process 1539 created
> process 1539 stopped with signal 5
> XXX: 1: 0x2000000000000000-0x2000000000001fff, 5, 0 37 `/nfs/bsddbg/trunk=
/images/abort/abort`
> XXX: 2: 0x2000000000010000-0x2000000000011fff, 3, 0 0 ``
> XXX: 3: 0x2000000040010000-0x2000000040077fff, 5, 0 21 `/libexec/ld-elf.s=
o.1`
> XXX: 4: 0x2000000040086000-0x2000000040089fff, 3, 0x66000 21 `/libexec/ld=
-elf.so.1`
> XXX: 5: 0x200000004008a000-0x2000000040091fff, 3, 0 0 ``
> XXX: 6: 0x8000000000000000-0x800000000001ffff, 3, 0 0 ``
> XXX: 7: 0x9ffffffffffe0000-0x9fffffffffffffff, 3, 0 0 ``
>   0x200000004001c560: { // MFB;
> >         alloc   r2 =3D ar.pfs, 0x0, 0x3, 0x3, 0x0
>           nop.f   0x0
>           nop.b   0x0 ;;
>   }
> [cursor=3D0x200000004001c560:0]
> bdb> step
> process 1575 stopped with signal 5
>   0x200000004001c560: { // MFB;
>           alloc   r2 =3D ar.pfs, 0x0, 0x3, 0x3, 0x0
> >         nop.f   0x0
>           nop.b   0x0 ;;
>   }
> [cursor=3D0x200000004001c560:1]
> bdb> continue
> process 1539 stopped with signal 6
> XXX: 1: 0x2000000000000000-0x2000000000001fff, 5, 0 37 `/nfs/bsddbg/trunk=
/images/abort/abort`
> XXX: 2: 0x2000000000010000-0x2000000000011fff, 3, 0 0 ``
> XXX: 3: 0x2000000040010000-0x2000000040077fff, 5, 0 21 `/libexec/ld-elf.s=
o.1`
> XXX: 4: 0x200000004007e000-0x2000000040085fff, 3, 0x6000 0 ``
> XXX: 5: 0x2000000040086000-0x2000000040089fff, 3, 0x66000 21 `/libexec/ld=
-elf.so.1`
> XXX: 6: 0x200000004008a000-0x2000000040099fff, 3, 0 0 ``
> XXX: 7: 0x200000004009c000-0x20000000402e1fff, 5, 0 15 `/lib/libc.so.7`
> XXX: 8: 0x20000000402e2000-0x20000000402effff, 0, 0x246000 0 ``
> XXX: 9: 0x20000000402f0000-0x20000000402fdfff, 3, 0x244000 15 `/lib/libc.=
so.7`
> XXX: 10: 0x20000000402fe000-0x2000000040319fff, 3, 0x262000 0 ``
> XXX: 11: 0x2000000040328000-0x2000000040339fff, 3, 0xe000 0 ``
> XXX: 12: 0x8000000000000000-0x800000000001ffff, 3, 0 0 ``
> XXX: 13: 0x9ffffffffffe0000-0x9fffffffffffffff, 3, 0 0 ``
>   0x20000000402a0c40: { // MBB;
> >         cmp.eq  p0, p6 =3D r0, r10
>   (p6)    br.sptk.few 20000000400ded00
>           br.ret.sptk.few rp ;;
>   }
> [cursor=3D0x20000000402a0c40:0]
> bdb>=20

Vnode locks are before vm map locks in global lock order. vn_fullpath()
may need to lock vnodes to call VOP_VPTOCNP(). I think you should (and
can) drop both vm map lock and vmspace reference much earlier.

Would it be cleaner to use explicitely sized types for compat32
structure members ?

Comparing ptrace_vm_entry with kinfo_vmentry, I think that it might
be good idea to add fsid and inode number to ptrace_vm_entry, to
give at least some information when vn_fullpath failed.

--9+ohdFDUqiMJzwPo
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAktyeSoACgkQC3+MBN1Mb4hpNQCfZznT84jUVPvxedAC5ho2rrWV
AKIAoNpmf7HEP6/ZSCALTDz1cmmU1zvb
=YVn5
-----END PGP SIGNATURE-----

--9+ohdFDUqiMJzwPo--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100210091522.GW9991>