Subject: | ns::a makes perl hang when code contains "while (1) { }" |
The script below sends perl into an endless loop. The problem surfaced
when 'use'ing HTTP::Message in combination with ns::alias.
Following code should reproduce the issue:
use v5.10.1;
use Plack::Middleware::Head;
use namespace::alias 'Plack::Middleware';
# this structure is the culprit
# (HTTP::Message contains an analogous structure):
sub { while (1) { say "bla" } }
say Middleware::Head->new;
$ perl -V
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
Platform:
osname=linux, osvers=2.6.32-31-generic, archname=i686-linux
uname='linux alexander-desktop 2.6.32-31-generic #61-ubuntu smp fri
apr 8 18:24:35 utc 2011 i686 gnulinux '
config_args='-de -Dprefix=/home/consys/perl5/perlbrew/perls/perl-5.10.1'
hint=recommended, useposix=true, d_sigaction=define
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 -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include'
ccversion='', gccversion='4.4.3', 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 =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib
/usr/lib/i486-linux-gnu /usr/lib64
libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.11.1.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.11.1'
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'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
USE_LARGE_FILES USE_PERLIO
Built under linux
Compiled at May 31 2011 16:01:12
%ENV:
PERLBREW_BASHRC_VERSION="0.30"
PERLBREW_HOME="/home/consys/.perlbrew"
PERLBREW_PATH="/home/consys/perl5/perlbrew/bin:/home/consys/perl5/perlbrew/perls/perl-5.10.1/bin"
PERLBREW_PERL="perl-5.10.1"
PERLBREW_ROOT="/home/consys/perl5/perlbrew"
PERLBREW_VERSION="0.30"
@INC:
/home/consys/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux
/home/consys/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1
/home/consys/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/i686-linux
/home/consys/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1