|
From: <sv...@va...> - 2015-07-31 06:58:23
|
Author: florian
Date: Fri Jul 31 07:58:16 2015
New Revision: 15462
Log:
Fix testcase such that it can be run under cron on Solaris.
The tescase depends on SIGHUP to be delivered but cron on Solaris
ignored the signal. So it needs to be enabled in child processes
after fork.
Patch by Ivo Raisr <iv...@iv...>. Fixes BZ #350809.
Modified:
trunk/NEWS
trunk/none/tests/async-sigs.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Fri Jul 31 07:58:16 2015
@@ -269,6 +269,7 @@
349874 Fix typos in source code
349828 memcpy intercepts memmove causing src/dst overlap error (ppc64 ld.so)
349941 di_notify_mmap might create wrong start/size DebugInfoMapping
+350809 Fix none/tests/async-sigs for Solaris
350811 Remove reference to --db-attach which has been removed.
n-i-bz Provide implementations of certain compiler builtins to support
compilers who may not provide those
Modified: trunk/none/tests/async-sigs.c
==============================================================================
--- trunk/none/tests/async-sigs.c (original)
+++ trunk/none/tests/async-sigs.c Fri Jul 31 07:58:16 2015
@@ -22,6 +22,15 @@
{
}
+static void install_handler(int sig, void (*sig_handler)(int))
+{
+ struct sigaction sa;
+ sa.sa_handler = sig_handler;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ sigaction(sig, &sa, 0);
+}
+
/* Kill our child, but use a separate kill command. This is so that
it's running independently of Valgrind, and so is async with
respect to thread scheduling. */
@@ -87,11 +96,7 @@
// - otherwise, wait in client code (by spinning).
// The alarm() calls is so that if something breaks, we don't get stuck.
if (pid == 0) {
- struct sigaction sa;
- sa.sa_handler = handler;
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = 0;
- sigaction(caughtsig, &sa, 0);
+ install_handler(caughtsig, handler);
alarm(10);
for (;;)
@@ -130,6 +135,9 @@
int main()
{
+ /* Restore default behaviour of SIGHUP when forked from cron. */
+ install_handler(SIGHUP, SIG_DFL);
+
test(/*non-blocked*/0, /* sync*/SIGSEGV, /* sync*/SIGBUS);
test(/*non-blocked*/0, /* sync*/SIGSEGV, /*async*/SIGHUP);
test(/*non-blocked*/0, /*async*/SIGUSR1, /* sync*/SIGBUS);
|