develooper Front page | perl.perl5.porters | Postings from August 2013

[perl #32581] Bytecode Array Element Regression

Thread Next
From:
James E Keenan via RT
Date:
August 10, 2013 01:05
Subject:
[perl #32581] Bytecode Array Element Regression
Message ID:
rt-3.6.HEAD-2552-1376096740-1814.32581-15-0@perl.org
On Tue Nov 23 08:27:38 2004, smylers@stripey.com wrote:
> This is a bug report for perl from Smylers@stripey.com,
> generated with the help of perlbug 1.35 running under perl v5.8.5.
> 
> 
> -----------------------------------------------------------------
> Hello there.  I think we've encountered a regression with bytecoding:
> something that works in Perl 5.8.2 but not 5.8.5.  I know that
> B::Bytecode labels itself as highly experimental and risky, but I
> mentioned this to Nicholas Clark (in a bar) and he said it was worth
> reporting because even experimental and risky things shouldn't get
>    worse
> between releases.
> 
> These two lines are array1.pl:
> 
>   my @a = (1);
>   $a[0];
> 
> We're using FreeBSD; I haven't been able to test this on any other OS.
> This is an attempt to turn it into bytecode, saving it to the file
>    byte;
> it fails:
> 
>   % perl5.8.5 -MO=Bytecode,-obyte array1.pl
>   Can't locate object method "ix" via package "U��
>                                                   WVS�" at
>   /usr/local/lib/perl5/5.8.5/mach/B/Bytecode.pm line 575.
>   CHECK failed--call queue aborted.
> 
> But it succeeds if the filename used has at least 5 characters in it:
> 
>   % perl5.8.5 -MO=Bytecode,-obyte2 array1.pl
>   array1.pl syntax OK
> 
> It also fails when writing to standard output:
> 
>   % perl5.8.5 -MO=Bytecode array1.pl > byte2
>   Can't locate object method "ix" via package "U��
>                                                   WVS�" at
>   /usr/local/lib/perl5/5.8.5/mach/B/Bytecode.pm line 575.
>   CHECK failed--call queue aborted.
> 
> This is array2.pl, which also fails to be bytecoded:
> 
>   my @array = qw<a b c>;
>   my ($s1) = @array; # list assignment
>   my @copy = @array;
>   my ($s2) = shift @copy; # shift
>   my ($s3) = @array[0]; # slice
>   my ($s4) = $array[0]; # element
> 
> It's only the last line, accessing a single array element, of that
>    file
> which fails when trying to convert it into bytecode; with that line
> removed everything works.  Here's the error message, which is slightly
> different from that with array1.pl, in that the package name is
> readable:
> 
>   % perl5.8.5 -MO=Bytecode,-obyte array2.pl
>   Can't locate object method "ix" via package "main" at
>   /usr/local/lib/perl5/5.8.5/mach/B/Bytecode.pm line 575.
>   CHECK failed--call queue aborted.
> 
> This time using a longer output filename doesn't seem to make it work.
> 
> None of these errors occur when using perl5.8.2 instead of perl5.8.5.
> (I haven't tried 5.8.3 or 5.8.4.)  I haven't spotted any significant
> differences in their configuration.  5.8.2 was installed using this
> package:
> 
>   ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-4.10-
>    release/All/perl-5.8.2_5.tgz
> 
> I first tried 5.8.5 with this package:
> 
>   ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-4-
>    stable/lang/perl-5.8.5.tgz
> 
> That differed from the 5.8.2 package in having 64-bit integer support,
> so I then used the FreeBSD port for 5.8.5 and built it
> WITHOUT_PERL-64BITINT to eliminate that from our inquiries.  Below are
> the configs for 5.8.2 and then for 5.8.5 (without 64-bit int).
> 
> Thanks for looking at this.  Let me know if there's any more
>    information
> I can provide.
> 
> Smylers
> 
> 
> ---
> Flags:
>     category=
>     severity=
> ---
> Site configuration information for perl v5.8.2:
> 
> Configured by root at Wed Apr 28 22:36:19 GMT 2004.
> 
> Summary of my perl5 (revision 5.0 version 8 subversion 2)
>    configuration:
>   Platform:
>     osname=freebsd, osvers=4.10-rc, archname=i386-freebsd
>     uname='freebsd freebsd.org 4.10-rc freebsd 4.10-rc #0: wed apr 28
>    15:32:52 pdt 2004 kris@freebsd.org:usrsrcsysmagickernelpath i386 '
>     config_args='-sde -Dprefix=/usr/local
>    -Darchlib=/usr/local/lib/perl5/5.8.2/mach
>    -Dprivlib=/usr/local/lib/perl5/5.8.2
>    -Dman3dir=/usr/local/lib/perl5/5.8.2/man/man3
>    -Dman1dir=/usr/local/man/man1
>    -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.2/mach
>    -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.2
>    -Dscriptdir=/usr/local/bin -Ui_malloc -Ui_iconv -Uinstallusrbinperl
>    -Dcc=cc -Doptimize=-O -pipe  -Duseshrplib
>    -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.2/BSDPAN"
>    -Ud_dosuid -Ui_gdbm -Dusethreads=n -Dusemymalloc=y'
>     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=undef use64bitall=undef uselongdouble=undef
>     usemymalloc=y, bincompat5005=undef
>   Compiler:
>     cc='cc', ccflags ='-
>    DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.2/BSDPAN" -DHAS_FPSETMASK
>    -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include',
>     optimize='-O -pipe ',
>     cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.2/BSDPAN"
>    -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing
>    -I/usr/local/include'
>     ccversion='', gccversion='2.95.4 20020320 [FreeBSD]',
>    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 ='-Wl,-E  -L/usr/local/lib'
>     libpth=/usr/lib /usr/local/lib
>     libs=-lm -lcrypt -lutil -lc
>     perllibs=-lm -lcrypt -lutil -lc
>     libc=, so=so, useshrplib=true, libperl=libperl.so
>     gnulibc_version=''
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='
>    -Wl,-R/usr/local/lib/perl5/5.8.2/mach/CORE'
>     cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'
> 
> Locally applied patches:
> 
> 
> ---
> @INC for perl v5.8.2:
>     /usr/local/lib/perl5/site_perl/5.8.2/mach
>     /usr/local/lib/perl5/site_perl/5.8.2
>     /usr/local/lib/perl5/site_perl
>     /usr/local/lib/perl5/5.8.2/BSDPAN
>     /usr/local/lib/perl5/5.8.2/mach
>     /usr/local/lib/perl5/5.8.2
>     .
> 
> ---
> Environment for perl v5.8.2:
>     HOME=/usr/home/smyers
>     LANG=C
>     LANGUAGE (unset)
>     LC_COLLATE=C
>     LD_LIBRARY_PATH (unset)
>     LOGDIR (unset)
>    
PATH=/usr/home/smyers/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/games:/usr/local/apache/bin:/usr/local/mysql/bin
>     PERL_BADLANG (unset)
>     SHELL=/usr/local/bin/bash
> -----------------------------------------------------------------
> ---
> Flags:
>     category=core
>     severity=low
> ---
> Site configuration information for perl v5.8.5:
> 
> Configured by smyers at Tue Nov 23 11:05:21 GMT 2004.
> 
> Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
>   Platform:
>     osname=freebsd, osvers=4.10-stable, archname=i386-freebsd
>     uname='freebsd server31.donc.donhost.co.uk 4.10-stable freebsd
>    4.10-stable #3: wed jun 2 16:43:14 bst 2004
>    root@server31.donhost.co.uk:usrobjusrsrcsysdonhost i386 '
>     config_args='-sde -Dprefix=/usr/local
>    -Darchlib=/usr/local/lib/perl5/5.8.5/mach
>    -Dprivlib=/usr/local/lib/perl5/5.8.5
>    -Dman3dir=/usr/local/lib/perl5/5.8.5/perl/man/man3
>    -Dman1dir=/usr/local/man/man1
>    -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.5/mach
>    -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.5
>    -Dscriptdir=/usr/local/bin
>    -Dsiteman3dir=/usr/local/lib/perl5/5.8.5/man/man3
>    -Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv
>    -Uinstallusrbinperl -Dcc=cc -Doptimize=-O -pipe -Duseshrplib
>    -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.5/BSDPAN"
>    -Ud_dosuid -Ui_gdbm -Dusethreads=n -Dusemymalloc=y'
>     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=undef use64bitall=undef uselongdouble=undef
>     usemymalloc=y, bincompat5005=undef
>   Compiler:
>     cc='cc', ccflags ='-
>    DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.5/BSDPAN" -DHAS_FPSETMASK
>    -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe
>    -I/usr/local/include',
>     optimize='-O -pipe',
>     cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.5/BSDPAN"
>    -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe
>    -I/usr/local/include'
>     ccversion='', gccversion='2.95.4 20020320 [FreeBSD]',
>    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 ='-Wl,-E  -L/usr/local/lib'
>     libpth=/usr/lib /usr/local/lib
>     libs=-lm -lcrypt -lutil -lc
>     perllibs=-lm -lcrypt -lutil -lc
>     libc=, so=so, useshrplib=true, libperl=libperl.so
>     gnulibc_version=''
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='
>    -Wl,-R/usr/local/lib/perl5/5.8.5/mach/CORE'
>     cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'
> 
> Locally applied patches:
> 
> 
> ---
> @INC for perl v5.8.5:
>     /usr/local/lib/perl5/site_perl/5.8.5/mach
>     /usr/local/lib/perl5/site_perl/5.8.5
>     /usr/local/lib/perl5/site_perl/5.8.2
>     /usr/local/lib/perl5/site_perl/5.005
>     /usr/local/lib/perl5/site_perl
>     /usr/local/lib/perl5/5.8.5/BSDPAN
>     /usr/local/lib/perl5/5.8.5/mach
>     /usr/local/lib/perl5/5.8.5
>     .
> 
> ---
> Environment for perl v5.8.5:
>     HOME=/usr/home/smyers
>     LANG=C
>     LANGUAGE (unset)
>     LC_COLLATE=C
>     LD_LIBRARY_PATH (unset)
>     LOGDIR (unset)
>    
PATH=/usr/home/smyers/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/games:/usr/local/apache/bin:/usr/local/mysql/bin
>     PERL_BADLANG (unset)
>     SHELL=/usr/local/bin/bash


This ticket has languished for nine years.  I recommend we close it
since (a) B::Bytecode is part of the B-C distribution, which is no
longer distributed with the Perl 5 core distribution (not since 5.9.5);
(b) I can't get the most recent B-C distribution (1.42) to build with
Perl 5.18.0 on two different platforms
(http://code.google.com/p/perl-compiler/issues/detail?id=120), so I
can't debug this further.

I am taking the ticket for the purpose of closing it within seven days
unless someone wishes to take the ticket over and move the discussion
forward.

Thank you very much.
Jim Keenan

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=32581

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About