develooper Front page | perl.perl5.porters | Postings from April 2018

[perl #133099] SigALRM + close() + die() -> "refcnt: fd -1 < 0"

Evgenii Lepikhin
April 11, 2018 17:20
[perl #133099] SigALRM + close() + die() -> "refcnt: fd -1 < 0"
Message ID:
# New Ticket Created by  Evgenii Lepikhin 
# Please include the string:  [perl #133099]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
generated with the help of perlbug 1.40 running under perl 5.24.1.

Perl crashes with error message "refcnt: fd -1 < 0" when exception 
is thrown in SigALRM handler while waiting for child process to be 
closed. How to reproduce:

$ perl -e 'alarm(1); $SIG{ALRM} = sub { die "" }; open($fh, "-|", 
"sleep 2"); eval { close($fh); } '
refcnt: fd -1 < 0

[Please do not change anything below this line]
Site configuration information for perl 5.24.1:

Configured by Debian Project at Tue Sep 12 16:37:26 UTC 2017.

Summary of my perl5 (revision 5 version 24 subversion 1) 
    osname=linux, osvers=3.16.0, 
    uname='linux localhost 3.16.0 #1 smp debian 3.16.0 x86_64 
    gnulinux '
    config_args='-Dusethreads -Duselargefiles 
    -Dcc=x86_64-linux-gnu-gcc -Dcpp=x86_64-linux-gnu-cpp 
    -Dld=x86_64-linux-gnu-gcc -Dccflags=-DDEBIAN -Wdate-time 
    -D_FORTIFY_SOURCE=2 -g -O2 
    -fdebug-prefix-map=/build/perl-Gg9XxY/perl-5.24.1=. -fstack-protector-strong 
    -Wformat -Werror=format-security -Dldflags= -Wl,-z,relro 
    -Dlddlflags=-shared -Wl,-z,relro -Dcccdlflags=-fPIC 
    -Darchname=x86_64-linux-gnu -Dprefix=/usr 
    -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 
    -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.24.1 
    -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 
    -Dsiteman3dir=/usr/local/man/man3 -Dusesitecustomize 
    -Duse64bitint -Dman1ext=1 -Dman3ext=3perl 
    -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm 
    -Uusesfio -Uusenm -Ui_libutil -Uversiononly -DDEBUGGING=-g 
    -Doptimize=-O2 -dEs -Duseshrplib'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='x86_64-linux-gnu-gcc', ccflags ='-D_REENTRANT 
    -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe 
    -I/usr/local/include -D_LARGEFILE_SOURCE 
    optimize='-O2 -g',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv 
    -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='6.3.0 20170516', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, 
    byteorder=12345678, doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, 
    longdblsize=16, longdblkind=3
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, 
    Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='x86_64-linux-gnu-gcc', ldflags =' -fstack-protector-strong 
    /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu 
    /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt, so=so, useshrplib=true,
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, 
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib 

Locally applied patches:
    DEBPKG:debian/cpan_definstalldirs - Provide a sensible 
    INSTALLDIRS default for modules installed from CPAN.
    DEBPKG:debian/db_file_ver - 
    Remove overly restrictive DB_File version check.
    DEBPKG:debian/doc_info - Replace generic man(1) instructions 
    with Debian-specific information.
    DEBPKG:debian/enc2xs_inc - 
    Tweak enc2xs to follow symlinks and ignore missing @INC 
    DEBPKG:debian/errno_ver - 
    Remove Errno version check due to upgrade problems with 
    long-running processes.
    DEBPKG:debian/libperl_embed_doc - Note that libperl-dev package 
    is required for embedded linking
    DEBPKG:fixes/respect_umask - Respect umask during installation
    DEBPKG:debian/writable_site_dirs - Set umask approproately for 
    site install directories
    DEBPKG:debian/extutils_set_libperl_path - EU:MM: set location 
    of libperl.a under /usr/lib
    DEBPKG:debian/no_packlist_perllocal - Don't install .packlist 
    or perllocal.pod for perl or vendor
    DEBPKG:debian/fakeroot - Postpone LD_LIBRARY_PATH evaluation 
    to the binary targets.
    DEBPKG:debian/instmodsh_doc - Debian policy doesn't install 
    .packlist files for core or vendor.
    DEBPKG:debian/ld_run_path - Remove standard libs from 
    LD_RUN_PATH as per Debian 
QA automation engineer at Telegram: johnlepikhin Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About