Change 33454 by [EMAIL PROTECTED] on 2008/03/08 23:09:00

        Revert all of the changes in 28115 related to changing the signal
        handler take variable arguments (so as to support POSIX SA_SIGINFO)
        as for some reason it causes nasal daemon leakage on some 64 bit
        platforms, and I conclude that integrating the fix (change 32012) isn't
        viable on maint, as it involves changing (or at least fudging) too
        many types, variables, pointers, and pointers to functions.
        I infer that the changes rolled back are 25200, 25203, 25207, 25240,
        25976, 25977 and 25980. (although some of the casts remain).

Affected files ...

... //depot/maint-5.8/perl/embed.fnc#245 edit
... //depot/maint-5.8/perl/embed.h#186 edit
... //depot/maint-5.8/perl/ext/POSIX/POSIX.pod#21 edit
... //depot/maint-5.8/perl/ext/POSIX/t/sigaction.t#7 edit
... //depot/maint-5.8/perl/global.sym#79 edit
... //depot/maint-5.8/perl/iperlsys.h#8 edit
... //depot/maint-5.8/perl/mg.c#163 edit
... //depot/maint-5.8/perl/perl.c#229 edit
... //depot/maint-5.8/perl/perl.h#179 edit
... //depot/maint-5.8/perl/perlvars.h#25 edit
... //depot/maint-5.8/perl/proto.h#234 edit

Differences ...

==== //depot/maint-5.8/perl/embed.fnc#245 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#244~33422~   2008-03-03 11:18:36.000000000 -0800
+++ perl/embed.fnc      2008-03-08 15:09:00.000000000 -0800
@@ -762,12 +762,8 @@
 #endif
 EXp    |void   |setdefout      |NULLOK GV* gv
 Ap     |HEK*   |share_hek      |NN const char* str|I32 len|U32 hash
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-nop    |Signal_t |sighandler_va|int sig|...
-Anop   |Signal_t |csighandler_va|int sig|...
-#endif
-nop    |Signal_t |sighandler   |int sig
-Anop   |Signal_t |csighandler  |int sig
+np     |Signal_t |sighandler   |int sig
+Anp    |Signal_t |csighandler  |int sig
 Ap     |SV**   |stack_grow     |NN SV** sp|NN SV** p|int n
 Ap     |I32    |start_subparse |I32 is_format|U32 flags
 p      |void   |sub_crush_depth|NN CV* cv

==== //depot/maint-5.8/perl/embed.h#186 (text+w) ====
Index: perl/embed.h
--- perl/embed.h#185~33421~     2008-03-03 10:51:59.000000000 -0800
+++ perl/embed.h        2008-03-08 15:09:00.000000000 -0800
@@ -792,8 +792,10 @@
 #define setdefout              Perl_setdefout
 #endif
 #define share_hek              Perl_share_hek
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
+#ifdef PERL_CORE
+#define sighandler             Perl_sighandler
 #endif
+#define csighandler            Perl_csighandler
 #define stack_grow             Perl_stack_grow
 #define start_subparse         Perl_start_subparse
 #ifdef PERL_CORE
@@ -2926,12 +2928,10 @@
 #define setdefout(a)           Perl_setdefout(aTHX_ a)
 #endif
 #define share_hek(a,b,c)       Perl_share_hek(aTHX_ a,b,c)
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-#ifdef PERL_CORE
-#endif
-#endif
 #ifdef PERL_CORE
+#define sighandler             Perl_sighandler
 #endif
+#define csighandler            Perl_csighandler
 #define stack_grow(a,b,c)      Perl_stack_grow(aTHX_ a,b,c)
 #define start_subparse(a,b)    Perl_start_subparse(aTHX_ a,b)
 #ifdef PERL_CORE

==== //depot/maint-5.8/perl/ext/POSIX/POSIX.pod#21 (text) ====
Index: perl/ext/POSIX/POSIX.pod
--- perl/ext/POSIX/POSIX.pod#20~33204~  2008-02-02 10:16:39.000000000 -0800
+++ perl/ext/POSIX/POSIX.pod    2008-03-08 15:09:00.000000000 -0800
@@ -1131,35 +1131,6 @@
 SIGHUP), not a string (like "SIGHUP"), though Perl does try hard
 to understand you.
 
-If you use the SA_SIGINFO flag, the signal handler will in addition to
-the first argument, the signal name, also receive a second argument, a
-hash reference, inside which are the following keys with the following
-semantics, as defined by POSIX/SUSv3:
-
-    signo       the signal number
-    errno       the error number
-    code        if this is zero or less, the signal was sent by
-                a user process and the uid and pid make sense,
-                otherwise the signal was sent by the kernel
-
-The following are also defined by POSIX/SUSv3, but unfortunately
-not very widely implemented:
-
-    pid         the process id generating the signal
-    uid         the uid of the process id generating the signal
-    status      exit value or signal for SIGCHLD
-    band        band event for SIGPOLL
-
-A third argument is also passed to the handler, which contains a copy
-of the raw binary contents of the siginfo structure: if a system has
-some non-POSIX fields, this third argument is where to unpack() them
-from.
-
-Note that not all siginfo values make sense simultaneously (some are
-valid only for certain signals, for example), and not all values make
-sense from Perl perspective, you should to consult your system's
-C<sigaction> and possibly also C<siginfo> documentation.
-
 =item siglongjmp
 
 siglongjmp() is C-specific: use L<perlfunc/die> instead.

==== //depot/maint-5.8/perl/ext/POSIX/t/sigaction.t#7 (text) ====
Index: perl/ext/POSIX/t/sigaction.t
--- perl/ext/POSIX/t/sigaction.t#6~28115~       2006-05-06 17:03:20.000000000 
-0700
+++ perl/ext/POSIX/t/sigaction.t        2008-03-08 15:09:00.000000000 -0800
@@ -16,7 +16,7 @@
        }
 }
 
-use Test::More tests => 31;
+use Test::More tests => 30;
 
 use strict;
 use vars qw/$bad $bad7 $ok10 $bad18 $ok/;
@@ -194,17 +194,6 @@
     is($sigrtmin, 1, "SIGRTMIN handler works");
 }
 
-SKIP: {
-    eval 'use POSIX qw(SA_SIGINFO); SA_SIGINFO';
-    skip("no SA_SIGINFO", 1) if $@;
-    sub hiphup {
-       is($_[1]->{signo}, SIGHUP, "SA_SIGINFO got right signal");
-    }
-    my $act = POSIX::SigAction->new('hiphup', 0, SA_SIGINFO);
-    sigaction(SIGHUP, $act);
-    kill 'HUP', $$;
-}
-
 eval { sigaction(-999, "foo"); };
 like($@, qr/Negative signals/,
     "Prevent negative signals instead of core dumping");

==== //depot/maint-5.8/perl/global.sym#79 (text+w) ====
Index: perl/global.sym
--- perl/global.sym#78~33217~   2008-02-02 14:47:50.000000000 -0800
+++ perl/global.sym     2008-03-08 15:09:00.000000000 -0800
@@ -447,7 +447,6 @@
 Perl_screaminstr
 Perl_setdefout
 Perl_share_hek
-Perl_csighandler_va
 Perl_csighandler
 Perl_stack_grow
 Perl_start_subparse

==== //depot/maint-5.8/perl/iperlsys.h#8 (text) ====
Index: perl/iperlsys.h
--- perl/iperlsys.h#7~33204~    2008-02-02 10:16:39.000000000 -0800
+++ perl/iperlsys.h     2008-03-08 15:09:00.000000000 -0800
@@ -51,11 +51,7 @@
 #include "perlio.h"
 
 #ifndef Sighandler_t
-#  if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-typedef Signal_t (*Sighandler_t) (int, ...);
-#  else
 typedef Signal_t (*Sighandler_t) (int);
-#  endif
 #endif
 
 #if defined(PERL_IMPLICIT_SYS)

==== //depot/maint-5.8/perl/mg.c#163 (text) ====
Index: perl/mg.c
--- perl/mg.c#162~33424~        2008-03-03 11:47:15.000000000 -0800
+++ perl/mg.c   2008-03-08 15:09:00.000000000 -0800
@@ -55,9 +55,6 @@
 #  include <sys/pstat.h>
 #endif
 
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-Signal_t Perl_csighandler_va(int sig, ...);
-#endif
 Signal_t Perl_csighandler(int sig);
 
 /* if you only have signal() and it resets on each signal, 
FAKE_PERSISTENT_SIGNAL_HANDLERS fixes */
@@ -1351,26 +1348,13 @@
 }
 
 Signal_t
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-Perl_csighandler(int sig)
-{
-    Perl_csighandler_va(sig);
-}
-
-Signal_t
-Perl_csighandler_va(int sig, ...)
-#else
 Perl_csighandler(int sig)
-#endif
 {
 #ifdef PERL_GET_SIG_CONTEXT
     dTHXa(PERL_GET_SIG_CONTEXT);
 #else
     dTHX;
 #endif
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-   va_list args;
-#endif
 #ifdef FAKE_PERSISTENT_SIGNAL_HANDLERS
     (void) rsignal(sig, PL_csighandlerp);
     if (PL_sig_ignoring[sig]) return;
@@ -1383,9 +1367,6 @@
             exit(1);
 #endif
 #endif
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-   va_start(args, sig);
-#endif
    if (
 #ifdef SIGILL
           sig == SIGILL ||
@@ -1402,9 +1383,6 @@
        (*PL_sighandlerp)(sig);
    else
        S_raise_signal(aTHX_ sig);
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-   va_end(args);
-#endif
 }
 
 #if defined(FAKE_PERSISTENT_SIGNAL_HANDLERS) || 
defined(FAKE_DEFAULT_SIGNAL_HANDLERS)
@@ -2773,17 +2751,7 @@
 #endif
 
 Signal_t
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-Perl_sighandler(int sig)
-{
-    Perl_sighandler_va(sig);
-}
-
-Signal_t
-Perl_sighandler_va(int sig, ...)
-#else
 Perl_sighandler(int sig)
-#endif
 {
 #ifdef PERL_GET_SIG_CONTEXT
     dTHXa(PERL_GET_SIG_CONTEXT);
@@ -2859,40 +2827,6 @@
     PUSHSTACKi(PERLSI_SIGNAL);
     PUSHMARK(SP);
     PUSHs(sv);
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-    {
-        struct sigaction oact;
-
-        if (sigaction(sig, 0, &oact) == 0 && oact.sa_flags & SA_SIGINFO) {
-             siginfo_t *sip;
-             va_list args;
-
-             va_start(args, sig);
-             sip = (siginfo_t*)va_arg(args, siginfo_t*);
-             if (sip) {
-                  HV *sih = newHV();
-                  SV *rv  = newRV_noinc((SV*)sih);
-                  /* The siginfo fields signo, code, errno, pid, uid,
-                   * addr, status, and band are defined by POSIX/SUSv3. */
-                  (void)hv_stores(sih, "signo", newSViv(sip->si_signo));
-                  (void)hv_stores(sih, "code", newSViv(sip->si_code));
-#if 0 /* XXX TODO: Configure scan for the existence of these, but even that 
does not help if the SA_SIGINFO is not implemented according to the spec. */
-                  hv_stores(sih, "errno",      newSViv(sip->si_errno));
-                  hv_stores(sih, "status",     newSViv(sip->si_status));
-                  hv_stores(sih, "uid",        newSViv(sip->si_uid));
-                  hv_stores(sih, "pid",        newSViv(sip->si_pid));
-                  hv_stores(sih, "addr",       newSVuv(PTR2UV(sip->si_addr)));
-                  hv_stores(sih, "band",       newSViv(sip->si_band));
-#endif
-                  EXTEND(SP, 2);
-                  PUSHs((SV*)rv);
-                  PUSHs(newSVpvn((char *)sip, sizeof(*sip)));
-             }
-
-              va_end(args);
-        }
-    }
-#endif
     PUTBACK;
 
     call_sv((SV*)cv, G_DISCARD|G_EVAL);

==== //depot/maint-5.8/perl/perl.c#229 (text) ====
Index: perl/perl.c
--- perl/perl.c#228~33217~      2008-02-02 14:47:50.000000000 -0800
+++ perl/perl.c 2008-03-08 15:09:00.000000000 -0800
@@ -344,11 +344,7 @@
     SvREADONLY_on(&PL_sv_placeholder);
     SvREFCNT(&PL_sv_placeholder) = (~(U32)0)/2;
 
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-       PL_sighandlerp = (Sighandler_t) Perl_sighandler_va;
-#else
-    PL_sighandlerp = (Sighandler_t) Perl_sighandler;
-#endif
+    PL_sighandlerp = Perl_sighandler;
     PL_pidstatus = newHV();
 
     PL_rs = newSVpvs("\n");

==== //depot/maint-5.8/perl/perl.h#179 (text) ====
Index: perl/perl.h
--- perl/perl.h#178~33214~      2008-02-02 14:01:39.000000000 -0800
+++ perl/perl.h 2008-03-08 15:09:00.000000000 -0800
@@ -2498,18 +2498,6 @@
 #endif
 /* <-- NSIG logic from Configure */
 
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-#  ifdef PERL_CORE
-#    define sighandler         Perl_sighandler_va
-#  endif
-#  define csighandler          Perl_csighandler_va
-#else
-#  ifdef PERL_CORE
-#    define sighandler         Perl_sighandler
-#  endif
-#  define csighandler          Perl_csighandler
-#endif
-
 #ifndef NO_ENVIRON_ARRAY
 #  define USE_ENVIRON_ARRAY
 #endif

==== //depot/maint-5.8/perl/perlvars.h#25 (text) ====
Index: perl/perlvars.h
--- perl/perlvars.h#24~32544~   2007-11-28 15:06:16.000000000 -0800
+++ perl/perlvars.h     2008-03-08 15:09:00.000000000 -0800
@@ -71,11 +71,7 @@
 PERLVAR(Gsv_placeholder, SV)
 
 #ifndef PERL_MICRO
-#  if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-PERLVARI(Gcsighandlerp,        Sighandler_t, Perl_csighandler_va)      /* 
Pointer to C-level sighandler */
-#else
 PERLVARI(Gcsighandlerp,        Sighandler_t, Perl_csighandler) /* Pointer to 
C-level sighandler */
-#  endif
 #endif
 
 #ifndef PERL_USE_SAFE_PUTENV

==== //depot/maint-5.8/perl/proto.h#234 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#233~33422~     2008-03-03 11:18:36.000000000 -0800
+++ perl/proto.h        2008-03-08 15:09:00.000000000 -0800
@@ -1172,10 +1172,6 @@
 #endif
 PERL_CALLCONV void     Perl_setdefout(pTHX_ GV* gv);
 PERL_CALLCONV HEK*     Perl_share_hek(pTHX_ const char* str, I32 len, U32 
hash);
-#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
-PERL_CALLCONV Signal_t Perl_sighandler_va(int sig, ...);
-PERL_CALLCONV Signal_t Perl_csighandler_va(int sig, ...);
-#endif
 PERL_CALLCONV Signal_t Perl_sighandler(int sig);
 PERL_CALLCONV Signal_t Perl_csighandler(int sig);
 PERL_CALLCONV SV**     Perl_stack_grow(pTHX_ SV** sp, SV** p, int n);
@@ -1386,7 +1382,9 @@
 PERL_CALLCONV int      Perl_yywarn(pTHX_ char* s);
 #if defined(MYMALLOC)
 PERL_CALLCONV void     Perl_dump_mstats(pTHX_ char* s);
-PERL_CALLCONV int      Perl_get_mstats(pTHX_ perl_mstats_t *buf, int buflen, 
int level);
+PERL_CALLCONV int      Perl_get_mstats(pTHX_ perl_mstats_t *buf, int buflen, 
int level)
+                       __attribute__warn_unused_result__;
+
 #endif
 PERL_CALLCONV Malloc_t Perl_safesysmalloc(MEM_SIZE nbytes)
                        __attribute__malloc__
End of Patch.

Reply via email to