ruby-changes:28350
From: charliesome <ko1@a...>
Date: Sun, 21 Apr 2013 21:35:34 +0900 (JST)
Subject: [ruby-changes:28350] charliesome:r40402 (trunk): * configure.in: Use sigsetjmp by default so jumping out of signal
charliesome 2013-04-21 21:35:23 +0900 (Sun, 21 Apr 2013) New Revision: 40402 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40402 Log: * configure.in: Use sigsetjmp by default so jumping out of signal handlers properly restores the signal mask and SS_ONSTACK flag. [ruby-core:54175] [Bug #8254] * configure.in: Manually check for presence of sigsetjmp. It is not a function on some systems, so AC_CHECK_FUNCS cannot be used. Modified files: trunk/ChangeLog trunk/configure.in Index: configure.in =================================================================== --- configure.in (revision 40401) +++ configure.in (revision 40402) @@ -1696,13 +1696,20 @@ AC_CHECK_FUNCS(fmod killpg wait4 waitpid https://github.com/ruby/ruby/blob/trunk/configure.in#L1696 setrgid setegid setregid setresgid issetugid pause lchown lchmod\ getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\ getpriority getrlimit setrlimit sysconf close getpwnam_r getgrnam_r\ - dlopen sigprocmask sigaction sigsetjmp _setjmp _longjmp\ + dlopen sigprocmask sigaction _setjmp _longjmp\ getsid setsid telldir seekdir fchmod cosh sinh tanh log2 round llabs\ setuid setgid daemon select_large_fdset setenv unsetenv\ mktime timegm gmtime_r clock_gettime gettimeofday poll ppoll\ pread sendfile shutdown sigaltstack dl_iterate_phdr\ dup dup3 pipe2 posix_memalign memalign ioctl) +AC_CACHE_CHECK(for sigsetjmp as a macro or function, ac_cv_func_sigsetjmp, + [AC_TRY_COMPILE([ +#include <setjmp.h> +], [sigjmp_buf env; sigsetjmp(env,1);], + ac_cv_func_sigsetjmp=yes, + ac_cv_func_sigsetjmp=no)]) + AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value, [AC_TRY_COMPILE([ #include <stdlib.h> @@ -1738,12 +1745,12 @@ if test ${setjmp_prefix+set}; then https://github.com/ruby/ruby/blob/trunk/configure.in#L1745 if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp = no; then AC_MSG_ERROR(${setjmp_prefix}setjmp is not available) fi +elif test "$ac_cv_func_sigsetjmp" = yes; then + AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig]) elif test "$ac_cv_func___builtin_setjmp" = yes; then setjmp_prefix=__builtin_ elif test "$ac_cv_func__setjmp" = yes; then setjmp_prefix=_ -elif test "$ac_cv_func_sigsetjmp" = yes; then - AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig]) else setjmp_prefix= fi @@ -1753,7 +1760,7 @@ else https://github.com/ruby/ruby/blob/trunk/configure.in#L1760 unset setjmp_sigmask fi AC_MSG_RESULT(${setjmp_prefix}setjmp) -AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp(env${setjmp_sigmask+,0})]) +AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp(env${setjmp_sigmask+,1})]) AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)]) AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf) Index: ChangeLog =================================================================== --- ChangeLog (revision 40401) +++ ChangeLog (revision 40402) @@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Apr 21 21:35:00 2013 Charlie Somerville <charlie@c...> + + * configure.in: Use sigsetjmp by default so jumping out of signal + handlers properly restores the signal mask and SS_ONSTACK flag. + [ruby-core:54175] [Bug #8254] + + * configure.in: Manually check for presence of sigsetjmp. It is not a + function on some systems, so AC_CHECK_FUNCS cannot be used. + Sun Apr 21 08:00:55 2013 Tanaka Akira <akr@f...> * test/csv/test_features.rb, test/logger/test_logger.rb -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/