Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gmtime("NaN") in scalar or void context causes a segmentation fault on all perls since 5.12 #14365

Closed
p5pRT opened this issue Dec 25, 2014 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 25, 2014

Migrated from rt.perl.org#123495 (status was 'resolved')

Searchable as RT123495$

@p5pRT
Copy link
Author

p5pRT commented Dec 25, 2014

From andreas.guldstrand@gmail.com

Created by andreas.guldstrand@gmail.com

Running gmtime("NaN"); in void or scalar context causes a segmentation fault

  [0]suppy@​luna​:~$ perl -e'gmtime("NaN")'
  Segmentation fault
  [139]suppy@​luna​:~$ perl -e'$foo = gmtime("NaN")'
  Segmentation fault
  [139]suppy@​luna​:~$ perl -e'@​foo = gmtime("NaN")'
  [0]suppy@​luna​:~$

This appears to happen on all released perls since 5.12 (inclusive)​:

  [0]suppy@​luna​:~$ for perl in ~/perl5/perlbrew/perls/perl-*/bin/perl;
do $perl -v | grep "This is perl"; $perl -e'gmtime("NaN")'; echo "^ -
$? #########"; done
  This is perl, v5.10.0 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.10.1 (*) built for x86_64-linux
  ^ - 0 #########
  This is perl 5, version 12, subversion 0 (v5.12.0) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 12, subversion 1 (v5.12.1) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 12, subversion 2 (v5.12.2) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 12, subversion 3 (v5.12.3) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 12, subversion 4 (v5.12.4) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 12, subversion 5 (v5.12.5) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 14, subversion 0 (v5.14.0) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 14, subversion 1 (v5.14.1) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 14, subversion 3 (v5.14.3) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 14, subversion 4 (v5.14.4) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 16, subversion 0 (v5.16.0) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 16, subversion 1 (v5.16.1) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 16, subversion 2 (v5.16.2) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 18, subversion 0 (v5.18.0) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 18, subversion 1 (v5.18.1) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 18, subversion 3 (v5.18.3) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 18, subversion 4 (v5.18.4) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 20, subversion 0 (v5.20.0) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl 5, version 20, subversion 1 (v5.20.1) built for x86_64-linux
  Segmentation fault
  ^ - 139 #########
  This is perl, v5.6.0 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.6.1 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.6.2 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.8.0 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.8.1 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.8.2 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.8.3 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.8.4 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.8.5 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.8.6 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.8.7 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.8.8 built for x86_64-linux
  ^ - 0 #########
  This is perl, v5.8.9 built for x86_64-linux
  ^ - 0 #########
  [0]suppy@​luna​:~$

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl 5.20.1:

Configured by suppy at Sat Dec 20 16:42:13 CET 2014.

Summary of my perl5 (revision 5 version 20 subversion 1) configuration:

  Platform:
    osname=linux, osvers=3.10.17, archname=x86_64-linux
    uname='linux luna 3.10.17 #2 smp fri feb 14 16:45:28 cst 2014
x86_64 intel(r) core(tm) i5-2450m cpu @ 2.50ghz genuineintel gnulinux
'
    config_args='-de
-Dprefix=/home/suppy/perl5/perlbrew/perls/perl-5.20.1
-Aeval:scriptdir=/home/suppy/perl5/perlbrew/perls/perl-5.20.1/bin'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fwrapv -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include'
    ccversion='', gccversion='4.8.2', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/include-fixed /usr/lib
/lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64
/usr/local/lib64
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.17'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib
-fstack-protector'



@INC for perl 5.20.1:
    /home/suppy/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/x86_64-linux
    /home/suppy/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1
    /home/suppy/perl5/perlbrew/perls/perl-5.20.1/lib/5.20.1/x86_64-linux
    /home/suppy/perl5/perlbrew/perls/perl-5.20.1/lib/5.20.1
    .


Environment for perl 5.20.1:
    HOME=/home/suppy
    LANG=en_GB.UTF-8
    LANGUAGE (unset)
    LC_ALL=en_GB.UTF-8
    LC_COLLATE=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/suppy/perl5/perlbrew/bin:/home/suppy/perl5/perlbrew/perls/perl-5.20.1/bin:/home/suppy/.commands/:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/qt/bin:/usr/share/texmf/bin
    PERLBREW_BASHRC_VERSION=0.64
    PERLBREW_HOME=/home/suppy/.perlbrew
    PERLBREW_MANPATH=/home/suppy/perl5/perlbrew/perls/perl-5.20.1/man
    PERLBREW_PATH=/home/suppy/perl5/perlbrew/bin:/home/suppy/perl5/perlbrew/perls/perl-5.20.1/bin
    PERLBREW_PERL=perl-5.20.1
    PERLBREW_ROOT=/home/suppy/perl5/perlbrew
    PERLBREW_VERSION=0.64
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Dec 25, 2014

From @cpansprout

On Thu Dec 25 01​:17​:30 2014, andreas.guldstrand@​gmail.com wrote​:

This is a bug report for perl from andreas.guldstrand@​gmail.com,
generated with the help of perlbug 1.40 running under perl 5.20.1.

-----------------------------------------------------------------
[Please describe your issue here]

Running gmtime("NaN"); in void or scalar context causes a segmentation
fault

I have fixed this in d8bd3d8.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Dec 25, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Dec 25, 2014

@cpansprout - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2015

From @khwilliamson

Thanks for submitting this ticket

The issue should be resolved with the release today of Perl v5.22, available at http​://www.perl.org/get.html
If you find that the problem persists, feel free to reopen this ticket

--
Karl Williamson for the Perl 5 porters team

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2015

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant