develooper Front page | perl.perl5.porters | Postings from May 2002

[ID 20020531.014] exiting resets signal mask

From:
mjp
Date:
May 31, 2002 22:25
Subject:
[ID 20020531.014] exiting resets signal mask
Message ID:
20020601052613.30596.qmail@pulcher.wi.securepipe.com

This is a bug report for perl from mjp@pilcrow.madison.wi.us,
generated with the help of perlbug 1.33 running under perl v5.6.1.

perl 5.6.1 on i386-linux resets process signal mask just before END
block execution would commence.  The following, for example,
terminates from USR1 instead of peacefully exiting 0:

  #! /usr/bin/perl

  use POSIX;
  sigprocmask(SIG_BLOCK, POSIX::SigSet->new(SIGUSR1));
  kill SIGUSR1 => $$;

I don't know the internals, but casual play and strace suggest that
the mask is SIG_SETMASK'd back to whatever value was saved at the
BEGIN{}ing (which in the above case is the inherited process mask).

Happily, 5.7.3 does not display this behavior -- the above exits
normally.  Config info and straces below.

Regards,
Mike
--

5.6.1 strace
============
 $ strace -e trace=signal perl sui-usr1 
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
 rt_sigprocmask(SIG_BLOCK, [USR1], NULL, 8) = 0
 rt_sigprocmask(SIG_BLOCK, NULL, [USR1], 8) = 0
 kill(30502, SIGUSR1)                    = 0
 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
 --- SIGUSR1 (User defined signal 1) ---
 +++ killed by SIGUSR1 +++

perl-5.7.3 -V (mostly)
=============
Summary of my perl5 (revision 5.0 version 7 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.4.9-21, archname=i686-linux
    uname='linux pulcher.wi.securepipe.com 2.4.9-21 #1 thu jan 17 14:09:42 est 2002 i686 unknown '
    config_args=''
    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='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.1 2.96-98)', 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='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.4.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

5.7.3 strace
============
  $ PERL5LIB=./lib strace -e trace=signal ./perl sui-usr1 
  rt_sigaction(SIGFPE, {SIG_IGN}, {SIG_DFL}, 8) = 0
  rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
  rt_sigprocmask(SIG_BLOCK, [USR1], NULL, 8) = 0
  kill(30504, SIGUSR1)                    = 0
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl v5.6.1:

Configured by bhcompile at Wed Feb 20 15:00:12 EST 2002.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.17-0.13smp, archname=i386-linux
    uname='linux daffy.perf.redhat.com 2.4.17-0.13smp #1 smp fri feb 1 10:30:48 est 2002 i686 unknown '
    config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dcccdlflags=-fPIC -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Uusethreads -Uuseithreads -Uuselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Dlocincpth='
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include',
    optimize='-O2 -march=i386 -mcpu=i686',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.1 2.96-98)', 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=4
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.4.so, so=so, useshrplib=false, libperl=libperl.a
  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.6.1:
    /usr/lib/perl5/5.6.1/i386-linux
    /usr/lib/perl5/5.6.1
    /usr/lib/perl5/site_perl/5.6.1/i386-linux
    /usr/lib/perl5/site_perl/5.6.1
    /usr/lib/perl5/site_perl/5.6.0/i386-linux
    /usr/lib/perl5/site_perl/5.6.0
    /usr/lib/perl5/site_perl
    .

---
Environment for perl v5.6.1:
    HOME=/home/pulcher/mjp
    LANG=en_US
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/home/pulcher/mjp/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About