|
From: <sv...@va...> - 2005-11-13 00:01:29
|
Author: tom
Date: 2005-11-13 00:01:20 +0000 (Sun, 13 Nov 2005)
New Revision: 5105
Log:
Mask out the top 16 bits of si_code at the start of the signal
handlers because the kernel sometimes forgets to do so.
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_signals.c 2005-11-12 23:10:48 UTC (rev 5104)
+++ trunk/coregrind/m_signals.c 2005-11-13 00:01:20 UTC (rev 5105)
@@ -1354,6 +1354,14 @@
=20
vg_assert(tst->status =3D=3D VgTs_WaitSys);
=20
+#ifdef VGO_linux
+ /* The linux kernel uses the top 16 bits of si_code for it's own
+ use and only exports the bottom 16 bits to user space - at least
+ that is the theory, but it turns out that there are some kernels
+ around that forget to mask out the top 16 bits so we do it here. *=
/
+ info->si_code &=3D 0xffff;
+#endif
+
/* The thread isn't currently running, make it so before going on */
VG_(set_running)(tid);
=20
@@ -1463,6 +1471,14 @@
sigNo =3D=3D VKI_SIGILL ||
sigNo =3D=3D VKI_SIGTRAP);
=20
+#ifdef VGO_linux
+ /* The linux kernel uses the top 16 bits of si_code for it's own
+ use and only exports the bottom 16 bits to user space - at least
+ that is the theory, but it turns out that there are some kernels
+ around that forget to mask out the top 16 bits so we do it here. *=
/
+ info->si_code &=3D 0xffff;
+#endif
+
if (info->si_code <=3D VKI_SI_USER) {
/* If some user-process sent us one of these signals (ie,
they're not the result of a faulting instruction), then treat
|