From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 23 21:31:35 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 176D716A4CE for ; Mon, 23 Aug 2004 21:31:35 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id C071C43D8A for ; Mon, 23 Aug 2004 21:31:34 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.11/8.12.11) id i7NLVXeH056503; Mon, 23 Aug 2004 16:31:33 -0500 (CDT) (envelope-from dan) Date: Mon, 23 Aug 2004 16:31:33 -0500 From: Dan Nelson To: Simon Barner Message-ID: <20040823213133.GC36920@dan.emsphone.com> References: <20040823210324.567ea3a3.flynn@energyhq.es.eu.org> <20040823200339.GA5717@zi025.glhnet.mhn.de> <20040823212138.GB36920@dan.emsphone.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="mojUlQ0s9EVzWg2t" Content-Disposition: inline In-Reply-To: <20040823212138.GB36920@dan.emsphone.com> X-OS: FreeBSD 5.3-BETA1 X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i 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: Mon, 23 Aug 2004 21:31:35 -0000 --mojUlQ0s9EVzWg2t Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In the last episode (Aug 23), Dan Nelson said: > --- coregrind/vg_proxylwp.c~ Mon Aug 23 15:47:33 2004 > +++ coregrind/vg_proxylwp.c Mon Aug 23 15:48:42 2004 And of course I screwed up the patch. The first argument of each print call should be printing &px->mutex, not px->mutex. Here's better output: ==52845== Memcheck, a memory error detector for x86-linux. ==52845== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward. ==52845== Using valgrind-2.1.2.CVS, a program supervision framework for x86-linux. ==52845== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward. ==52845== Locking#1 mutex 0xB82E4F78/0x0 ==52845== Done 0xB82E4F78/0x18820 ==52845== For more details, rerun with: -v ==52845== Mon Aug 23 16:30:27 CDT 2004 ==52845== ==52845== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ==52845== malloc/free: in use at exit: 4096 bytes in 1 blocks. ==52845== malloc/free: 1 allocs, 0 frees, 4096 bytes allocated. ==52845== For a detailed leak analysis, rerun with: --leak-check=yes ==52845== For counts of detected errors, rerun with: -v ==52845== Unlocking mutex 0xB82E4F78/0x18821 ==52845== Done 0xB82E4F78/0x18821 ==52845== Locking#2 mutex 0xB82E4F78/0x18821 ( send SIGKILL here ) zsh: 52845 killed valgrind --skin=memcheck date -- Dan Nelson dnelson@allantgroup.com --mojUlQ0s9EVzWg2t Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch-dn-umtxdebug --- 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); + VG_(message)(Vg_UserMsg, "Done %p/%p", &proxy->mutex, proxy->mutex.u_owner); + } if (status) *status = proxy->exitcode; --mojUlQ0s9EVzWg2t--