Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Apr 2008 15:52:19 -0400
From:      Alexander Kabaev <kabaev@gmail.com>
To:        Krassimir Slavchev <krassi@bulinfo.net>
Cc:        FreeBSD <freebsd-stable@freebsd.org>
Subject:   Re: threads cleanup?
Message-ID:  <20080425155219.2a9526d4@kan.dnsalias.net>
In-Reply-To: <48104D14.8000400@bulinfo.net>
References:  <48104D14.8000400@bulinfo.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <krassi@bulinfo.net> 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--



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