|
From: <sv...@va...> - 2005-07-08 18:25:15
|
Author: sewardj
Date: 2005-07-08 19:25:13 +0100 (Fri, 08 Jul 2005)
New Revision: 4135
Log:
Assertion-failure-avoiding hacks from Paul's tree. I don't know why
these are necessary, but they are.
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-07-08 18:24:04 UTC (rev 4134)
+++ trunk/coregrind/m_signals.c 2005-07-08 18:25:13 UTC (rev 4135)
@@ -446,7 +446,9 @@
=20
ksa.ksa_handler =3D skss.skss_per_sig[sig].skss_handler;
ksa.sa_flags =3D skss.skss_per_sig[sig].skss_flags;
+# if !defined(VGP_ppc32_linux)
ksa.sa_restorer =3D my_sigreturn;
+# endif
=20
/* block all signals in handler */
VG_(sigfillset)( &ksa.sa_mask );
@@ -473,8 +475,10 @@
=3D=3D skss_old.skss_per_sig[sig].skss_handler);
vg_assert(ksa_old.sa_flags=20
=3D=3D skss_old.skss_per_sig[sig].skss_flags);
+# if !defined(VGP_ppc32_linux)
vg_assert(ksa_old.sa_restorer=20
=3D=3D my_sigreturn);
+# endif
VG_(sigaddset)( &ksa_old.sa_mask, VKI_SIGKILL );
VG_(sigaddset)( &ksa_old.sa_mask, VKI_SIGSTOP );
vg_assert(VG_(isfullsigset)( &ksa_old.sa_mask ));
|
|
From: Paul M. <pa...@sa...> - 2005-07-09 00:49:49
|
sv...@va... writes: > Author: sewardj > Date: 2005-07-08 19:25:13 +0100 (Fri, 08 Jul 2005) > New Revision: 4135 > > Log: > Assertion-failure-avoiding hacks from Paul's tree. I don't know why > these are necessary, but they are. > +# if !defined(VGP_ppc32_linux) > ksa.sa_restorer = my_sigreturn; > +# endif > +# if !defined(VGP_ppc32_linux) > vg_assert(ksa_old.sa_restorer > == my_sigreturn); > +# endif The sa_restorer field is not used at all on ppc. Glibc converts the sigaction you give it into a kernel sigaction, but it doesn't put anything in the sa_restorer field. I don't know the relationship between ksa and ksa_old in the patch above, but that might explain it. Paul. |
|
From: Julian S. <js...@ac...> - 2005-07-09 10:48:26
|
Paul
> > Assertion-failure-avoiding hacks from Paul's tree.
Thanks for the clarification. Is recorded in the source now.
On a similar note, I spent ages chasing the bug fixed in r4139
(triple vs double mapping of executables). The fix works and your
tree has an equivalent check in, but it'd be nice to understand
why I'm getting these triple mappings on ppc. Could you clarify?
J
/* If this mapping is of the beginning of a file, isn't part of
Valgrind, is at least readable and seems to contain an object
file, then try reading symbols from it.
+
+ Getting this heuristic right is critical. On x86-linux,
+ objects are typically mapped twice:
+
+ 1b8fb000-1b8ff000 r-xp 00000000 08:02 4471477 vgpreload_memcheck.so
+ 1b8ff000-1b900000 rw-p 00004000 08:02 4471477 vgpreload_memcheck.so
+
+ whereas ppc32-linux mysteriously does this:
+
+ 118a6000-118ad000 r-xp 00000000 08:05 14209428 vgpreload_memcheck.so
+ 118ad000-118b6000 ---p 00007000 08:05 14209428 vgpreload_memcheck.so
+ 118b6000-118bd000 rwxp 00000000 08:05 14209428 vgpreload_memcheck.so
+
+ The third mapping should not be considered to have executable code in.
+ Therefore a test which works for both is: r and x and NOT w. Reading
+ symbols from the rwx segment -- which overlaps the r-x segment in the
+ file -- causes the redirection mechanism to redirect to addresses in
+ that third segment, which is wrong and causes crashes.
*/
|
|
From: Paul M. <pa...@sa...> - 2005-07-11 01:23:48
|
Julian Seward writes: > On a similar note, I spent ages chasing the bug fixed in r4139 > (triple vs double mapping of executables). The fix works and your > tree has an equivalent check in, but it'd be nice to understand > why I'm getting these triple mappings on ppc. Could you clarify? The short answer is that the ELF congruency is 64k on PPC compared to 4k on x86. This means that the end of the text and the start of the data are contiguous in the ELF file but separated by 64k in memory. The reason for the mapping with ---p permissions is to avoid leaving an unmapped hole in the middle. Paul. |