Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 May 2003 19:29:37 -0400 (EDT)
From:      Daniel Eischen <eischen@pcnet5.pcnet.com>
To:        Petri Helenius <pete@he.iki.fi>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: malloc(): error: recursive call
Message-ID:  <Pine.GSO.4.10.10305271924010.1039-100000@pcnet5.pcnet.com>
In-Reply-To: <038a01c32495$6a1e17f0$812a40c1@PETEX31>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 28 May 2003, Petri Helenius wrote:

> >And what does `ldd libnetsnmp.so.x`, `ldd libfoo.y`, show?
>=20
> They give empty replies.
>=20
> >What is `ldd yourexecutable` show?
>=20
> It=B4s usually linked static but if I remove the -static line it says:
>        libnetsnmp.so.5 =3D> /usr/local/lib/libnetsnmp.so.5 (0x2807f000)
>         libcrypto.so.3 =3D> /usr/lib/libcrypto.so.3 (0x280fe000)
>         libpcap.so.2 =3D> /usr/lib/libpcap.so.2 (0x28209000)
>         libkse.so.1 =3D> /usr/lib/libkse.so.1 (0x28225000)
>         libc.so.5 =3D> /usr/lib/libc.so.5 (0x28246000)
>=20
> >malloc is thread safe and we've been using it fine
> >with all our tests.  I suspect you're using another
> >library that is using libc_r or something.
>=20
> malloc works for me with for example linuxthreads. So I do believe that
> the the trigger for malloc locking works, however looking at the code,
> spinlocks are implemented differently depending on which thread library i=
s
> linked in.

Also, you do need a relatively recent kernel.  There are
a couple of flags in each thread's mailbox that the
kernel needs to recognize.  This change was committed
to the kernel around April 21, 2003

--=20
Dan Eischen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10305271924010.1039-100000>