mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
signal.c: no sigsegv handler with valgrind
* signal.c: disable handling signals to dump core, if installing unreserved signals failed, not valgrind to hang on Mac OS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9f4db3bcdb
commit
a4d8a6e148
1 changed files with 9 additions and 7 deletions
16
signal.c
16
signal.c
|
@ -1386,10 +1386,13 @@ sig_list(void)
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define install_sighandler_fail(signame, signum) \
|
#define INSTALL_SIGHANDLER(cond, signame, signum) do { \
|
||||||
(reserved_signal_p(signum) ? \
|
static const char failed[] = "failed to install "signame" handler"; \
|
||||||
rb_bug("failed to install "signame" handler") : \
|
if (!(cond)) break; \
|
||||||
perror("failed to install "signame" handler"))
|
if (reserved_signal_p(signum)) rb_bug(failed); \
|
||||||
|
ruby_enable_coredump = 1; \
|
||||||
|
perror(failed); \
|
||||||
|
} while (0)
|
||||||
static int
|
static int
|
||||||
install_sighandler(int signum, sighandler_t handler)
|
install_sighandler(int signum, sighandler_t handler)
|
||||||
{
|
{
|
||||||
|
@ -1405,8 +1408,7 @@ install_sighandler(int signum, sighandler_t handler)
|
||||||
}
|
}
|
||||||
#ifndef __native_client__
|
#ifndef __native_client__
|
||||||
# define install_sighandler(signum, handler) \
|
# define install_sighandler(signum, handler) \
|
||||||
(install_sighandler(signum, handler) ? \
|
INSTALL_SIGHANDLER(install_sighandler(signum, handler), #signum, signum)
|
||||||
install_sighandler_fail(#signum, signum) : (void)0)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SIGCLD) || defined(SIGCHLD)
|
#if defined(SIGCLD) || defined(SIGCHLD)
|
||||||
|
@ -1427,7 +1429,7 @@ init_sigchld(int sig)
|
||||||
}
|
}
|
||||||
# ifndef __native_client__
|
# ifndef __native_client__
|
||||||
# define init_sigchld(signum) \
|
# define init_sigchld(signum) \
|
||||||
(init_sigchld(signum) ? install_sighandler_fail(#signum, signum) : (void)0)
|
INSTALL_SIGHANDLER(init_sigchld(signum), #signum, signum)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue