Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 527 forks source link

Bus error from C<sub $a> #6321

Closed p5pRT closed 21 years ago

p5pRT commented 21 years ago

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

Searchable as RT21316$

p5pRT commented 21 years ago

From Robin.Barker@npl.co.uk

Created by Robin.Barker@npl.co.uk

This short piece of code   perl -e 'sub { sub $a; open my $f; die; }' produces   Bus error

If you change anything 'sub'\, 'open'\, 'my' or 'die' you get a syntax error (and sometimes a bus error).

Robin

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.8.0: Configured by rmb1 at Thu Dec 5 12:36:40 GMT 2002. Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=solaris, osvers=2.6, archname=sun4-solaris-64int uname='sunos capulin 5.6 generic_105181-32 sun4m sparc sunw,sparcstation-20 ' config_args='-des -Dcc=gcc -Doptimize=-O3 -Dcf_email=Robin.Barker@npl.co.uk -Duse64bitint -Dman3dir=none -Uinstallusrbinperl -Dinc_version_list=5.7.3 5.7.2 5.7.1 5.6.1 5.6.0 5.005' 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=define use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O3', cppflags='-fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='2.95.1 19990816 (release)', gccosandvers='solaris2.6' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldb -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib' Locally applied patches: @INC for perl v5.8.0: /home/rmb1/appl/lib/perl5/site_perl/5.8.0/sun4-solaris-64int /home/rmb1/appl/lib/perl5/site_perl/5.8.0 /home/rmb1/appl/lib/perl5/site_perl/5.7.3 /home/rmb1/appl/lib/perl5/site_perl/5.7.2 /home/rmb1/appl/lib/perl5/site_perl/5.6.1 /home/rmb1/appl/lib/perl5/site_perl/5.6.0 /home/rmb1/appl/lib/perl5/site_perl/5.005 /home/rmb1/appl/lib/perl5/site_perl /usr/local/lib/perl5/5.8.0/sun4-solaris-64int /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris-64int /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl/5.005 /usr/local/lib/perl5/site_perl . Environment for perl v5.8.0: HOME=/home/rmb1 LANG=C LANGUAGE (unset) LD_LIBRARY_PATH=/usr/lib LOGDIR (unset) PATH=/home/rmb1/appl/script:/opt/SUNWspci/bin/:/usr/tempest/bin:/usr/loc al/bin:/usr/local/Admigration/exec:/usr/local/hotjava/bin:/usr/openwin/b in:/usr/dt/bin:/usr/ccs/bin:/usr/bin PERL5LIB=/home/rmb1/appl/lib/perl5/site_perl PERL_BADLANG (unset) SHELL=/bin/tcsh -i perlbug@perl.org ------------------------------------------------------------------- This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. NPL Management Ltd cannot guarantee that the e-mail or any attachments are free from viruses. NPL Management Ltd. Registered in England and Wales. No: 2937881 Registered Office: Teddington, Middlesex, United Kingdom TW11 0LW. ------------------------------------------------------------------- ```
p5pRT commented 21 years ago

From @iabyn

On Thu\, Feb 20\, 2003 at 10​:52​:47AM -0000\, Robin Barker wrote​:

This short piece of code perl -e 'sub { sub $a; open my $f; die; }' produces Bus error

If you change anything 'sub'\, 'open'\, 'my' or 'die' you get a syntax error (and sometimes a bus error).

it gives the following in bleedperl​:

$ ./perl -e 'sub { sub $a; open my $f; die; }' Illegal declaration of anonymous subroutine at -e line 1.

IIRC correctly\, this was fixed by the patch that handled "sub;".

-- "You're so sadly neglected\, and often ignored. A poor second to Belgium\, When going abroad." Monty Python - "Finland"

p5pRT commented 21 years ago

@rspier - Status changed from 'new' to 'resolved'