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

perl 5.8.5 on x86 and x86-64 hang at compile-time #7873

Closed
p5pRT opened this issue Apr 12, 2005 · 8 comments
Closed

perl 5.8.5 on x86 and x86-64 hang at compile-time #7873

p5pRT opened this issue Apr 12, 2005 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 12, 2005

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

Searchable as RT34934$

@p5pRT
Copy link
Author

p5pRT commented Apr 12, 2005

From bstrand@switchmanagement.com

Created by bstrand@switchmanagement.com

On Suse 9.2, perl 5.8.5 x86 or x86-64, the following perl snippet
hangs the compiler with 100% CPU usage​:

perl -we 'BEGIN { print "compile-time\n"; } use strict; my $type = 2; print join(" ", grep $type (1,2,3,2,4,2,5)), "\n"; BEGIN { print "never get here\n"; }'

The preferred behavior would be to output

compile-time
never get here
1 2 3 2 4 2 5

The behavior under Suse 8.2, perl 5.8.0 x86 is the rather bizarre (or perhaps I'm
misunderstanding grep)​:

compile-time
never get here
1 2 3 2

Perl Info

Flags:
    category=core
    severity=medium

This perlbug was built using Perl v5.8.5 - Fri Oct  1 23:29:33 UTC 2004
It is being executed now by  Perl v5.8.5 - Fri Oct  1 23:24:00 UTC 2004.

Site configuration information for perl v5.8.5:

Configured by abuild at Fri Oct  1 23:24:00 UTC 2004.

Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
  Platform:
    osname=linux, osvers=2.6.8.1, archname=i586-linux-thread-multi
    uname='linux g168 2.6.8.1 #1 smp thu jul 1 15:23:45 utc 2004 i686 i686 i386 gnulinux '
    config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm -Duseshrplib=true -Doptimize=-O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -Wall -pipe'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -Wall -pipe',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe'
    ccversion='', gccversion='3.3.4 (pre 3.3.5 20040809)', 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 =''
    libpth=/lib /usr/lib /usr/local/lib
    libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.3.3'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.5/i586-linux-thread-multi/CORE'
    cccdlflags='-fPIC', lddlflags='-shared'

Locally applied patches:
    


@INC for perl v5.8.5:
    /home/bstrand/perl/lib
    /usr/lib/perl5/5.8.5/i586-linux-thread-multi
    /usr/lib/perl5/5.8.5
    /usr/lib/perl5/site_perl/5.8.5/i586-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.5
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.5
    /usr/lib/perl5/vendor_perl
    .


Environment for perl v5.8.5:
    HOME=/home/bstrand
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/home/bstrand/lib:/opt/u01/app/oracle/product/current_version/lib
    LOGDIR (unset)
    PATH=/home/bstrand/bin:/opt/u01/app/oracle/product/current_version/bin:/home/bstrand/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/jvm/jre/bin:/opt/u01/app/oracle/product/current_version/bin
    PERL5LIB=/home/bstrand/perl/lib
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Apr 12, 2005

From @schwern

On Tue, Apr 12, 2005 at 07​:12​:58PM -0000, bstrand @​ switchmanagement. com wrote​:

On Suse 9.2, perl 5.8.5 x86 or x86-64, the following perl snippet
hangs the compiler with 100% CPU usage​:

perl -we 'BEGIN { print "compile-time\n"; } use strict; my $type = 2; print join(" ", grep $type (1,2,3,2,4,2,5)), "\n"; BEGIN { print "never get here\n"; }'

Confirmed on OS X 5.8.6.

The behavior under Suse 8.2, perl 5.8.0 x86 is the rather bizarre (or perhaps I'm
misunderstanding grep)​:

compile-time
never get here
1 2 3 2

Confirmed on OS X 5.8.1RC3. That is bizarre.

@p5pRT
Copy link
Author

p5pRT commented Apr 12, 2005

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

@p5pRT
Copy link
Author

p5pRT commented Apr 12, 2005

From @rgarcia

On Apr 12, 2005 10​:19 PM, Michael G Schwern <schwern@​pobox.com> wrote​:

perl -we 'BEGIN { print "compile-time\n"; } use strict; my $type = 2; print join(" ", grep $type (1,2,3,2,4,2,5)), "\n"; BEGIN { print "never get here\n"; }'

Confirmed on OS X 5.8.6.

It loops in ck_grep.
Maybe introduced by change 22667, which was fixing another compiler
loop bug at the same place.

@p5pRT
Copy link
Author

p5pRT commented Apr 12, 2005

From @tamias

On Tue, Apr 12, 2005 at 07​:12​:58PM -0000, bstrand @​ switchmanagement. com wrote​:

On Suse 9.2, perl 5.8.5 x86 or x86-64, the following perl snippet
hangs the compiler with 100% CPU usage​:

perl -we 'BEGIN { print "compile-time\n"; } use strict; my $type = 2; print join(" ", grep $type (1,2,3,2,4,2,5)), "\n"; BEGIN { print "never get here\n"; }'

The preferred behavior would be to output

compile-time
never get here
1 2 3 2 4 2 5

For what it's worth, the syntax is wrong. grep takes either a block with
curly braces or an expression with a comma. This code has an expression
without a comma. I'm not sure why it doesn't throw an error.

Deparse adds the comma​:

% perl -MO=Deparse -e 'my $type = 2; print join(" ", grep $type (1,2,3,2,4,2,5)), "\n"'
my $type = 2;
print join(' ', grep($type, 1, 2, 3, 2, 4, 2, 5)), "\n";
-e syntax OK
%

With the comma, the expected output is produced.

Ronald

@p5pRT
Copy link
Author

p5pRT commented Apr 13, 2005

From nick@ing-simmons.net

Bstrand @​ Switchmanagement . Com <perl5-porters@​perl.org> writes​:

# New Ticket Created by bstrand@​switchmanagement.com
# Please include the string​: [perl #34934]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=34934 >

This is a bug report for perl from bstrand@​switchmanagement.com,
generated with the help of perlbug 1.35 running under perl v5.8.5.

-----------------------------------------------------------------
[Please enter your report here]

On Suse 9.2, perl 5.8.5 x86 or x86-64, the following perl snippet
hangs the compiler with 100% CPU usage​:

perl -we 'BEGIN { print "compile-time\n"; } use strict; my $type = 2; print join(" ", grep $type (1,2,3,2,4,2,5)), "\n"; BEGIN { print "never get here\n"; }'

I can reproduce this - something has built a self reference loop​:

Program received signal SIGINT, Interrupt.
0x08098e8c in Perl_ck_grep (my_perl=0x814f008, o=0x81538d8) at op.c​:5575
5575 for (k = cUNOPx(kid)->op_first; k; k = k->op_next) {

(gdb) print k
$3 = (OP *) 0x8153958
(gdb) print *k
$4 = {op_next = 0x8153958, op_sibling = 0x0, op_ppaddr = 0x80c3a80 <Perl_pp_padsv>,
  op_targ = 1, op_type = 9, op_seq = 0, op_flags = 2 '\002', op_private = 0 '\0'}

The preferred behavior would be to output

compile-time
never get here
1 2 3 2 4 2 5

The behavior under Suse 8.2, perl 5.8.0 x86 is the rather bizarre (or perhaps I'm
misunderstanding grep)​:

compile-time
never get here
1 2 3 2

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=core
severity=medium
---
This perlbug was built using Perl v5.8.5 - Fri Oct 1 23​:29​:33 UTC 2004
It is being executed now by Perl v5.8.5 - Fri Oct 1 23​:24​:00 UTC 2004.

Site configuration information for perl v5.8.5​:

Configured by abuild at Fri Oct 1 23​:24​:00 UTC 2004.

Summary of my perl5 (revision 5 version 8 subversion 5) configuration​:
Platform​:
osname=linux, osvers=2.6.8.1, archname=i586-linux-thread-multi
uname='linux g168 2.6.8.1 #1 smp thu jul 1 15​:23​:45 utc 2004 i686 i686 i386 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm -Duseshrplib=true -Doptimize=-O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -Wall -pipe'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -Wall -pipe',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe'
ccversion='', gccversion='3.3.4 (pre 3.3.5 20040809)', 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 =''
libpth=/lib /usr/lib /usr/local/lib
libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.3'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.5/i586-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared'

Locally applied patches​:

---
@​INC for perl v5.8.5​:
/home/bstrand/perl/lib
/usr/lib/perl5/5.8.5/i586-linux-thread-multi
/usr/lib/perl5/5.8.5
/usr/lib/perl5/site_perl/5.8.5/i586-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.5/i586-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl
.

---
Environment for perl v5.8.5​:
HOME=/home/bstrand
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH=/home/bstrand/lib​:/opt/u01/app/oracle/product/current_version/lib
LOGDIR (unset)
PATH=/home/bstrand/bin​:/opt/u01/app/oracle/product/current_version/bin​:/home/bstrand/bin​:/usr/local/bin​:/usr/bin​:/usr/X11R6/bin​:/bin​:/usr/games​:/opt/gnome/bin​:/opt/kde3/bin​:/usr/lib/jvm/jre/bin​:/opt/u01/app/oracle/product/current_version/bin
PERL5LIB=/home/bstrand/perl/lib
PERL_BADLANG (unset)
SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Apr 14, 2005

@rgs - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Apr 14, 2005
@p5pRT
Copy link
Author

p5pRT commented Apr 14, 2005

From @rgs

Rafael Garcia-Suarez wrote​:

On Apr 12, 2005 10​:19 PM, Michael G Schwern <schwern@​pobox.com> wrote​:

perl -we 'BEGIN { print "compile-time\n"; } use strict; my $type = 2; print join(" ", grep $type (1,2,3,2,4,2,5)), "\n"; BEGIN { print "never get here\n"; }'

Confirmed on OS X 5.8.6.

It loops in ck_grep.
Maybe introduced by change 22667, which was fixing another compiler
loop bug at the same place.

It was effectively introduced by that change, which I amended with #24237.

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