develooper Front page | perl.perl5.porters | Postings from April 2003

[perl #21914] 3-arg open + local $fh + strict coredump

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
April 9, 2003 11:44
Subject:
[perl #21914] 3-arg open + local $fh + strict coredump
Message ID:
rt-21914-54729.14.3354503808492@bugs6.perl.org
# New Ticket Created by  Jarkko Hietaniemi 
# Please include the string:  [perl #21914]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=21914 >


This is a bug report for perl from jhi@lyta.hut.fi,
generated with the help of perlbug 1.34 running under perl v5.8.0.


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

At some point after 5.8.0 the following code

use strict;
open(local $f, '<', '/might/exist/might/not');
my @rows = <$f>;

changed behaviour from

Global symbol "$f" requires explicit package name at o.t line 2.
Global symbol "$f" requires explicit package name at o.t line 3.
Execution of o.t aborted due to compilation errors.

to

zsh: 386540 segmentation fault (core dumped)  ./perl -Ilib o.t

dbx version 5.1
Type 'help' for help.
Core file created by program "perl"

signal Segmentation fault at   [Perl_newASSIGNOP:3089 +0x14,0x3ffbff03204]     if (gv == PL_defgv || (int)SvCUR(gv) == PL_generation)
(dbx) where
>  0 Perl_newASSIGNOP(flags = 64, left = 0x140017050, optype = 0, right = 0x140026380) ["op.c":3089, 0x3ffbff03204]
   1 Perl_yyparse() ["perly.c":523, 0x3ffbfef7ac0]
   2 S_parse_body(env = (nil), xsinit = 0x120001f88) ["perl.c":1425, 0x3ffbfec2c44]
   3 perl_parse(my_perl = 0x1400041a0, xsinit = 0x120001f88, argc = 3, argv = 0x11fffc018, env = (nil)) ["perl.c":935, 0x3ffbfec1888]
   4 main(argc = 3, argv = 0x11fffc018, env = 0x11fffc038) ["perlmain.c":83, 0x120001f00]
(dbx) 

I found this while playing with op.c and open.t (changes #19172
and #19173).  At first I thought I had broken open.t with those
patches, but retracting those patches didn't remove the segfault...

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=high
---
Site configuration information for perl v5.8.0:

Configured by jhi at Wed Aug  7 21:21:34 EET DST 2002.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=dec_osf, osvers=4.0d, archname=alpha-dec_osf-thread-multi
    uname='osf1 lyta.hut.fi v4.0 878 alpha '
    config_args='-des -Duseithreads -Doptimize=-g -Dprefix=/u/vieraat/vieraat/jhi/Perl/platform/OSF1'
    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=define use64bitall=define uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-pthread -std -fprm d -ieee -DDEBUGGING -DLANGUAGE_C',
    optimize='-g',
    cppflags='-pthread -std -ieee -DDEBUGGING -DLANGUAGE_C'
    ccversion='V5.6-082', gccversion='', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =''
    libpth=/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /var/shlib
    libs=-ldbm -ldb -lm -lutil -lpthread -lexc
    perllibs=-lm -lutil -lpthread -lexc
    libc=/usr/shlib/libc.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -Wl,-rpath,/u/vieraat/vieraat/jhi/Perl/platform/OSF1/lib/perl5/5.8.0/alpha-dec_osf-thread-multi/CORE'
    cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -msym -std'

Locally applied patches:
    

---
@INC for perl v5.8.0:
    /u/vieraat/vieraat/jhi/Perl/platform/OSF1/lib/perl5/5.8.0/alpha-dec_osf-thread-multi
    /u/vieraat/vieraat/jhi/Perl/platform/OSF1/lib/perl5/5.8.0
    /u/vieraat/vieraat/jhi/Perl/platform/OSF1/lib/perl5/site_perl/5.8.0/alpha-dec_osf-thread-multi
    /u/vieraat/vieraat/jhi/Perl/platform/OSF1/lib/perl5/site_perl/5.8.0
    /u/vieraat/vieraat/jhi/Perl/platform/OSF1/lib/perl5/site_perl
    .

---
Environment for perl v5.8.0:
    HOME=/u/vieraat/vieraat/jhi
    LANG=C
    LANGUAGE (unset)
    LC_ALL=fi_FI.ISO8859-1
    LC_CTYPE=fi_FI.ISO8859-1
    LD_LIBRARY_PATH=/u/vieraat/vieraat/jhi/Perl/smoke/lyta/perl-current
    LOGDIR (unset)
    PATH=/u/vieraat/vieraat/jhi/Perl/bin:/u/vieraat/vieraat/jhi/.s:/u/vieraat/vieraat/jhi/.b/OSF1:/c/bin:/p/bin:/p/adm/bin:/usr/bin:/usr/sbin:/sbin:/bin:/usr/ccs/bin:/usr/lib:/etc:/lib:/p/X6/bin:/p/X5/bin:/usr/bin/X11:/usr/lbin:/usr/sbin/acct:/usr/tcb/bin:/tcb/bin:/usr/field:/u/vieraat/vieraat/jhi
    PERL_BADLANG (unset)
    SHELL=/bin/zsh


Thread Previous | 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