From owner-freebsd-stable@FreeBSD.ORG Fri Apr 25 20:17:42 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 680B2106566B for ; Fri, 25 Apr 2008 20:17:42 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from hs-out-0708.google.com (hs-out-0708.google.com [64.233.178.249]) by mx1.freebsd.org (Postfix) with ESMTP id 1F5A48FC17 for ; Fri, 25 Apr 2008 20:17:41 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by hs-out-0708.google.com with SMTP id m63so3065430hsc.11 for ; Fri, 25 Apr 2008 13:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; bh=OaM741LbohAL3v+v+BWA4bjF4ZZ+f2OMhi5QgOOe8/0=; b=GcD4cRWTnsG52jygkgA7re2iFOuPS2YlHibWeNUVGQzxT+cl6wV/5CgpuPbyRUWY/V6XeGMOuxgahiGCe7bsPnhScT+TVK8iQnLeTsvKon0sE61J9IjYwjTzXI/7v2l6OlTvWgdvdZu6lEOb3WE5bW/Oi0bUhRUZXLoVLkoT1lA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type; b=Gm3PVUJ99n1jgH5thQ8to9WnzYBqNEzYO28MSwNsA6QOavo8V8aNHVWlaYhYA+kUfJFvFXQaWAYz2sB6t+k+nLJ0CyI1MGkGIvdxaAkjtONQbXlLu+2QB+8bPCGt3NtW0hO0/tnriyC4bwMpQ+CrPShFmuCSSOMSWHC2uRbqd6g= Received: by 10.90.113.11 with SMTP id l11mr6142355agc.65.1209153149492; Fri, 25 Apr 2008 12:52:29 -0700 (PDT) Received: from kan.dnsalias.net ( [24.218.183.247]) by mx.google.com with ESMTPS id 7sm2873708agb.12.2008.04.25.12.52.25 (version=SSLv3 cipher=OTHER); Fri, 25 Apr 2008 12:52:26 -0700 (PDT) Date: Fri, 25 Apr 2008 15:52:19 -0400 From: Alexander Kabaev To: Krassimir Slavchev Message-ID: <20080425155219.2a9526d4@kan.dnsalias.net> In-Reply-To: <48104D14.8000400@bulinfo.net> References: <48104D14.8000400@bulinfo.net> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/n6s3P3t6BV.HkHYi.HeKdiQ"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: FreeBSD Subject: Re: threads cleanup? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 20:17:42 -0000 --Sig_/n6s3P3t6BV.HkHYi.HeKdiQ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 24 Apr 2008 12:04:20 +0300 Krassimir Slavchev wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > Hello, >=20 > Most probably I missed something. > I have problems with threads cleanup. Here are output of valgrind and > simple test program: >=20 > ... > =3D=3D78317=3D=3D ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 = from > 0) =3D=3D78317=3D=3D malloc/free: in use at exit: 4108 bytes in 2 blocks. > =3D=3D78317=3D=3D malloc/free: 5 allocs, 3 frees, 4324 bytes allocated. > =3D=3D78317=3D=3D > =3D=3D78317=3D=3D searching for pointers to 2 not-freed blocks. > =3D=3D78317=3D=3D checked 1468040 bytes. > =3D=3D78317=3D=3D > =3D=3D78317=3D=3D 12 bytes in 1 blocks are still reachable in loss record= 1 > of 2 =3D=3D78317=3D=3D at 0x3C038183: malloc (in > /usr/local/lib/valgrind/vgpreload_memcheck.so) > =3D=3D78317=3D=3D by 0x3C03F8D0: > (within /usr/local/lib/valgrind/libthr.so.2) =3D=3D78317=3D=3D by > 0x3C040F49: pthread_mutex_init > (in /usr/local/lib/valgrind/libthr.so.2) =3D=3D78317=3D=3D by 0x3C040F= A9: > pthread_mutex_lock (in /usr/local/lib/valgrind/libthr.so.2) > =3D=3D78317=3D=3D > =3D=3D78317=3D=3D > =3D=3D78317=3D=3D 4096 bytes in 1 blocks are still reachable in loss reco= rd 2 > of 2 =3D=3D78317=3D=3D at 0x3C038183: malloc (in > /usr/local/lib/valgrind/vgpreload_memcheck.so) > =3D=3D78317=3D=3D by 0x3C121AE5: __smakebuf (in /lib/libc.so.6) > =3D=3D78317=3D=3D by 0x3C1219B0: __swsetup (in /lib/libc.so.6) > =3D=3D78317=3D=3D by 0x3C11789B: __vfprintf (in /lib/libc.so.6) > ... You definitely need deeper stacktrace to see where mutexes are allocated. Info above says nothing otherwise. Also, note that when running threaded programs under valgrind you are testing valgrind's own threading library implementatiion, not 'real' libthr. --=20 Alexander Kabaev --Sig_/n6s3P3t6BV.HkHYi.HeKdiQ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iD8DBQFIEjZzQ6z1jMm+XZYRApD5AJ9xHOqHMuSMRAFSSLfmPKYdTMBmTgCgygwF xk6o8FoyfV7sVSNhia3IlnI= =lOCF -----END PGP SIGNATURE----- --Sig_/n6s3P3t6BV.HkHYi.HeKdiQ--