Date: Tue, 24 Aug 2004 21:29:50 +0200 From: Simon Barner <barner@in.tum.de> To: Dan Nelson <dnelson@allantgroup.com> Cc: freebsd-hackers@freebsd.org Subject: Re: valgrind on 5.3BETA1 Message-ID: <20040824192950.GA78484@zi025.glhnet.mhn.de> In-Reply-To: <20040823213133.GC36920@dan.emsphone.com> References: <20040823210324.567ea3a3.flynn@energyhq.es.eu.org> <20040823200339.GA5717@zi025.glhnet.mhn.de> <20040823212138.GB36920@dan.emsphone.com> <20040823213133.GC36920@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
> --- 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 = { .ss_flags = VKI_SS_DISABLE };
>
> #if __FreeBSD__ == 5
> + VG_(message)(Vg_UserMsg, "Locking#1 mutex %p/%p", &px->mutex, px->mutex.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 |= UMTX_CONTESTED;
> VG_(do_syscall)(__NR_thr_self, &px->lwp);
> @@ -943,6 +944,8 @@
> px->exitcode = ret;
>
> #if __FreeBSD__ == 5
> + VG_(message)(Vg_UserMsg, "Unlocking mutex %p/%p", &px->mutex, px->mutex.u_owner);
> ret = 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__ == 5
> if (block) {
> if(proxy->lwp != 0)
> + {
> + VG_(message)(Vg_UserMsg, "Locking#2 mutex %p/%p", &proxy->mutex, proxy->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...?
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);
> + }
>
> if (status)
> *status = proxy->exitcode;
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (FreeBSD)
iD8DBQFBK5cuCkn+/eutqCoRAjEeAKDfB4Fo/cfZFKCJlGCCmxq4NKn/UgCdEOhe
FIEqRbpiDmuWZ6tzQ8wJves=
=2hJm
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040824192950.GA78484>
