Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Oct 2002 16:50:45 +0300
From:      Peter Pentchev <roam@ringlet.net>
To:        Linus Kendall <linus@angliaab.se>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: PThreads problem
Message-ID:  <20021021135045.GB41198@straylight.oblivion.bg>
In-Reply-To: <20021021134834.GA41198@straylight.oblivion.bg>
References:  <1035200159.24315.13.camel@bilbo> <20021021124520.GS389@straylight.oblivion.bg> <1035206648.24315.20.camel@bilbo> <20021021134834.GA41198@straylight.oblivion.bg>

next in thread | previous in thread | raw e-mail | index | archive | help

--2B/JsCI69OhZNC5r
Content-Type: text/plain; charset=windows-1251
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Oct 21, 2002 at 04:48:34PM +0300, Peter Pentchev wrote:
> On Mon, Oct 21, 2002 at 03:24:08PM +0200, Linus Kendall wrote:
> > m?n 2002-10-21 klockan 14.45 skrev Peter Pentchev:
> > > On Mon, Oct 21, 2002 at 01:35:59PM +0200, Linus Kendall wrote:
> > > > Hi,
> > > >=20
> > > > I'm trying to port a heavily threaded application from Linux (Debian
> > > > 3.0, 2.4.19) to
> > > > FreeBSD (4.6-RELEASE). The program compiles successfully using gcc =
with
> > > > -pthreads. But, when I try to run the application I get the followi=
ng
> > > > error after a while (after spawning 11 threads):
> > > >=20
> > > > Fatal error 'siglongjmp()ing between thread contexts is undefined by
> > > > POSIX 1003.1' at line ? in file
> > > > /usr/src/lib/libc_r/uthread/uthread_jmp.c (errno =3D ?)
> > > > Abort trap - core dumped
> > > >=20
> > > > It always crashes at the same point. Under Linux it works perfectly
> > > > fine.
> > > > I also tried to compile with linuxthreads only to get a segfault
> > > > directly when the program tries to spawn the first thread.=20
> > > >=20
> > > > GCC version on Linux: 2.95.4 20011002
> > > > GCC version on FreeBSD: 2.95.3 20010315
> > > >=20
> > > > GCC/G++ command-line: g++ -g -Wall -I. `curl-config --cflags`=20
> > > > -fsjlj-exceptions -D_THREAD_SAFE -D_REENTRANT -pthread `curl-config
> > > > --libs`=20
> > >=20
> > > Just for the record: what exactly do 'curl-config --cflags' and
> > > 'curl-config --libs' output?
> >=20
> > Libcurl is an HTTP-library which is said to be threadsafe (and also
> > works normally under Linux).
>=20
> I know what libcurl is; as a matter of fact, I happen to be the
> maintainer of the ftp/curl port :)  That's partly the reason why I am
> interested in your problem, especially given what you report below..
>=20
> I was asking about the specific output of the compiler flags and the
> libraries that cURL reports as needed, to see if there were any
> conflicts there with any of the other compiler flags.
>=20
> > I've been looking at it and it seems that the problem was based on
> > the fact that libcurl triggers an SIGALARM which in Linux isn't a
> > problem but for which I needed to define a signal handler (ie. block)
> > in *BSD.
>=20
> This is interesting; can you produce a simple testcase?  If not, I will
> be able to take a look at it some time later today or tomorrow, but not
> right now :(

Oh BTW.. libcurl is indeed threadsafe, with a single exception,
mentioned in the THREADS section of the libcurl(3) manual page.. is
there any chance that this is related to the problem you are having?

G'luck,
Peter

--=20
Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
If this sentence were in Chinese, it would say something else.

--2B/JsCI69OhZNC5r
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (FreeBSD)

iD8DBQE9tAY17Ri2jRYZRVMRAthWAJ4gDiGrKF+jbb7rtkgJ2EzfXc+Z0ACfWij6
N2oLy9TQyvPE1aVRVtnECNc=
=OwrD
-----END PGP SIGNATURE-----

--2B/JsCI69OhZNC5r--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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