Perl / perl5

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

Perl dumps core doing array slices after using FileHandle package #3973

Closed p5pRT closed 20 years ago

p5pRT commented 23 years ago

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

Searchable as RT6975$

p5pRT commented 23 years ago

From marc@tensilica.com

I've also included a sample debugging session including traceback of perl using a debug version of Perl 5.6.1. It seems perl crashes because of a dereference of PL_last_in_gv->sv_any->xgv_gp which is NULL.

-Marc

Marc E. Gauthier\, marc@​tensilica.com 408-327-7384

PS. I don't speak for my employer!


use FileHandle;

sub foo {   my $fh = new FileHandle ('/dev/null'\, '\<');   die("$​::myname​: $!\, opening some arbitrary existing file for input.\n") unless $fh;   my $tmp = \<$fh>;   $fh->close(); }

foo();

print STDERR "Before.\n";

my @​array = (1\, 2\, 3\, 4\, 5);

print STDERR "Middle.\n";

my @​two = $array[2 .. 4];

print STDERR "After.\n";


$ gdb /export/home1/marc/perl/debug/bin/perl GNU gdb 19991004 Copyright 1998 Free Software Foundation\, Inc. GDB is free software\, covered by the GNU General Public License\, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux"... (gdb) run c.pl Starting program​: /export/home1/marc/perl/debug/bin/perl c.pl Before. Middle.

Program received signal SIGSEGV\, Segmentation fault. 0x80f1b9c in Perl_pp_flip () at pp_ctl.c​:1031 1031 flip = PL_last_in_gv (gdb) where #0 0x80f1b9c in Perl_pp_flip () at pp_ctl.c​:1031 #1 0x80b827a in Perl_runops_debug () at run.c​:53 #2 0x805d791 in S_run_body (oldscope=1) at perl.c​:1471 #3 0x805d38c in perl_run (my_perl=0x81490c8) at perl.c​:1393 #4 0x805a1fb in main (argc=2\, argv=0xbffff704\, env=0xbffff710) at perlmain.c​:52 (gdb) l 1026 SV *targ = PAD_SV(PL_op->op_targ); 1027 int flip; 1028 1029 if (PL_op->op_private & OPpFLIP_LINENUM) { 1030 struct io *gp_io; 1031 flip = PL_last_in_gv 1032 && (gp_io = GvIOp(PL_last_in_gv)) 1033 && SvIV(sv) == (IV)IoLINES(gp_io); 1034 } else { 1035 flip = SvTRUE(sv); (gdb) p PL_last_in_gv->sv_any->xgv_gp $8 = (GP *) 0x0 (gdb) p PL_last_in_gv->sv_any $6 = (XPVGV *) 0x81a20dc (gdb) p *PL_last_in_gv->sv_any $7 = {xpv_pv = 0x1b6 \<Address 0x1b6 out of bounds>\, xpv_cur = 3\, xpv_len = 2\, xiv_iv = 1\,   xnv_nv = 1.2369596226966011e-269\, xmg_magic = 0x4\, xmg_stash = 0x0\, xgv_gp = 0x0\,   xgv_name = 0x1 \<Address 0x1 out of bounds>\, xgv_namelen = 4294967295\, xgv_stash = 0x0\,   xgv_flags = 0 '\000'} (gdb) p PL_last_in_gv $4 = (GV *) 0x8159a30 (gdb) p *PL_last_in_gv $5 = {sv_any = 0x81a20dc\, sv_refcnt = 1\, sv_flags = 16842753} (gdb) q The program is running. Exit anyway? (y or n) y



Flags​:   category=core   severity=critical


Site configuration information for perl v5.6.1​:

Configured by marc at Tue May 1 14​:14​:56 PDT 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration​:   Platform​:   osname=linux\, osvers=2.2.14-5.0\, archname=i686-linux   uname='linux gauthier.hq.tensilica.com 2.2.14-5.0 #1 tue mar 7 21​:07​:39 est 2000 i686 unknown '   config_args='-de'   hint=recommended\, useposix=true\, d_sigaction=define   usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef   useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef   use64bitint=undef use64bitall=undef uselongdouble=undef   Compiler​:   cc='cc'\, ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'\,   optimize='-O2'\,   cppflags='-fno-strict-aliasing'   ccversion=''\, gccversion='egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)'\, 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\, usemymalloc=n\, prototype=define   Linker and Libraries​:   ld='cc'\, ldflags =' -L/usr/local/lib'   libpth=/usr/local/lib /lib /usr/lib   libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt -lutil   perllibs=-lnsl -ldl -lm -lc -lposix -lcrypt -lutil   libc=/lib/libc-2.1.3.so\, so=so\, useshrplib=false\, libperl=libperl.a   Dynamic Linking​:   dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags='-rdynamic'   cccdlflags='-fpic'\, lddlflags='-shared -L/usr/local/lib'

Locally applied patches​:


@​INC for perl v5.6.1​:   /usr/local/lib/perl5/5.6.1/i686-linux   /usr/local/lib/perl5/5.6.1   /usr/local/lib/perl5/site_perl/5.6.1/i686-linux   /usr/local/lib/perl5/site_perl/5.6.1   /usr/local/lib/perl5/site_perl   .


Environment for perl v5.6.1​:   HOME=/home/marc   LANG (unset)   LANGUAGE (unset)   LD_LIBRARY_PATH (unset)   LOGDIR (unset)

PATH=/opt/kde/bin​:/usr/local/bin​:/bin​:/usr/bin​:/usr/X11R6/bin​:/usr/X11R6/bin :/home/marc/w/alameda/builds/LinuxBE/Tensilica/bin​:/home/marc/w/alameda/xtoo ls/bin​:/home/marc/w/alameda/swtools-x86-linux/bin​:/home/marc/w/alameda/build s/LinuxBE/xbuild/RTOS/vxworks/host/i686-Linux/bin​:/usr/games​:/home/marc/bin​: /usr/ucb​:/usr/openwin/bin​:/sbin​:/usr/sbin​:/etc   PERL_BADLANG (unset)   SHELL=/bin/tcsh

Complete configuration data for perl v5.6.1​:

Author='' CONFIG='true' CONFIGDOTSH='true' Date='$Date' Header='' Id='$Id' Locker='' Log='$Log' Mcc='Mcc' PATCHLEVEL='6' PERL_API_REVISION='5' PERL_API_SUBVERSION='0' PERL_API_VERSION='5' PERL_REVISION='5' PERL_SUBVERSION='1' PERL_VERSION='6' RCSfile='$RCSfile' Revision='$Revision' SUBVERSION='1' Source='' State='' _a='.a' _exe='' _o='.o' afs='false' alignbytes='4' ansi2knr='' aphostname='/bin/hostname' api_revision='5' api_subversion='0' api_version='5' api_versionstring='5.005' ar='ar' archlib='/usr/local/lib/perl5/5.6.1/i686-linux' archlibexp='/usr/local/lib/perl5/5.6.1/i686-linux' archname='i686-linux' archname64='' archobjs='' awk='awk' baserev='5.0' bash='' bin='/usr/local/bin' bincompat5005='define' binexp='/usr/local/bin' bison='bison' byacc='byacc' byteorder='1234' c='' castflags='0' cat='cat' cc='cc' cccdlflags='-fpic' ccdlflags='-rdynamic' ccflags='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ccname='gcc' ccsymbols='__GNUC_MINOR__=91 __i386=1 __i386__=1 __linux=1 __linux__=1 __tune_i386__=1 __unix=1 __unix__=1 cpu=i386 machine=i386 system=posix system=unix' ccversion='' cf_by='marc' cf_email='marc@​tensilica.com' cf_time='Tue May 1 14​:14​:56 PDT 2001' charsize='1' chgrp='' chmod='' chown='' clocktype='clock_t' comm='comm' compress='' config_arg0='Configure' config_arg1='-de' config_argc='1' config_args='-de' contains='grep' cp='cp' cpio='' cpp='cpp' cpp_stuff='42' cppccsymbols='__ELF__=1 __GNUC__=2 i386=1 linux=1 unix=1' cppflags='-fno-strict-aliasing' cpplast='-' cppminus='-' cpprun='cc -E' cppstdin='cc -E' cppsymbols='_FILE_OFFSET_BITS=64 __GNUC_MINOR__=91 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=199506 _POSIX_SOURCE=1 __STDC__=1 __i386=1 __i386__=1 __linux=1 __linux__=1 __unix=1 __unix__=1' crosscompile='' cryptlib='' csh='csh' d_Gconvert='gcvt((x)\,(n)\,(b))' d_PRIEUldbl='define' d_PRIFUldbl='define' d_PRIGUldbl='define' d_PRIXU64='define' d_PRId64='define' d_PRIeldbl='define' d_PRIfldbl='define' d_PRIgldbl='define' d_PRIi64='define' d_PRIo64='define' d_PRIu64='define' d_PRIx64='define' d_SCNfldbl='define' d__fwalk='' d_access='define' d_accessx='' d_alarm='define' d_archlib='define' d_atolf='' d_atoll='define' d_attribut='define' d_bcmp='define' d_bcopy='define' d_bincompat5005='define' d_bsd='' d_bsdgetpgrp='' d_bsdsetpgrp='' d_bzero='define' d_casti32='' d_castneg='define' d_charvspr='' d_chown='define' d_chroot='define' d_chsize='' d_closedir='define' d_const='define' d_crypt='define' d_csh='define' d_cuserid='define' d_dbl_dig='define' d_difftime='define' d_dirnamlen='' d_dlerror='define' d_dlopen='define' d_dlsymun='' d_dosuid='' d_drand48proto='define' d_dup2='define' d_eaccess='' d_endgrent='define' d_endhent='define' d_endnent='define' d_endpent='define' d_endpwent='define' d_endsent='define' d_eofnblk='define' d_eunice='' d_fchmod='define' d_fchown='define' d_fcntl='define' d_fcntl_can_lock='define' d_fd_macros='define' d_fd_set='define' d_fds_bits='' d_fgetpos='define' d_flexfnam='define' d_flock='define' d_fork='define' d_fpathconf='define' d_fpos64_t='' d_frexpl='define' d_fs_data_s='' d_fseeko='define' d_fsetpos='define' d_fstatfs='define' d_fstatvfs='define' d_fsync='define' d_ftello='define' d_ftime='' d_getcwd='define' d_getespwnam='' d_getfsstat='' d_getgrent='define' d_getgrps='define' d_gethbyaddr='define' d_gethbyname='define' d_gethent='define' d_gethname='define' d_gethostprotos='define' d_getlogin='define' d_getmnt='' d_getmntent='define' d_getnbyaddr='define' d_getnbyname='define' d_getnent='define' d_getnetprotos='define' d_getpagsz='define' d_getpbyname='define' d_getpbynumber='define' d_getpent='define' d_getpgid='define' d_getpgrp='define' d_getpgrp2='' d_getppid='define' d_getprior='define' d_getprotoprotos='define' d_getprpwnam='' d_getpwent='define' d_getsbyname='define' d_getsbyport='define' d_getsent='define' d_getservprotos='define' d_getspnam='define' d_gettimeod='define' d_gnulibc='define' d_grpasswd='define' d_hasmntopt='define' d_htonl='define' d_iconv='define' d_index='' d_inetaton='define' d_int64_t='define' d_isascii='define' d_isnan='define' d_isnanl='define' d_killpg='define' d_lchown='define' d_ldbl_dig='define' d_link='define' d_locconv='define' d_lockf='define' d_longdbl='define' d_longlong='define' d_lseekproto='define' d_lstat='define' d_madvise='define' d_mblen='define' d_mbstowcs='define' d_mbtowc='define' d_memchr='define' d_memcmp='define' d_memcpy='define' d_memmove='define' d_memset='define' d_mkdir='define' d_mkdtemp='' d_mkfifo='define' d_mkstemp='define' d_mkstemps='' d_mktime='define' d_mmap='define' d_modfl='define' d_mprotect='define' d_msg='define' d_msg_ctrunc='define' d_msg_dontroute='define' d_msg_oob='define' d_msg_peek='define' d_msg_proxy='define' d_msgctl='define' d_msgget='define' d_msgrcv='define' d_msgsnd='define' d_msync='define' d_munmap='define' d_mymalloc='' d_nice='define' d_nv_preserves_uv='define' d_nv_preserves_uv_bits='32' d_off64_t='' d_old_pthread_create_joinable='' d_oldpthreads='' d_oldsock='' d_open3='define' d_pathconf='define' d_pause='define' d_perl_otherlibdirs='' d_phostname='' d_pipe='define' d_poll='define' d_portable='define' d_pthread_yield='' d_pwage='' d_pwchange='' d_pwclass='' d_pwcomment='' d_pwexpire='' d_pwgecos='define' d_pwpasswd='define' d_pwquota='' d_qgcvt='define' d_quad='define' d_readdir='define' d_readlink='define' d_rename='define' d_rewinddir='define' d_rmdir='define' d_safebcpy='define' d_safemcpy='' d_sanemcmp='define' d_sbrkproto='define' d_sched_yield='define' d_scm_rights='define' d_seekdir='define' d_select='define' d_sem='define' d_semctl='define' d_semctl_semid_ds='define' d_semctl_semun='define' d_semget='define' d_semop='define' d_setegid='define' d_seteuid='define' d_setgrent='define' d_setgrps='define' d_sethent='define' d_setlinebuf='define' d_setlocale='define' d_setnent='define' d_setpent='define' d_setpgid='define' d_setpgrp='define' d_setpgrp2='' d_setprior='define' d_setproctitle='' d_setpwent='define' d_setregid='define' d_setresgid='define' d_setresuid='define' d_setreuid='define' d_setrgid='' d_setruid='' d_setsent='define' d_setsid='define' d_setvbuf='define' d_sfio='' d_shm='define' d_shmat='define' d_shmatprototype='define' d_shmctl='define' d_shmdt='define' d_shmget='define' d_sigaction='define' d_sigsetjmp='define' d_socket='define' d_socklen_t='define' d_sockpair='define' d_socks5_init='' d_sqrtl='define' d_statblks='define' d_statfs_f_flags='' d_statfs_s='define' d_statvfs='define' d_stdio_cnt_lval='' d_stdio_ptr_lval='define' d_stdio_ptr_lval_nochange_cnt='' d_stdio_ptr_lval_sets_cnt='define' d_stdio_stream_array='' d_stdiobase='define' d_stdstdio='define' d_strchr='define' d_strcoll='define' d_strctcpy='define' d_strerrm='strerror(e)' d_strerror='define' d_strtod='define' d_strtol='define' d_strtold='define' d_strtoll='define' d_strtoul='define' d_strtoull='define' d_strtouq='define' d_strxfrm='define' d_suidsafe='' d_symlink='define' d_syscall='define' d_sysconf='define' d_sysernlst='' d_syserrlst='define' d_system='define' d_tcgetpgrp='define' d_tcsetpgrp='define' d_telldir='define' d_telldirproto='define' d_time='define' d_times='define' d_truncate='define' d_tzname='define' d_umask='define' d_uname='define' d_union_semun='' d_ustat='define' d_vendorarch='' d_vendorbin='' d_vendorlib='' d_vfork='' d_void_closedir='' d_voidsig='define' d_voidtty='' d_volatile='define' d_vprintf='define' d_wait4='define' d_waitpid='define' d_wcstombs='define' d_wctomb='define' d_xenix='' date='date' db_hashtype='u_int32_t' db_prefixtype='size_t' defvoidused='15' direntrytype='struct dirent' dlext='so' dlsrc='dl_dlopen.xs' doublesize='8' drand01='drand48()' dynamic_ext='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl File/Glob GDBM_File IO IPC/SysV Opcode POSIX SDBM_File Socket Sys/Hostname Sys/Syslog attrs re' eagain='EAGAIN' ebcdic='' echo='echo' egrep='egrep' emacs='' eunicefix='​:' exe_ext='' expr='expr' extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl File/Glob GDBM_File IO IPC/SysV Opcode POSIX SDBM_File Socket Sys/Hostname Sys/Syslog attrs re Errno' fflushNULL='define' fflushall='' find='' firstmakefile='makefile' flex='' fpossize='8' fpostype='fpos_t' freetype='void' full_ar='/usr/bin/ar' full_csh='/bin/csh' full_sed='/bin/sed' gccosandvers='' gccversion='egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)' gidformat='"lu"' gidsign='1' gidsize='4' gidtype='gid_t' glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib ' grep='grep' groupcat='cat /etc/group' groupstype='gid_t' gzip='gzip' h_fcntl='false' h_sysfile='true' hint='recommended' hostcat='cat /etc/hosts' i16size='2' i16type='short' i32size='4' i32type='long' i64size='8' i64type='long long' i8size='1' i8type='char' i_arpainet='define' i_bsdioctl='' i_db='define' i_dbm='' i_dirent='define' i_dld='' i_dlfcn='define' i_fcntl='' i_float='define' i_gdbm='define' i_grp='define' i_iconv='define' i_ieeefp='' i_inttypes='define' i_libutil='' i_limits='define' i_locale='define' i_machcthr='' i_malloc='define' i_math='define' i_memory='' i_mntent='define' i_ndbm='' i_netdb='define' i_neterrno='' i_netinettcp='define' i_niin='define' i_poll='define' i_prot='' i_pthread='define' i_pwd='define' i_rpcsvcdbm='' i_sfio='' i_sgtty='' i_shadow='define' i_socks='' i_stdarg='define' i_stddef='define' i_stdlib='define' i_string='define' i_sunmath='' i_sysaccess='' i_sysdir='define' i_sysfile='define' i_sysfilio='' i_sysin='' i_sysioctl='define' i_syslog='define' i_sysmman='define' i_sysmode='' i_sysmount='define' i_sysndir='' i_sysparam='define' i_sysresrc='define' i_syssecrt='' i_sysselct='define' i_syssockio='' i_sysstat='define' i_sysstatfs='define' i_sysstatvfs='define' i_systime='define' i_systimek='' i_systimes='define' i_systypes='define' i_sysuio='define' i_sysun='define' i_sysutsname='define' i_sysvfs='define' i_syswait='define' i_termio='' i_termios='define' i_time='' i_unistd='define' i_ustat='define' i_utime='define' i_values='define' i_varargs='' i_varhdr='stdarg.h' i_vfork='' ignore_versioned_solibs='y' inc_version_list=' ' inc_version_list_init='0' incpath='' inews='' installarchlib='/usr/local/lib/perl5/5.6.1/i686-linux' installbin='/usr/local/bin' installman1dir='/usr/local/man/man1' installman3dir='/usr/local/man/man3' installprefix='/usr/local' installprefixexp='/usr/local' installprivlib='/usr/local/lib/perl5/5.6.1' installscript='/usr/local/bin' installsitearch='/usr/local/lib/perl5/site_perl/5.6.1/i686-linux' installsitebin='/usr/local/bin' installsitelib='/usr/local/lib/perl5/site_perl/5.6.1' installstyle='lib/perl5' installusrbinperl='define' installvendorarch='' installvendorbin='' installvendorlib='' intsize='4' issymlink='test -h' ivdformat='"ld"' ivsize='4' ivtype='long' known_extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl File/Glob GDBM_File IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Sys/Hostname Sys/Syslog Thread attrs re' ksh='' ld='cc' lddlflags='-shared -L/usr/local/lib' ldflags=' -L/usr/local/lib' ldflags_uselargefiles='' ldlibpthname='LD_LIBRARY_PATH' less='less' lib_ext='.a' libc='/lib/libc-2.1.3.so' libperl='libperl.a' libpth='/usr/local/lib /lib /usr/lib' libs='-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt -lutil' libsdirs=' /usr/lib' libsfiles=' libnsl.so libndbm.so libgdbm.so libdb.so libdl.so libm.so libc.so libposix.a libcrypt.so libutil.so' libsfound=' /usr/lib/libnsl.so /usr/lib/libndbm.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libc.so /usr/lib/libposix.a /usr/lib/libcrypt.so /usr/lib/libutil.so' libspath=' /usr/local/lib /lib /usr/lib' libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt sec ucb BSD PW x iconv util' libswanted_uselargefiles='' line='' lint='' lkflags='' ln='ln' lns='/bin/ln -s' locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/include /usr/GNU/include /opt/GNU/include' loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' longdblsize='12' longlongsize='8' longsize='4' lp='' lpr='' ls='ls' lseeksize='8' lseektype='off_t' mail='' mailx='' make='make' make_set_make='#' mallocobj='' mallocsrc='' malloctype='void *' man1dir='/usr/local/man/man1' man1direxp='/usr/local/man/man1' man1ext='1' man3dir='/usr/local/man/man3' man3direxp='/usr/local/man/man3' man3ext='3' mips_type='' mkdir='mkdir' mmaptype='void *' modetype='mode_t' more='more' multiarch='' mv='' myarchname='i686-linux' mydomain='.hq.tensilica.com' myhostname='gauthier' myuname='linux gauthier.hq.tensilica.com 2.2.14-5.0 #1 tue mar 7 21​:07​:39 est 2000 i686 unknown ' n='-n' netdb_hlen_type='size_t' netdb_host_type='const char *' netdb_name_type='const char *' netdb_net_type='unsigned long' nm='nm' nm_opt='' nm_so_opt='--dynamic' nonxs_ext='Errno' nroff='nroff' nvEUformat='"E"' nvFUformat='"F"' nvGUformat='"G"' nveformat='"e"' nvfformat='"f"' nvgformat='"g"' nvsize='8' nvtype='double' o_nonblock='O_NONBLOCK' obj_ext='.o' old_pthread_create_joinable='' optimize='-O2' orderlib='false' osname='linux' osvers='2.2.14-5.0' otherlibdirs=' ' package='perl5' pager='/usr/bin/less' passcat='cat /etc/passwd' patchlevel='6' path_sep='​:' perl='' perl5='/usr/local/bin/perl' perladmin='marc@​tensilica.com' perllibs='-lnsl -ldl -lm -lc -lposix -lcrypt -lutil' perlpath='/usr/local/bin/perl' pg='pg' phostname='hostname' pidtype='pid_t' plibpth='' pm_apiversion='5.005' pmake='' pr='' prefix='/usr/local' prefixexp='/usr/local' privlib='/usr/local/lib/perl5/5.6.1' privlibexp='/usr/local/lib/perl5/5.6.1' prototype='define' ptrsize='4' quadkind='3' quadtype='long long' randbits='48' randfunc='drand48' randseedtype='long' ranlib='​:' rd_nodata='-1' revision='5' rm='rm' rmail='' runnm='false' sPRIEUldbl='"llE"' sPRIFUldbl='"llF"' sPRIGUldbl='"llG"' sPRIXU64='"llX"' sPRId64='"lld"' sPRIeldbl='"lle"' sPRIfldbl='"llf"' sPRIgldbl='"llg"' sPRIi64='"lli"' sPRIo64='"llo"' sPRIu64='"llu"' sPRIx64='"llx"' sSCNfldbl='"llf"' sched_yield='sched_yield()' scriptdir='/usr/local/bin' scriptdirexp='/usr/local/bin' sed='sed' seedfunc='srand48' selectminbits='32' selecttype='fd_set *' sendmail='' sh='/bin/sh' shar='' sharpbang='#!' shmattype='void *' shortsize='2' shrpenv='' shsharp='true' sig_count='64' sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED ' sig_name_init='"ZERO"\, "HUP"\, "INT"\, "QUIT"\, "ILL"\, "TRAP"\, "ABRT"\, "BUS"\, "FPE"\, "KILL"\, "USR1"\, "SEGV"\, "USR2"\, "PIPE"\, "ALRM"\, "TERM"\, "STKFLT"\, "CHLD"\, "CONT"\, "STOP"\, "TSTP"\, "TTIN"\, "TTOU"\, "URG"\, "XCPU"\, "XFSZ"\, "VTALRM"\, "PROF"\, "WINCH"\, "IO"\, "PWR"\, "SYS"\, "RTMIN"\, "NUM33"\, "NUM34"\, "NUM35"\, "NUM36"\, "NUM37"\, "NUM38"\, "NUM39"\, "NUM40"\, "NUM41"\, "NUM42"\, "NUM43"\, "NUM44"\, "NUM45"\, "NUM46"\, "NUM47"\, "NUM48"\, "NUM49"\, "NUM50"\, "NUM51"\, "NUM52"\, "NUM53"\, "NUM54"\, "NUM55"\, "NUM56"\, "NUM57"\, "NUM58"\, "NUM59"\, "NUM60"\, "NUM61"\, "NUM62"\, "RTMAX"\, "IOT"\, "CLD"\, "POLL"\, "UNUSED"\, 0' sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 ' sig_num_init='0\, 1\, 2\, 3\, 4\, 5\, 6\, 7\, 8\, 9\, 10\, 11\, 12\, 13\, 14\, 15\, 16\, 17\, 18\, 19\, 20\, 21\, 22\, 23\, 24\, 25\, 26\, 27\, 28\, 29\, 30\, 31\, 32\, 33\, 34\, 35\, 36\, 37\, 38\, 39\, 40\, 41\, 42\, 43\, 44\, 45\, 46\, 47\, 48\, 49\, 50\, 51\, 52\, 53\, 54\, 55\, 56\, 57\, 58\, 59\, 60\, 61\, 62\, 63\, 6\, 17\, 29\, 31\, 0' signal_t='void' sitearch='/usr/local/lib/perl5/site_perl/5.6.1/i686-linux' sitearchexp='/usr/local/lib/perl5/site_perl/5.6.1/i686-linux' sitebin='/usr/local/bin' sitebinexp='/usr/local/bin' sitelib='/usr/local/lib/perl5/site_perl/5.6.1' sitelib_stem='/usr/local/lib/perl5/site_perl' sitelibexp='/usr/local/lib/perl5/site_perl/5.6.1' siteprefix='/usr/local' siteprefixexp='/usr/local' sizesize='4' sizetype='size_t' sleep='' smail='' so='so' sockethdr='' socketlib='' socksizetype='socklen_t' sort='sort' spackage='Perl5' spitshell='cat' src='.' ssizetype='ssize_t' startperl='#!/usr/local/bin/perl' startsh='#!/bin/sh' static_ext=' ' stdchar='char' stdio_base='((fp)->_IO_read_base)' stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)' stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)' stdio_filbuf='' stdio_ptr='((fp)->_IO_read_ptr)' stdio_stream_array='' strings='/usr/include/string.h' submit='' subversion='1' sysman='/usr/man/man1' tail='' tar='' tbl='' tee='' test='test' timeincl='/usr/include/sys/time.h ' timetype='time_t' touch='touch' tr='tr' trnl='\n' troff='' u16size='2' u16type='unsigned short' u32size='4' u32type='unsigned long' u64size='8' u64type='unsigned long long' u8size='1' u8type='unsigned char' uidformat='"lu"' uidsign='1' uidsize='4' uidtype='uid_t' uname='uname' uniq='uniq' uquadtype='unsigned long long' use5005threads='' use64bitall='' use64bitint='' usedl='define' useithreads='' uselargefiles='define' uselongdouble='' usemorebits='' usemultiplicity='' usemymalloc='n' usenm='false' useopcode='true' useperlio='' useposix='true' usesfio='false' useshrplib='false' usesocks='' usethreads='' usevendorprefix='' usevfork='false' usrinc='/usr/include' uuname='' uvXUformat='"lX"' uvoformat='"lo"' uvsize='4' uvtype='unsigned long' uvuformat='"lu"' uvxformat='"lx"' vendorarch='' vendorarchexp='' vendorbin='' vendorbinexp='' vendorlib='' vendorlib_stem='' vendorlibexp='' vendorprefix='' vendorprefixexp='' version='5.6.1' versiononly='' vi='' voidflags='15' xlibpth='/usr/lib/386 /lib/386' xs_apiversion='5.005' yacc='/usr/bin/byacc' yaccflags='' zcat='' zip='zip'

p5pRT commented 23 years ago

From @gsar

Excellent bug report. Please try this patch.

Patch to the testsuite welcome.

Sarathy gsar@​ActiveState.com

Inline Patch ```diff -----------------------------------8<----------------------------------- Change 10100 by gsar@moonru on 2001/05/14 14:43:50 PL_last_in_gv may not be a GV if it was a stale filehandle (fix for bug ID 20010514.027) TODO: this needs a testsuite addition Affected files ... ... //depot/maint-5.6/perl/mg.c#22 edit ... //depot/maint-5.6/perl/pp_ctl.c#35 edit Differences ... ==== //depot/maint-5.6/perl/mg.c#22 (text) ==== Index: perl/mg.c --- perl/mg.c.~1~ Mon May 14 08:44:55 2001 +++ perl/mg.c Mon May 14 08:44:55 2001 @@ -661,7 +661,7 @@ case '.': #ifndef lint if (GvIO(PL_last_in_gv)) { - sv_setiv(sv, (IV)IoLINES(GvIO(PL_last_in_gv))); + sv_setiv(sv, (IV)IoLINES(GvIOp(PL_last_in_gv))); } #endif break; ==== //depot/maint-5.6/perl/pp_ctl.c#35 (text) ==== Index: perl/pp_ctl.c --- perl/pp_ctl.c.~1~ Mon May 14 08:44:55 2001 +++ perl/pp_ctl.c Mon May 14 08:44:55 2001 @@ -1029,7 +1029,7 @@ if (PL_op->op_private & OPpFLIP_LINENUM) { struct io *gp_io; flip = PL_last_in_gv - && (gp_io = GvIOp(PL_last_in_gv)) + && (gp_io = GvIO(PL_last_in_gv)) && SvIV(sv) == (IV)IoLINES(gp_io); } else { flip = SvTRUE(sv); @@ -1110,7 +1110,8 @@ SV *targ = PAD_SV(cUNOP->op_first->op_targ); sv_inc(targ); if ((PL_op->op_private & OPpFLIP_LINENUM) - ? (PL_last_in_gv && SvIV(sv) == (IV)IoLINES(GvIOp(PL_last_in_gv))) + ? (GvIO(PL_last_in_gv) + && SvIV(sv) == (IV)IoLINES(GvIOp(PL_last_in_gv))) : SvTRUE(sv) ) { sv_setiv(PAD_SV(((UNOP*)cUNOP->op_first)->op_first->op_targ), 0); sv_catpv(targ, "E0"); End of Patch. ```