|
From: <sv...@va...> - 2014-11-21 11:50:27
|
Author: sewardj
Date: Fri Nov 21 11:50:20 2014
New Revision: 14742
Log:
Fix up assertions that were failing due to differences in BGQ/CNK signal
handling as compared to Linux.
Modified:
branches/VALGRIND_3_8_BRANCH_BGQ/coregrind/m_signals.c
Modified: branches/VALGRIND_3_8_BRANCH_BGQ/coregrind/m_signals.c
==============================================================================
--- branches/VALGRIND_3_8_BRANCH_BGQ/coregrind/m_signals.c (original)
+++ branches/VALGRIND_3_8_BRANCH_BGQ/coregrind/m_signals.c Fri Nov 21 11:50:20 2014
@@ -959,17 +959,39 @@
if (!force_update) {
vg_assert(ksa_old.ksa_handler
== skss_old.skss_per_sig[sig].skss_handler);
+
+# if defined(VGPV_ppc64_linux_bgq)
+ /* BGQ/CNK ignores all requests for SA_RESTART, SA_RESTORER
+ and SA_SIGINFO, so we don't expect to see them in the old
+ signal state. */
+ vg_assert(ksa_old.sa_flags
+ == (skss_old.skss_per_sig[sig].skss_flags
+ & ~(VKI_SA_RESTART | VKI_SA_RESTORER | VKI_SA_SIGINFO)));
+# else
vg_assert(ksa_old.sa_flags
== skss_old.skss_per_sig[sig].skss_flags);
-# if !defined(VGP_ppc32_linux) && \
- !defined(VGP_x86_darwin) && !defined(VGP_amd64_darwin) && \
- !defined(VGP_mips32_linux)
+# endif
+
+# if defined(VGPV_ppc64_linux_bgq)
+ /* Similarly, BGQ/CNK ignores restorers. */
+ vg_assert(ksa_old.sa_restorer == NULL);
+# elif !defined(VGP_ppc32_linux) && \
+ !defined(VGP_x86_darwin) && !defined(VGP_amd64_darwin) && \
+ !defined(VGP_mips32_linux)
vg_assert(ksa_old.sa_restorer
== my_sigreturn);
# endif
+
+# if defined(VGPV_ppc64_linux_bgq)
+ /* And .. it appears .. BGQ/CNK ignores requests to block
+ signals in handlers. Hence this. */
+ vg_assert(VG_(isemptysigset)( &ksa_old.sa_mask ));
+# else
+ VG_(printf)("set 0x%llx\n", (ULong)ksa_old.sa_mask.sig[0]);
VG_(sigaddset)( &ksa_old.sa_mask, VKI_SIGKILL );
VG_(sigaddset)( &ksa_old.sa_mask, VKI_SIGSTOP );
vg_assert(VG_(isfullsigset)( &ksa_old.sa_mask ));
+# endif
}
}
}
|