Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Clearing the direction flag before calling a signal handler

0 views
Skip to first unread message

Peter Schuller

unread,
Mar 15, 2008, 1:51:10 PM3/15/08
to
--nextPart1813524.mtosFE0k8S
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hello,

I found an exchange concerning a difficult to debug problem that may be=20
affecting FreeBSD. I wasn't sure whether to post here or just file a bug, b=
ut=20
under the circumstances I opted for the former. Apologies if it is consider=
ed=20
noise.

I was reading the exchange here:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D469058

Referencing the following patch to Linux;

http://lkml.org/lkml/2008/3/5/306

The exchange in the Debian bug tracker indicates kfreebsd 6/7 has the same=
=20
problem as Linux. Being a kernel issue, that indicates vanilla FreeBSD may=
=20
likely be affected.

I neither have the setup nor the knowledge to effectively evaluate this=20
myself, but felt that it was obscure/diagnostically difficult enough that i=
=20
wanted to bring it to somebody's attention.

=2D-=20
/ Peter Schuller

PGP userID: 0xE9758B7D or 'Peter Schuller <peter.s...@infidyne.com>'
Key retrieval: Send an E-Mail to getp...@scode.org
E-Mail: peter.s...@infidyne.com Web: http://www.scode.org


--nextPart1813524.mtosFE0k8S
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQBH3AzEDNor2+l1i30RAiCTAJ9p2/2G5aXPjJWHQE6GAcGa57mDgQCgoh1X
ZBH3oMkYMjPjL/OYQZgWwgI=
=UrtT
-----END PGP SIGNATURE-----

--nextPart1813524.mtosFE0k8S--

Erik Trulsson

unread,
Mar 15, 2008, 2:14:59 PM3/15/08
to
On Sat, Mar 15, 2008 at 06:51:53PM +0100, Peter Schuller wrote:
> Hello,
>
> I found an exchange concerning a difficult to debug problem that may be
> affecting FreeBSD. I wasn't sure whether to post here or just file a bug, but
> under the circumstances I opted for the former. Apologies if it is considered
> noise.
>
> I was reading the exchange here:
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=469058

>
> Referencing the following patch to Linux;
>
> http://lkml.org/lkml/2008/3/5/306
>
> The exchange in the Debian bug tracker indicates kfreebsd 6/7 has the same
> problem as Linux. Being a kernel issue, that indicates vanilla FreeBSD may
> likely be affected.
>
> I neither have the setup nor the knowledge to effectively evaluate this
> myself, but felt that it was obscure/diagnostically difficult enough that i
> wanted to bring it to somebody's attention.
>

There was also a long discussion on the gcc developers list about this
issue recently.

It seems to already have been taken care of in FreeBSD by the following
commit to -CURRENT:

kib 2008-03-13 10:54:38 UTC

FreeBSD src repository

Modified files:
sys/amd64/amd64 machdep.c
sys/amd64/ia32 ia32_signal.c
sys/amd64/linux32 linux32_sysvec.c
sys/i386/i386 machdep.c
sys/i386/linux linux_sysvec.c
sys/i386/svr4 svr4_machdep.c
sys/pc98/pc98 machdep.c
Log:
Since version 4.3, gcc changed its behaviour concerning the i386/amd64
ABI and the direction flag, that is it now assumes that the direction
flag is cleared at the entry of a function and it doesn't clear once
more if needed. This new behaviour conforms to the i386/amd64 ABI.

Modify the signal handler frame setup code to clear the DF {e,r}flags
bit on the amd64/i386 for the signal handlers.

jhb@ noted that it might break old apps if they assumed DF == 1 would be
preserved in the signal handlers, but that such apps should be rare and
that older versions of gcc would not generate such apps.

Submitted by: Aurelien Jarno <aurelien aurel32 net>
PR: 121422
Reviewed by: jhb
MFC after: 2 weeks

--
<Insert your favourite quote here.>
Erik Trulsson
ertr...@student.uu.se
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

0 new messages