Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.91k stars 543 forks source link

$SIG{RTMIN} on gentoo #6240

Open p5pRT opened 21 years ago

p5pRT commented 21 years ago

Migrated from rt.perl.org#20491 (status was 'stalled')

Searchable as RT20491$

p5pRT commented 21 years ago

From perlbug@anarres.org

I hope the attached has all the necessary info.

Oh\, it's gcc-3.2\, gentoo portage as of 20th Jan 2003.

S.

-- Shevek I am the Borg.

sub AUTOLOAD{my$i=$AUTOLOAD;my$x=shift;$i=~s/^.*​://;print"$x\n";eval qq{*$AUTOLOAD=sub{my\$x=shift;return unless \$x%$i;&{$x}(\$x);};};}

foreach my $i (3..65535) { &{'2'}($i); }

p5pRT commented 21 years ago

From perlbug@anarres.org

Created by root@(none).nonet

root@​p405u ~$ perl -e '$SIG{RTMIN} = "DEFAULT"' Segmentation fault root@​p405u ~$ gdb perl GNU gdb 5.3 Copyright 2002 Free Software Foundation\, Inc. GDB is free software\, covered by the GNU General Public License\, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... (no debugging symbols found)... (gdb) run -e '$SIG{RTMIN} = "DEFAULT"' Starting program​: /usr/bin/perl -e '$SIG{RTMIN} = "DEFAULT"' (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)... Program received signal SIGSEGV\, Segmentation fault. 0x080bb5a4 in Perl_sv_free () (gdb) bt #0 0x080bb5a4 in Perl_sv_free () #1 0x080a4413 in Perl_magic_setsig () #2 0x080a6b82 in Perl_mg_set () #3 0x080ae11b in Perl_pp_sassign () #4 0x080ae058 in Perl_runops_standard () #5 0x0805f2d4 in perl_run () #6 0x0805f0ce in perl_run () #7 0x0805c7c3 in main () #8 0x4006d9c4 in __libc_start_main () from /lib/libc.so.6 (gdb) The program is running. Exit anyway? (y or n) y root@​p405u ~$ uname -a Linux p405u.localdomain 2.4.19-gentoo-r10 #2 Mon Jan 20 17​:50​:15 GMT 2003 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux root@​p405u ~$ ls -l /lib/libc-* -rwxr-xr-x 1 root root 1450109 Jan 20 01​:10 /lib/libc-2.3.1.so*

Perl Info ``` --- Flags: category=core severity=critical --- Site configuration information for perl v5.8.0: Configured by root at Mon Jan 20 04:26:43 Local time zone must be set--see zic manual page 2003. Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=linux, osvers=2.4.19-gentoo-r7, archname=i686-linux uname='linux (none) 2.4.19-gentoo-r7 #4 wed jun 5 07:09:05 local time zone must be set--see zic manuali686 i686 pentium iii (coppermine) genuineintel gnulinux ' config_args='-des -Darchname=i686-linux -Dcc=gcc -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth= -Doptimize=-mcpu=pentium3 -march=pentium3 -O3 -pipe -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Dscriptdir=/usr/bin -Dman3ext=3pm -Dcf_by=Gentoo -Ud_csh -Di_gdbm -Di_db -Di_ndbm' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-DPERL5 -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-mcpu=pentium3 -march=pentium3 -O3 -pipe', cppflags='-DPERL5 -DPERL5 -fno-strict-aliasing' ccversion='', gccversion='3.2.1 20021207 (Gentoo Linux 3.2.1-20021207)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil libc=/lib/libc-2.3.1.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.1' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: --- @INC for perl v5.8.0: /usr/lib/perl5/5.8.0/i686-linux /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i686-linux /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i686-linux /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl . --- Environment for perl v5.8.0: HOME=/root LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/bin:/usr/heimdal/sbin:/usr/athena/sbin:/usr/i686-pc-linux-gnu/gcc-bin/3.2:/usr/X11R6/bin:/opt/blackdown-jdk-1.3.1/bin:/opt/blackdown-jdk-1.3.1/jre/bin PERL_BADLANG (unset) SHELL=/bin/bash ```
p5pRT commented 21 years ago

From @rgs

Shevek (via RT) \perlbug\-followup@​perl\.org wrote​:

I hope the attached has all the necessary info.

Could you include also the output of   $ perl '-V​:sig_.*' (maybe Configure guesses something wrong)

p5pRT commented 21 years ago

From perlbug@anarres.org

On 23 Jan 2003\, Rafael Garcia-Suarez wrote​:

Shevek (via RT) \perlbug\-followup@​perl\.org wrote​:

I hope the attached has all the necessary info.

Could you include also the output of $ perl '-V​:sig_.*' (maybe Configure guesses something wrong)

The requested information is attached.

Thankyou.

S.

-- Shevek I am the Borg.

sub AUTOLOAD{my$i=$AUTOLOAD;my$x=shift;$i=~s/^.*​://;print"$x\n";eval qq{*$AUTOLOAD=sub{my\$x=shift;return unless \$x%$i;&{$x}(\$x);};};}

foreach my $i (3..65535) { &{'2'}($i); }

p5pRT commented 21 years ago

From perlbug@anarres.org

sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS NUM32 NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 NUM63 RTMIN IOT CLD POLL UNUSED ' sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 -1 6 17 29 31 ' sig_count='64' sig_name_init='"ZERO"\, "HUP"\, "INT"\, "QUIT"\, "ILL"\, "TRAP"\, "ABRT"\, "BUS"\, "FPE"\, "KILL"\, "USR1"\, "SEGV"\, "USR2"\, "PIPE"\, "ALRM"\, "TERM"\, "STKFLT"\, "CHLD"\, "CONT"\, "STOP"\, "TSTP"\, "TTIN"\, "TTOU"\, "URG"\, "XCPU"\, "XFSZ"\, "VTALRM"\, "PROF"\, "WINCH"\, "IO"\, "PWR"\, "SYS"\, "NUM32"\, "NUM33"\, "NUM34"\, "NUM35"\, "NUM36"\, "NUM37"\, "NUM38"\, "NUM39"\, "NUM40"\, "NUM41"\, "NUM42"\, "NUM43"\, "NUM44"\, "NUM45"\, "NUM46"\, "NUM47"\, "NUM48"\, "NUM49"\, "NUM50"\, "NUM51"\, "NUM52"\, "NUM53"\, "NUM54"\, "NUM55"\, "NUM56"\, "NUM57"\, "NUM58"\, "NUM59"\, "NUM60"\, "NUM61"\, "NUM62"\, "NUM63"\, "RTMIN"\, "IOT"\, "CLD"\, "POLL"\, "UNUSED"\, 0' sig_num_init='0\, 1\, 2\, 3\, 4\, 5\, 6\, 7\, 8\, 9\, 10\, 11\, 12\, 13\, 14\, 15\, 16\, 17\, 18\, 19\, 20\, 21\, 22\, 23\, 24\, 25\, 26\, 27\, 28\, 29\, 30\, 31\, 32\, 33\, 34\, 35\, 36\, 37\, 38\, 39\, 40\, 41\, 42\, 43\, 44\, 45\, 46\, 47\, 48\, 49\, 50\, 51\, 52\, 53\, 54\, 55\, 56\, 57\, 58\, 59\, 60\, 61\, 62\, 63\, -1\, 6\, 17\, 29\, 31\, 0' sig_size='69'

p5pRT commented 21 years ago

From @rgs

Shevek wrote​:

Could you include also the output of $ perl '-V​:sig_.*' (maybe Configure guesses something wrong)

The requested information is attached.

Note that the signal number listed for for RTMIN is "-1" :

sig_name_init='"ZERO"\, "HUP"\, "INT"\, "QUIT"\, "ILL"\, "TRAP"\, "ABRT"\, "BUS"\, "FPE"\, "KILL"\, "USR1"\, "SEGV"\, "USR2"\, "PIPE"\, "ALRM"\, "TERM"\, "STKFLT"\, "CHLD"\, "CONT"\, "STOP"\, "TSTP"\, "TTIN"\, "TTOU"\, "URG"\, "XCPU"\, "XFSZ"\, "VTALRM"\, "PROF"\, "WINCH"\, "IO"\, "PWR"\, "SYS"\, "NUM32"\, "NUM33"\, "NUM34"\, "NUM35"\, "NUM36"\, "NUM37"\, "NUM38"\, "NUM39"\, "NUM40"\, "NUM41"\, "NUM42"\, "NUM43"\, "NUM44"\, "NUM45"\, "NUM46"\, "NUM47"\, "NUM48"\, "NUM49"\, "NUM50"\, "NUM51"\, "NUM52"\, "NUM53"\, "NUM54"\, "NUM55"\, "NUM56"\, "NUM57"\, "NUM58"\, "NUM59"\, "NUM60"\, "NUM61"\, "NUM62"\, "NUM63"\, "RTMIN"\, "IOT"\, "CLD"\, "POLL"\, "UNUSED"\, 0' sig_num_init='0\, 1\, 2\, 3\, 4\, 5\, 6\, 7\, 8\, 9\, 10\, 11\, 12\, 13\, 14\, 15\, 16\, 17\, 18\, 19\, 20\, 21\, 22\, 23\, 24\, 25\, 26\, 27\, 28\, 29\, 30\, 31\, 32\, 33\, 34\, 35\, 36\, 37\, 38\, 39\, 40\, 41\, 42\, 43\, 44\, 45\, 46\, 47\, 48\, 49\, 50\, 51\, 52\, 53\, 54\, 55\, 56\, 57\, 58\, 59\, 60\, 61\, 62\, 63\, -1\, 6\, 17\, 29\, 31\, 0'

That's strange. What does your signal.h say about it ? (it maybe a file asm/signal.h or another sig*.h under /usr/include). There's possibly a bug in the Configure script if your signal number is different from -1.

Anyway\, perl should't dump core when given a signal number of -1. (for reference the core dump is produced by   $ perl -e '$SIG{RTMIN} = "DEFAULT"' )

p5pRT commented 21 years ago

From arthur@contiller.se

On söndag\, jan 26\, 2003\, at 23​:40 Europe/Stockholm\, Rafael Garcia-Suarez wrote​:

Shevek wrote​:

Could you include also the output of $ perl '-V​:sig_.*' (maybe Configure guesses something wrong)

The requested information is attached.

Note that the signal number listed for for RTMIN is "-1" :

sig_name_init='"ZERO"\, "HUP"\, "INT"\, "QUIT"\, "ILL"\, "TRAP"\, "ABRT"\, "BUS"\, "FPE"\, "KILL"\, "USR1"\, "SEGV"\, "USR2"\, "PIPE"\, "ALRM"\, "TERM"\, "STKFLT"\, "CHLD"\, "CONT"\, "STOP"\, "TSTP"\, "TTIN"\, "TTOU"\, "URG"\, "XCPU"\, "XFSZ"\, "VTALRM"\, "PROF"\, "WINCH"\, "IO"\, "PWR"\, "SYS"\, "NUM32"\, "NUM33"\, "NUM34"\, "NUM35"\, "NUM36"\, "NUM37"\, "NUM38"\, "NUM39"\, "NUM40"\, "NUM41"\, "NUM42"\, "NUM43"\, "NUM44"\, "NUM45"\, "NUM46"\, "NUM47"\, "NUM48"\, "NUM49"\, "NUM50"\, "NUM51"\, "NUM52"\, "NUM53"\, "NUM54"\, "NUM55"\, "NUM56"\, "NUM57"\, "NUM58"\, "NUM59"\, "NUM60"\, "NUM61"\, "NUM62"\, "NUM63"\, "RTMIN"\, "IOT"\, "CLD"\, "POLL"\, "UNUSED"\, 0' sig_num_init='0\, 1\, 2\, 3\, 4\, 5\, 6\, 7\, 8\, 9\, 10\, 11\, 12\, 13\, 14\, 15\, 16\, 17\, 18\, 19\, 20\, 21\, 22\, 23\, 24\, 25\, 26\, 27\, 28\, 29\, 30\, 31\, 32\, 33\, 34\, 35\, 36\, 37\, 38\, 39\, 40\, 41\, 42\, 43\, 44\, 45\, 46\, 47\, 48\, 49\, 50\, 51\, 52\, 53\, 54\, 55\, 56\, 57\, 58\, 59\, 60\, 61\, 62\, 63\, -1\, 6\, 17\, 29\, 31\, 0'

That's strange. What does your signal.h say about it ? (it maybe a file asm/signal.h or another sig*.h under /usr/include). There's possibly a bug in the Configure script if your signal number is different from -1.

Anyway\, perl should't dump core when given a signal number of -1. (for reference the core dump is produced by $ perl -e '$SIG{RTMIN} = "DEFAULT"' )

A machine with RTMIN being -1 must be a weird beast since RTMIN/RTMAX combo describes what signals can used for realtime signals.

Arthur

p5pRT commented 21 years ago

From @rgs

Arthur Bergman wrote​:

That's strange. What does your signal.h say about it ? (it maybe a file asm/signal.h or another sig*.h under /usr/include). There's possibly a bug in the Configure script if your signal number is different from -1.

Anyway\, perl should't dump core when given a signal number of -1. (for reference the core dump is produced by $ perl -e '$SIG{RTMIN} = "DEFAULT"' )

A machine with RTMIN being -1 must be a weird beast since RTMIN/RTMAX combo describes what signals can used for realtime signals.

Gentoo machines are weird beasts ;-) notice that this is apparently a gentoo modified kernel\, and (afaik) the signal numbers come from the kernel. So I just want to know what kind of input fools the complicated process by which Configure figures them out. (RTMIN is consistenly defined as 32 in all kernel headers here\, linux 2.4.20)

p5pRT commented 21 years ago

From perlbug@anarres.org

On Sun\, 26 Jan 2003\, Rafael Garcia-Suarez wrote​:

Shevek wrote​:

Could you include also the output of $ perl '-V​:sig_.*' (maybe Configure guesses something wrong)

The requested information is attached.

Note that the signal number listed for for RTMIN is "-1" :

sig_name_init='"ZERO"\, "HUP"\, "INT"\, "QUIT"\, "ILL"\, "TRAP"\, "ABRT"\, "BUS"\, "FPE"\, "KILL"\, "USR1"\, "SEGV"\, "USR2"\, "PIPE"\, "ALRM"\, "TERM"\, "STKFLT"\, "CHLD"\, "CONT"\, "STOP"\, "TSTP"\, "TTIN"\, "TTOU"\, "URG"\, "XCPU"\, "XFSZ"\, "VTALRM"\, "PROF"\, "WINCH"\, "IO"\, "PWR"\, "SYS"\, "NUM32"\, "NUM33"\, "NUM34"\, "NUM35"\, "NUM36"\, "NUM37"\, "NUM38"\, "NUM39"\, "NUM40"\, "NUM41"\, "NUM42"\, "NUM43"\, "NUM44"\, "NUM45"\, "NUM46"\, "NUM47"\, "NUM48"\, "NUM49"\, "NUM50"\, "NUM51"\, "NUM52"\, "NUM53"\, "NUM54"\, "NUM55"\, "NUM56"\, "NUM57"\, "NUM58"\, "NUM59"\, "NUM60"\, "NUM61"\, "NUM62"\, "NUM63"\, "RTMIN"\, "IOT"\, "CLD"\, "POLL"\, "UNUSED"\, 0' sig_num_init='0\, 1\, 2\, 3\, 4\, 5\, 6\, 7\, 8\, 9\, 10\, 11\, 12\, 13\, 14\, 15\, 16\, 17\, 18\, 19\, 20\, 21\, 22\, 23\, 24\, 25\, 26\, 27\, 28\, 29\, 30\, 31\, 32\, 33\, 34\, 35\, 36\, 37\, 38\, 39\, 40\, 41\, 42\, 43\, 44\, 45\, 46\, 47\, 48\, 49\, 50\, 51\, 52\, 53\, 54\, 55\, 56\, 57\, 58\, 59\, 60\, 61\, 62\, 63\, -1\, 6\, 17\, 29\, 31\, 0'

That's strange. What does your signal.h say about it ? (it maybe a file asm/signal.h or another sig*.h under /usr/include). There's possibly a bug in the Configure script if your signal number is different from -1.

Anyway\, perl should't dump core when given a signal number of -1. (for reference the core dump is produced by $ perl -e '$SIG{RTMIN} = "DEFAULT"' )

I attach the files in question.

root@​p405u /usr/include$ grep RTMIN */*.h asm/signal.h​:#define SIGRTMIN 32 bits/signum.h​:#define SIGRTMIN (__libc_current_sigrtmin ()) bits/signum.h​:#define __SIGRTMIN 32

S.

-- Shevek I am the Borg.

sub AUTOLOAD{my$i=$AUTOLOAD;my$x=shift;$i=~s/^.*​://;print"$x\n";eval qq{*$AUTOLOAD=sub{my\$x=shift;return unless \$x%$i;&{$x}(\$x);};};}

foreach my $i (3..65535) { &{'2'}($i); }

p5pRT commented 21 years ago

From perlbug@anarres.org

#ifndef _ASMi386_SIGNAL_H #define _ASMi386_SIGNAL_H

#include \<linux/types.h>

/* Avoid too many header ordering problems. */ struct siginfo;

#ifdef __KERNEL__ /* Most things should be clean enough to redefine this at will\, if care   is taken to make libc match. */

#define _NSIG 64 #define _NSIG_BPW 32 #define _NSIG_WORDS (_NSIG / _NSIG_BPW)

typedef unsigned long old_sigset_t; /* at least 32 bits */

typedef struct {   unsigned long sig[_NSIG_WORDS]; } sigset_t;

#else /* Here we must cater to libcs that poke about in kernel headers. */

#define NSIG 32 typedef unsigned long sigset_t;

#endif /* __KERNEL__ */

#define SIGHUP 1 #define SIGINT 2 #define SIGQUIT 3 #define SIGILL 4 #define SIGTRAP 5 #define SIGABRT 6 #define SIGIOT 6 #define SIGBUS 7 #define SIGFPE 8 #define SIGKILL 9 #define SIGUSR1 10 #define SIGSEGV 11 #define SIGUSR2 12 #define SIGPIPE 13 #define SIGALRM 14 #define SIGTERM 15 #define SIGSTKFLT 16 #define SIGCHLD 17 #define SIGCONT 18 #define SIGSTOP 19 #define SIGTSTP 20 #define SIGTTIN 21 #define SIGTTOU 22 #define SIGURG 23 #define SIGXCPU 24 #define SIGXFSZ 25 #define SIGVTALRM 26 #define SIGPROF 27 #define SIGWINCH 28 #define SIGIO 29 #define SIGPOLL SIGIO /* #define SIGLOST 29 */ #define SIGPWR 30 #define SIGSYS 31 #define SIGUNUSED 31

/* These should not be considered constants from userland. */ #define SIGRTMIN 32 #define SIGRTMAX (_NSIG-1)

/* * SA_FLAGS values​: * * SA_ONSTACK indicates that a registered stack_t will be used. * SA_INTERRUPT is a no-op\, but left due to historical reasons. Use the * SA_RESTART flag to get restarting signals (which were the default long ago) * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. * SA_RESETHAND clears the handler when the signal is delivered. * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. * SA_NODEFER prevents the current signal from being masked in the handler. * * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single * Unix names RESETHAND and NODEFER respectively. */ #define SA_NOCLDSTOP 0x00000001 #define SA_NOCLDWAIT 0x00000002 /* not supported yet */ #define SA_SIGINFO 0x00000004 #define SA_ONSTACK 0x08000000 #define SA_RESTART 0x10000000 #define SA_NODEFER 0x40000000 #define SA_RESETHAND 0x80000000

#define SA_NOMASK SA_NODEFER #define SA_ONESHOT SA_RESETHAND #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */

#define SA_RESTORER 0x04000000

/* * sigaltstack controls */ #define SS_ONSTACK 1 #define SS_DISABLE 2

#define MINSIGSTKSZ 2048 #define SIGSTKSZ 8192

#ifdef __KERNEL__

/* * These values of sa_flags are used only by the kernel as part of the * irq handling routines. * * SA_INTERRUPT is also used by the irq handling routines. * SA_SHIRQ is for shared interrupt support on PCI and EISA. */ #define SA_PROBE SA_ONESHOT #define SA_SAMPLE_RANDOM SA_RESTART #define SA_SHIRQ 0x04000000 #endif

#define SIG_BLOCK 0 /* for blocking signals */ #define SIG_UNBLOCK 1 /* for unblocking signals */ #define SIG_SETMASK 2 /* for setting the signal mask */

/* Type of a signal handler. */ typedef void (*__sighandler_t)(int);

#define SIG_DFL ((__sighandler_t)0) /* default signal handling */ #define SIG_IGN ((__sighandler_t)1) /* ignore signal */ #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */

#ifdef __KERNEL__ struct old_sigaction {   __sighandler_t sa_handler;   old_sigset_t sa_mask;   unsigned long sa_flags;   void (*sa_restorer)(void); };

struct sigaction {   __sighandler_t sa_handler;   unsigned long sa_flags;   void (*sa_restorer)(void);   sigset_t sa_mask; /* mask last for extensibility */ };

struct k_sigaction {   struct sigaction sa; }; #else /* Here we must cater to libcs that poke about in kernel headers. */

struct sigaction {   union {   __sighandler_t _sa_handler;   void (*_sa_sigaction)(int\, struct siginfo *\, void *);   } _u;   sigset_t sa_mask;   unsigned long sa_flags;   void (*sa_restorer)(void); };

#define sa_handler _u._sa_handler #define sa_sigaction _u._sa_sigaction

#endif /* __KERNEL__ */

typedef struct sigaltstack {   void *ss_sp;   int ss_flags;   size_t ss_size; } stack_t;

#ifdef __KERNEL__ #include \<asm/sigcontext.h>

#define __HAVE_ARCH_SIG_BITOPS

static __inline__ void sigaddset(sigset_t *set\, int _sig) {   __asm__("btsl %1\,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc"); }

static __inline__ void sigdelset(sigset_t *set\, int _sig) {   __asm__("btrl %1\,%0" : "=m"(*set) : "Ir"(_sig - 1) : "cc"); }

static __inline__ int __const_sigismember(sigset_t *set\, int _sig) {   unsigned long sig = _sig - 1;   return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW)); }

static __inline__ int __gen_sigismember(sigset_t *set\, int _sig) {   int ret;   __asm__("btl %2\,%1\n\tsbbl %0\,%0"   : "=r"(ret) : "m"(*set)\, "Ir"(_sig-1) : "cc");   return ret; }

#define sigismember(set\,sig) \   (__builtin_constant_p(sig) ? \   __const_sigismember((set)\,(sig)) : \   __gen_sigismember((set)\,(sig)))

#define sigmask(sig) (1UL \<\< ((sig) - 1))

static __inline__ int sigfindinword(unsigned long word) {   __asm__("bsfl %1\,%0" : "=r"(word) : "rm"(word) : "cc");   return word; }

#endif /* __KERNEL__ */

#endif

p5pRT commented 21 years ago

From perlbug@anarres.org

/* Signal number definitions. Linux version.   Copyright (C) 1995\, 1996\, 1997\, 1998\, 1999 Free Software Foundation\, Inc.   This file is part of the GNU C Library.

  The GNU C Library is free software; you can redistribute it and/or   modify it under the terms of the GNU Lesser General Public   License as published by the Free Software Foundation; either   version 2.1 of the License\, or (at your option) any later version.

  The GNU C Library is distributed in the hope that it will be useful\,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public   License along with the GNU C Library; if not\, write to the Free   Software Foundation\, Inc.\, 59 Temple Place\, Suite 330\, Boston\, MA   02111-1307 USA. */

#ifdef _SIGNAL_H

/* Fake signal functions. */ #define SIG_ERR ((__sighandler_t) -1) /* Error return. */ #define SIG_DFL ((__sighandler_t) 0) /* Default action. */ #define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */

#ifdef __USE_UNIX98 # define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */ #endif

/* Signals. */ #define SIGHUP 1 /* Hangup (POSIX). */ #define SIGINT 2 /* Interrupt (ANSI). */ #define SIGQUIT 3 /* Quit (POSIX). */ #define SIGILL 4 /* Illegal instruction (ANSI). */ #define SIGTRAP 5 /* Trace trap (POSIX). */ #define SIGABRT 6 /* Abort (ANSI). */ #define SIGIOT 6 /* IOT trap (4.2 BSD). */ #define SIGBUS 7 /* BUS error (4.2 BSD). */ #define SIGFPE 8 /* Floating-point exception (ANSI). */ #define SIGKILL 9 /* Kill\, unblockable (POSIX). */ #define SIGUSR1 10 /* User-defined signal 1 (POSIX). */ #define SIGSEGV 11 /* Segmentation violation (ANSI). */ #define SIGUSR2 12 /* User-defined signal 2 (POSIX). */ #define SIGPIPE 13 /* Broken pipe (POSIX). */ #define SIGALRM 14 /* Alarm clock (POSIX). */ #define SIGTERM 15 /* Termination (ANSI). */ #define SIGSTKFLT 16 /* Stack fault. */ #define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ #define SIGCHLD 17 /* Child status has changed (POSIX). */ #define SIGCONT 18 /* Continue (POSIX). */ #define SIGSTOP 19 /* Stop\, unblockable (POSIX). */ #define SIGTSTP 20 /* Keyboard stop (POSIX). */ #define SIGTTIN 21 /* Background read from tty (POSIX). */ #define SIGTTOU 22 /* Background write to tty (POSIX). */ #define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */ #define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ #define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ #define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ #define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ #define SIGWINCH 28 /* Window size change (4.3 BSD\, Sun). */ #define SIGPOLL SIGIO /* Pollable event occurred (System V). */ #define SIGIO 29 /* I/O now possible (4.2 BSD). */ #define SIGPWR 30 /* Power failure restart (System V). */ #define SIGSYS 31 /* Bad system call. */ #define SIGUNUSED 31

#define _NSIG 64 /* Biggest signal number + 1   (including real-time signals). */

#define SIGRTMIN (__libc_current_sigrtmin ()) #define SIGRTMAX (__libc_current_sigrtmax ())

/* These are the hard limits of the kernel. These values should not be   used directly at user level. */ #define __SIGRTMIN 32 #define __SIGRTMAX (_NSIG - 1)

#endif /* \<signal.h> included. */

p5pRT commented 21 years ago

From perlbug@anarres.org

On 26 Jan 2003\, Rafael Garcia-Suarez wrote​:

Arthur Bergman wrote​:

That's strange. What does your signal.h say about it ? (it maybe a file asm/signal.h or another sig*.h under /usr/include). There's possibly a bug in the Configure script if your signal number is different from -1.

Anyway\, perl should't dump core when given a signal number of -1. (for reference the core dump is produced by $ perl -e '$SIG{RTMIN} = "DEFAULT"' )

A machine with RTMIN being -1 must be a weird beast since RTMIN/RTMAX combo describes what signals can used for realtime signals.

Gentoo machines are weird beasts ;-) notice that this is apparently a gentoo modified kernel\, and (afaik) the signal numbers come from the kernel. So I just want to know what kind of input fools the complicated process by which Configure figures them out. (RTMIN is consistenly defined as 32 in all kernel headers here\, linux 2.4.20)

Hopefully you have copies of my headers by now. However\, you're quite right. I have this fundamental belief that Linux (e.g. Slackware) is a solid and stable system. However\, every single distributor seems to feel honour bound to \ it up...

FTR I don't think gentoo are particularly guilty of this\, which is why I use them. The choice to use gentoo-sources was an experimental one and consciously so. I object far more to the likes of Red Hat who seem to break everything in sight. Once we resolve this\, I'll probably move back to vanilla.

S.

-- Shevek I am the Borg.

sub AUTOLOAD{my$i=$AUTOLOAD;my$x=shift;$i=~s/^.*​://;print"$x\n";eval qq{*$AUTOLOAD=sub{my\$x=shift;return unless \$x%$i;&{$x}(\$x);};};}

foreach my $i (3..65535) { &{'2'}($i); }

p5pRT commented 21 years ago

From perlbug@anarres.org

On 26 Jan 2003\, Rafael Garcia-Suarez wrote​:

(RTMIN is consistenly defined as 32 in all kernel headers here\, linux 2.4.20)

Is there any idea about when this might get fixed? I really can't run systems without Perl\, and all my new machines are just sitting waiting for this to work.

Would it help if I gave you login to one of my systems as a test machine? Is there anything else I can do to help get this sorted out?

Thanks.

S.

-- Shevek I am the Borg.

sub AUTOLOAD{my$i=$AUTOLOAD;my$x=shift;$i=~s/^.*​://;print"$x\n";eval qq{*$AUTOLOAD=sub{my\$x=shift;return unless \$x%$i;&{$x}(\$x);};};}

foreach my $i (3..65535) { &{'2'}($i); }

p5pRT commented 21 years ago

From @rgs

Shevek \perlbug@&#8203;anarres\.org wrote​:

Is there any idea about when this might get fixed? I really can't run systems without Perl\, and all my new machines are just sitting waiting for this to work.

Concerning an adequate fix\, I have no idea. Frankly.

Concerning a workaround\, here's one that should work painlessly :

untar a clean perl source tree\, once Configure is run\, edit the file config.sh\, find 'sig_num_init' and 'sig_num' and replace -1 by the appropriate value\,   (the one in your .h headers)\, regenerate config.h (by running config_h.SH) make\, make test.

The resulting perl should work. Then\, make install.

The INSTALL file may have more information about tweaking config.sh (or the Configure gurus around there may correct me if I'm wrong.)

HTH.

p5pRT commented 21 years ago

From perlbug@anarres.org

On Wed\, 5 Feb 2003\, Rafael Garcia-Suarez wrote​:

Shevek \perlbug@&#8203;anarres\.org wrote​:

Is there any idea about when this might get fixed? I really can't run systems without Perl\, and all my new machines are just sitting waiting for this to work.

Concerning an adequate fix\, I have no idea. Frankly.

Concerning a workaround\, here's one that should work painlessly :

untar a clean perl source tree\, once Configure is run\, edit the file config.sh\, find 'sig_num_init' and 'sig_num' and replace -1 by the appropriate value\, (the one in your .h headers)\, regenerate config.h (by running config_h.SH) make\, make test.

The resulting perl should work. Then\, make install.

Cool\, I will do this.

Just a check​: Shouldn't I be removing RTMIN entirely since it isn't a signal? RTMAX doesn't appear.

S.

-- Shevek I am the Borg.

sub AUTOLOAD{my$i=$AUTOLOAD;my$x=shift;$i=~s/^.*​://;print"$x\n";eval qq{*$AUTOLOAD=sub{my\$x=shift;return unless \$x%$i;&{$x}(\$x);};};}

foreach my $i (3..65535) { &{'2'}($i); }

p5pRT commented 21 years ago

From @rgs

Shevek \perlbug@&#8203;anarres\.org wrote​:

Just a check​: Shouldn't I be removing RTMIN entirely since it isn't a signal? RTMAX doesn't appear.

I think that the same Configure bug that generates a false signal number for RTMIN also skips RTMAX. I think you can replace NUM63 by RTMAX everywhere in config.h safely.

p5pRT commented 21 years ago

From perlbug@anarres.org

Thanks for the suggestions so far. I have now applied the temporary fix as suggested. It still segfaults\, even though RTMIN is now 32...

Did I mess up anywhere? I changed in config.sh sig_name\, sig_name_init\, sig_num_init and sig_size to the following​:

root@​p405u /usr/local/src/perl-5.8.0$ perl -V​:sig.* sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED ' sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 ' sig_count='64' sig_name_init='"ZERO"\, "HUP"\, "INT"\, "QUIT"\, "ILL"\, "TRAP"\, "ABRT"\, "BUS"\, "FPE"\, "KILL"\, "USR1"\, "SEGV"\, "USR2"\, "PIPE"\, "ALRM"\, "TERM"\, "STKFLT"\, "CHLD"\, "CONT"\, "STOP"\, "TSTP"\, "TTIN"\, "TTOU"\, "URG"\, "XCPU"\, "XFSZ"\, "VTALRM"\, "PROF"\, "WINCH"\, "IO"\, "PWR"\, "SYS"\, "RTMIN"\, "NUM33"\, "NUM34"\, "NUM35"\, "NUM36"\, "NUM37"\, "NUM38"\, "NUM39"\, "NUM40"\, "NUM41"\, "NUM42"\, "NUM43"\, "NUM44"\, "NUM45"\, "NUM46"\, "NUM47"\, "NUM48"\, "NUM49"\, "NUM50"\, "NUM51"\, "NUM52"\, "NUM53"\, "NUM54"\, "NUM55"\, "NUM56"\, "NUM57"\, "NUM58"\, "NUM59"\, "NUM60"\, "NUM61"\, "NUM62"\, "RTMAX"\, "IOT"\, "CLD"\, "POLL"\, "UNUSED"\, 0' sig_num_init='0\, 1\, 2\, 3\, 4\, 5\, 6\, 7\, 8\, 9\, 10\, 11\, 12\, 13\, 14\, 15\, 16\, 17\, 18\, 19\, 20\, 21\, 22\, 23\, 24\, 25\, 26\, 27\, 28\, 29\, 30\, 31\, 32\, 33\, 34\, 35\, 36\, 37\, 38\, 39\, 40\, 41\, 42\, 43\, 44\, 45\, 46\, 47\, 48\, 49\, 50\, 51\, 52\, 53\, 54\, 55\, 56\, 57\, 58\, 59\, 60\, 61\, 62\, 63\, 6\, 17\, 29\, 31\, 0' sig_size='68' signal_t='void' root@​p405u /usr/local/src/perl-5.8.0$ perl -e '$SIG{NUM33}="DEFAULT";' root@​p405u /usr/local/src/perl-5.8.0$ perl -e '$SIG{NUM34}="DEFAULT";' root@​p405u /usr/local/src/perl-5.8.0$ perl -e '$SIG{RTMIN}="DEFAULT";' Segmentation fault root@​p405u /usr/local/src/perl-5.8.0$ perl -e '$SIG{NUM31}="DEFAULT";' root@​p405u /usr/local/src/perl-5.8.0$

-- Shevek I am the Borg.

sub AUTOLOAD{my$i=$AUTOLOAD;my$x=shift;$i=~s/^.*​://;print"$x\n";eval qq{*$AUTOLOAD=sub{my\$x=shift;return unless \$x%$i;&{$x}(\$x);};};}

foreach my $i (3..65535) { &{'2'}($i); }

p5pRT commented 21 years ago

From @doughera88

On Sun\, 26 Jan 2003\, Shevek wrote​:

On Sun\, 26 Jan 2003\, Rafael Garcia-Suarez wrote​:

Shevek wrote​:

Could you include also the output of $ perl '-V​:sig_.*' (maybe Configure guesses something wrong)

The requested information is attached.

Note that the signal number listed for for RTMIN is "-1" :

sig_name_init='"ZERO"\, "HUP"\, "INT"\, "QUIT"\, "ILL"\, "TRAP"\, "ABRT"\, "BUS"\, "FPE"\, "KILL"\, "USR1"\, "SEGV"\, "USR2"\, "PIPE"\, "ALRM"\, "TERM"\, "STKFLT"\, "CHLD"\, "CONT"\, "STOP"\, "TSTP"\, "TTIN"\, "TTOU"\, "URG"\, "XCPU"\, "XFSZ"\, "VTALRM"\, "PROF"\, "WINCH"\, "IO"\, "PWR"\, "SYS"\, "NUM32"\, "NUM33"\, "NUM34"\, "NUM35"\, "NUM36"\, "NUM37"\, "NUM38"\, "NUM39"\, "NUM40"\, "NUM41"\, "NUM42"\, "NUM43"\, "NUM44"\, "NUM45"\, "NUM46"\, "NUM47"\, "NUM48"\, "NUM49"\, "NUM50"\, "NUM51"\, "NUM52"\, "NUM53"\, "NUM54"\, "NUM55"\, "NUM56"\, "NUM57"\, "NUM58"\, "NUM59"\, "NUM60"\, "NUM61"\, "NUM62"\, "NUM63"\, "RTMIN"\, "IOT"\, "CLD"\, "POLL"\, "UNUSED"\, 0' sig_num_init='0\, 1\, 2\, 3\, 4\, 5\, 6\, 7\, 8\, 9\, 10\, 11\, 12\, 13\, 14\, 15\, 16\, 17\, 18\, 19\, 20\, 21\, 22\, 23\, 24\, 25\, 26\, 27\, 28\, 29\, 30\, 31\, 32\, 33\, 34\, 35\, 36\, 37\, 38\, 39\, 40\, 41\, 42\, 43\, 44\, 45\, 46\, 47\, 48\, 49\, 50\, 51\, 52\, 53\, 54\, 55\, 56\, 57\, 58\, 59\, 60\, 61\, 62\, 63\, -1\, 6\, 17\, 29\, 31\, 0'

That's strange. What does your signal.h say about it ? (it maybe a file asm/signal.h or another sig*.h under /usr/include). There's possibly a bug in the Configure script if your signal number is different from -1.

I attach the files in question.

root@​p405u /usr/include$ grep RTMIN */*.h asm/signal.h​:#define SIGRTMIN 32 bits/signum.h​:#define SIGRTMIN (__libc_current_sigrtmin ()) bits/signum.h​:#define __SIGRTMIN 32

I'm unsure which of those is actually getting used. Most likely\, it's the __libc_current_sigrtmin()\, which means there's not a lot Perl can do about it. If the system insists on giving us a '-1' for the signal number\, then what are we to do with it?

Effectively\, Configure gets its value from the following program.

#include \<sys/types.h> #include \<signal.h> #include \<stdio.h> int main() { #ifdef SIGRTMIN   printf("RTMIN %d\n"\,SIGRTMIN); #endif   return 0; }

I suspect that Configure's working fine here. What's missing is that the signal number is apparently dynamic in some way. Someone who understands such things will need to read the appropriate documentation to figure out how such things are intended to be used. I have no idea.

--   Andy Dougherty doughera@​lafayette.edu

p5pRT commented 20 years ago

@doughera88 - Status changed from 'open' to 'stalled'