From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 24 19:29:46 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13BA316A4CE for ; Tue, 24 Aug 2004 19:29:46 +0000 (GMT) Received: from mailout1.informatik.tu-muenchen.de (mailout1.informatik.tu-muenchen.de [131.159.0.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDA1143D49 for ; Tue, 24 Aug 2004 19:29:45 +0000 (GMT) (envelope-from barner@in.tum.de) Received: by zi025.glhnet.mhn.de (Postfix, from userid 1000) id EBAB9C1B9; Tue, 24 Aug 2004 21:29:50 +0200 (CEST) Date: Tue, 24 Aug 2004 21:29:50 +0200 From: Simon Barner To: Dan Nelson Message-ID: <20040824192950.GA78484@zi025.glhnet.mhn.de> References: <20040823210324.567ea3a3.flynn@energyhq.es.eu.org> <20040823200339.GA5717@zi025.glhnet.mhn.de> <20040823212138.GB36920@dan.emsphone.com> <20040823213133.GC36920@dan.emsphone.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline In-Reply-To: <20040823213133.GC36920@dan.emsphone.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new/sophie/sophos at mailrelay1.informatik.tu-muenchen.de cc: freebsd-hackers@freebsd.org Subject: Re: valgrind on 5.3BETA1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2004 19:29:46 -0000 --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > --- coregrind/vg_proxylwp.c~ Mon Aug 23 15:47:33 2004 > +++ coregrind/vg_proxylwp.c Mon Aug 23 15:48:42 2004 > @@ -596,6 +596,8 @@ > static const vki_kstack_t ss =3D { .ss_flags =3D VKI_SS_DISABLE }; > =20 > #if __FreeBSD__ =3D=3D 5 > + VG_(message)(Vg_UserMsg, "Locking#1 mutex %p/%p", &px->mutex, px->mut= ex.u_owner); > VG_(do_syscall)(__NR__umtx_lock, &px->mutex); > + VG_(message)(Vg_UserMsg, "Done %p/%p", &px->mutex, px->mutex.u_owner); > px->mutex.u_owner |=3D UMTX_CONTESTED; > VG_(do_syscall)(__NR_thr_self, &px->lwp); > @@ -943,6 +944,8 @@ > px->exitcode =3D ret; > =20 > #if __FreeBSD__ =3D=3D 5 > + VG_(message)(Vg_UserMsg, "Unlocking mutex %p/%p", &px->mutex, px->mut= ex.u_owner); > ret =3D VG_(do_syscall)(__NR__umtx_unlock, &px->mutex); > + VG_(message)(Vg_UserMsg, "Done %p/%p", &px->mutex, px->mutex.u_owner); > if (use_rfork) > VG_(do_syscall)(__NR_exit, 0); > @@ -1171,7 +1173,11 @@ > #if __FreeBSD__ =3D=3D 5 > if (block) { > if(proxy->lwp !=3D 0) > + { > + VG_(message)(Vg_UserMsg, "Locking#2 mutex %p/%p", &proxy->mutex, pro= xy->mutex.u_owner); > VG_(do_syscall)(__NR__umtx_lock, &proxy->mutex); ^^^^^^^^^^^^^^^^ Commenting out this lock operation works for me. Did you notice that there are two places where the lock is acquired, and only one, where it is released? Perhaps the right solution would be to add another unlock operation...? =20 Of course, I have no idea of valgrind internals, threading implementation on FreeBSD, umtx, etc. ;-D > + VG_(message)(Vg_UserMsg, "Done %p/%p", &proxy->mutex, proxy->mutex.u= _owner); > + } > =20 > if (status) > *status =3D proxy->exitcode; --T4sUOijqQbZv57TR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (FreeBSD) iD8DBQFBK5cuCkn+/eutqCoRAjEeAKDfB4Fo/cfZFKCJlGCCmxq4NKn/UgCdEOhe FIEqRbpiDmuWZ6tzQ8wJves= =2hJm -----END PGP SIGNATURE----- --T4sUOijqQbZv57TR--