Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault with redefined formats and warnings enabled #9704

Closed
p5pRT opened this issue Apr 8, 2009 · 4 comments
Closed

Segmentation fault with redefined formats and warnings enabled #9704

p5pRT opened this issue Apr 8, 2009 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 8, 2009

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

Searchable as RT64562$

@p5pRT
Copy link
Author

p5pRT commented Apr 8, 2009

From @stsc

Created by @stsc

When redefining the implicit STDOUT format, perl crashes with a
segmentation fault, if warnings are enabled. It is reproducible
under 5.8.9, 5.10.0 and bleadperl.

#!/usr/bin/perl

use strict;
use warnings; # crashes!

format =
@​<
42
.

write;

format =
@​<
42
.

write;

__EOF__

GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+​: GNU GPL version 3 or later <http​://gnu.org/licenses/gpl.html>
This is free software​: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) run
Starting program​: /home/sts/compiled/perl-current/bin/perl5.11.0 /home/sts/perl-format_segv.pl

Program received signal SIGSEGV, Segmentation fault.
0x08077c3e in Perl_newFORM (floor=25, o=0x0, block=0x9b686b0) at op.c​:6169
6169 Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
(gdb) bt
#0 0x08077c3e in Perl_newFORM (floor=25, o=0x0, block=0x9b686b0) at op.c​:6169
#1 0x080e79cc in Perl_yyparse () at perly.y​:518
#2 0x08089991 in S_parse_body (env=0x0, xsinit=0x80623f2 <xs_init>) at perl.c​:2160
#3 0x08088173 in perl_parse (my_perl=0x9b61008, xsinit=0x80623f2 <xs_init>, argc=2, argv=0xbff83824, env=0x0) at perl.c​:1596
#4 0x080623af in main (argc=2, argv=0xbff83824, env=0xbff83830) at perlmain.c​:115
(gdb) quit
The program is running. Exit anyway? (y or n)

Perl Info

Flags:
    category=core
    severity=high

Site configuration information for perl 5.11.0:

Configured by sts at Wed Apr  8 20:16:26 CEST 2009.

Summary of my perl5 (revision 5 version 11 subversion 0) configuration:
  Commit id: 932dfdf14c16835fc3ab6ba0cb0dab9254dfd017
  Platform:
    osname=linux, osvers=2.6.26-1-openvz-686, archname=i686-linux
    uname='linux dev 2.6.26-1-openvz-686 #1 smp fri mar 13 20:20:40 utc 2009 i686 gnulinux '
    config_args='-des -Dusedevel -Doptimize=-g3 -Dprefix=/home/sts/compiled/perl-current'
    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 ='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-g3',
    cppflags='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.3.2', 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 /usr/lib
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.7.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.7'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -g3 -L/usr/local/lib -fstack-protector'

Locally applied patches:
    PERL_GIT_UNPUSHED_COMMITS    	/* do not remove this line */
    PERL_GIT_UNCOMMITTED_CHANGES	/* do not remove this line */


@INC for perl 5.11.0:
    /home/sts/compiled/perl-current/lib/site_perl/5.11.0/i686-linux
    /home/sts/compiled/perl-current/lib/site_perl/5.11.0
    /home/sts/compiled/perl-current/lib/5.11.0/i686-linux
    /home/sts/compiled/perl-current/lib/5.11.0
    .


Environment for perl 5.11.0:
    HOME=/home/sts
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
    PERL_BADLANG (unset)
    SHELL=/bin/bash


@p5pRT
Copy link
Author

p5pRT commented Apr 9, 2009

From @nwc10

On Wed, Apr 08, 2009 at 01​:41​:34PM -0700, stsc@​refcnt.org (via RT) wrote​:

This is a bug report for perl from stsc@​refcnt.org,

When redefining the implicit STDOUT format, perl crashes with a
segmentation fault, if warnings are enabled. It is reproducible
under 5.8.9, 5.10.0 and bleadperl.

#!/usr/bin/perl

use strict;
use warnings; # crashes!

format =
@​<
42
.

write;

format =
@​<
42
.

write;

Thanks for the bug report. I infer that the bug was introduced by me as part
of change 23766 back in January 2005​:

http​://perl5.git.perl.org/perl.git/blobdiff/92ca9816760477489e51e09e0dcde1dda70f387d..7a5fd60​:/op.c

Fixed with change ee6d278

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Apr 9, 2009

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Oct 20, 2009

alex@chmrr.net - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant