Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jun 2007 21:09:30 +0200
From:      Jean-Yves Lefort <jylefort@FreeBSD.org>
To:        freebsd-threads@FreeBSD.org
Subject:   broken signal handling
Message-ID:  <20070603210930.8fae0082.jylefort@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
--Signature=_Sun__3_Jun_2007_21_09_31_+0200_fShs=DO27a0.A+ir
Content-Type: multipart/mixed;
	boundary="Multipart=_Sun__3_Jun_2007_21_09_30_+0200_G=2o4AZVwFiBbXiw"


--Multipart=_Sun__3_Jun_2007_21_09_30_+0200_G=2o4AZVwFiBbXiw
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

When a stack overflow occurs, signal handlers are not run (6.2):

libpthread:

	$ cc -pthread -o test test.c
	$ ./test
	Bus error: 10 (core dumped)
	$ ./test thread
	Segmentation fault: 11 (core dumped)

libthr:

	$ cc -lthr -o test test.c
	$ ./test
	signal 10 occurred
	$ ./test thread
	Illegal instruction: 4 (core dumped)

As you can see, the appropriate signal handler is only run with
libthr, provided the stack overflow occurs in the main thread.

I don't know what POSIX has to say on this, but it would nevertheless
be desirable to fix the problem. FYI, it works on Linux 2.6.9.

--
Jean-Yves Lefort

jylefort@FreeBSD.org
http://lefort.be.eu.org/

--Multipart=_Sun__3_Jun_2007_21_09_30_+0200_G=2o4AZVwFiBbXiw--

--Signature=_Sun__3_Jun_2007_21_09_31_+0200_fShs=DO27a0.A+ir
Content-Type: application/pgp-signature

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

iD8DBQFGYxHyyzD7UaO4AGoRAlqPAJ4mm1NKxPzHBSqDv6By4bn81lr0QgCbBoNl
aXwCqsSd/dHOZMPMCrmjvPw=
=IHlS
-----END PGP SIGNATURE-----

--Signature=_Sun__3_Jun_2007_21_09_31_+0200_fShs=DO27a0.A+ir--



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