Skip Menu |
Report information
Id: 123591
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: gary [at] mlbassoc.com
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)



Date: Mon, 12 Jan 2015 05:20:58 -0700 (MST)
CC: linux [...] mlbassoc.com
From: gary [...] mlbassoc.com
To: perlbug [...] perl.org
Subject: Text field truncation causes segmentation violation
Download (untitled) / with headers
text/plain 4.3k
This is a bug report for perl from gary@mlbassoc.com, generated with the help of perlbug 1.40 running under perl 5.20.1. ----------------------------------------------------------------- The text field truncation format causes a segmentation violation in recent (5.20.0 or newer) versions. This used to work, tested in 5.14.3 and 5.18.2. This small test program shows the problem: =============================<cut-here<====================================== #! /usr/bin/env perl # Simple test which shows that the '...' text field truncation # is failing with perl 5.20.0 sub swrite { my ( $format, @args ) = @_; local $^A = ""; formline( $format, @args ); return $^A; } sub print_header { my $fh = \*STDOUT; my $hostname = "HostName"; my $header_format2 = <<EOF; @<<<<<<<: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EOF my $header_format = <<EOF; @<<<<<<<: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... EOF print $fh swrite($header_format2, "Hostname", $hostname); print $fh swrite($header_format, "Hostname", $hostname); return; } print_header(); =============================<cut-here<====================================== Note: this problem is not host or target machine specific. It has been tested on 5.20.0 and 5.20.1 on i386 (32 bit), x86_64 (64 bit) as well as ARM (Cortex A9) and PowerPC (e5000v2) architectures, all failing the same way. The failing code was derived from Amanda and has been in place and working on previous versions of perl for years. ----------------------------------------------------------------- --- Flags: category=core severity=medium --- Site configuration information for perl 5.20.1: Configured by gthomas at Sun Jan 11 07:43:03 MST 2015. Summary of my perl5 (revision 5 version 20 subversion 1) configuration: Platform: osname=linux, osvers=3.13.0-43-generic, archname=x86_64-linux uname='linux zeus 3.13.0-43-generic #72-ubuntu smp mon dec 8 19:35:06 utc 2014 x86_64 x86_64 x86_64 gnulinux ' config_args='-des -Dprefix=/home/gthomas/localperl -DEBUGGING=both' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -g', cppflags='-fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.9.2', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.19' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector' --- @INC for perl 5.20.1: /home/gthomas/localperl/lib/site_perl/5.20.1/x86_64-linux /home/gthomas/localperl/lib/site_perl/5.20.1 /home/gthomas/localperl/lib/5.20.1/x86_64-linux /home/gthomas/localperl/lib/5.20.1 /home/gthomas/localperl/lib/site_perl/5.20.0/x86_64-linux /home/gthomas/localperl/lib/site_perl/5.20.0 /home/gthomas/localperl/lib/site_perl . --- Environment for perl 5.20.1: HOME=/home/gthomas LANG=en_US.UTF-8 LANGUAGE=en_US LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/gthomas/bin:/home/gthomas/misc/apache-ant-1.8.4/bin:/home/gthomas/MacPC/Desktop/MacOS/Tools/cocos2d-x-3.2/tools/cocos2d-console/bin:/opt/amltd/bin:/opt/project-neon/bin:/home/gthomas/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PERL_BADLANG (unset) SHELL=/bin/bash
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.4k
On Mon Jan 12 04:21:00 2015, gary@mlbassoc.com wrote: Show quoted text
> The text field truncation format causes a segmentation violation > in recent (5.20.0 or newer) versions. This used to work, tested > in 5.14.3 and 5.18.2. > > This small test program shows the problem: > =============================<cut- > here<====================================== > #! /usr/bin/env perl > # Simple test which shows that the '...' text field truncation > # is failing with perl 5.20.0 > > sub swrite > { > my ( $format, @args ) = @_; > local $^A = ""; > formline( $format, @args ); > return $^A; > } > > sub print_header > { > my $fh = \*STDOUT; > my $hostname = "HostName"; > my $header_format2 = <<EOF; > @<<<<<<<: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > EOF > my $header_format = <<EOF; > @<<<<<<<: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... > EOF > > print $fh swrite($header_format2, "Hostname", $hostname); > print $fh swrite($header_format, "Hostname", $hostname); > return; > } > > print_header(); > =============================<cut- > here<====================================== > > Note: this problem is not host or target machine specific. It has > been tested on 5.20.0 and 5.20.1 on i386 (32 bit), x86_64 (64 bit) > as well as ARM (Cortex A9) and PowerPC (e5000v2) architectures, all > failing the same way. > > The failing code was derived from Amanda and has been in place and > working on previous versions of perl for years.
My patch in 123538 appears to fix this. Tony
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.7k
On Mon Jan 12 15:28:12 2015, tonyc wrote: Show quoted text
> On Mon Jan 12 04:21:00 2015, gary@mlbassoc.com wrote:
> > The text field truncation format causes a segmentation violation > > in recent (5.20.0 or newer) versions. This used to work, tested > > in 5.14.3 and 5.18.2. > > > > This small test program shows the problem: > > =============================<cut- > > here<====================================== > > #! /usr/bin/env perl > > # Simple test which shows that the '...' text field truncation > > # is failing with perl 5.20.0 > > > > sub swrite > > { > > my ( $format, @args ) = @_; > > local $^A = ""; > > formline( $format, @args ); > > return $^A; > > } > > > > sub print_header > > { > > my $fh = \*STDOUT; > > my $hostname = "HostName"; > > my $header_format2 = <<EOF; > > @<<<<<<<: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > > EOF > > my $header_format = <<EOF; > > @<<<<<<<: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<... > > EOF > > > > print $fh swrite($header_format2, "Hostname", $hostname); > > print $fh swrite($header_format, "Hostname", $hostname); > > return; > > } > > > > print_header(); > > =============================<cut- > > here<====================================== > > > > Note: this problem is not host or target machine specific. It has > > been tested on 5.20.0 and 5.20.1 on i386 (32 bit), x86_64 (64 bit) > > as well as ARM (Cortex A9) and PowerPC (e5000v2) architectures, all > > failing the same way. > > > > The failing code was derived from Amanda and has been in place and > > working on previous versions of perl for years.
> > My patch in 123538 appears to fix this.
That patch (62db6ea5fed19611596cbc5fc0b8a4df2c604e58) has been applied to blead, and this no longer crashes, so closing. Tony


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org