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

Text field truncation causes segmentation violation #14412

Closed
p5pRT opened this issue Jan 12, 2015 · 5 comments
Closed

Text field truncation causes segmentation violation #14412

p5pRT opened this issue Jan 12, 2015 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 12, 2015

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

Searchable as RT123591$

@p5pRT
Copy link
Author

p5pRT commented Jan 12, 2015

From gary@mlbassoc.com

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

@p5pRT
Copy link
Author

p5pRT commented Jan 12, 2015

From @tonycoz

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.

Tony

@p5pRT
Copy link
Author

p5pRT commented Jan 12, 2015

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

@p5pRT
Copy link
Author

p5pRT commented Jan 19, 2015

From @tonycoz

On Mon Jan 12 15​:28​:12 2015, tonyc wrote​:

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 (62db6ea) has been applied to blead, and this no longer crashes, so closing.

Tony

@p5pRT p5pRT closed this as completed Jan 19, 2015
@p5pRT
Copy link
Author

p5pRT commented Jan 19, 2015

@tonycoz - Status changed from 'open' to 'resolved'

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

No branches or pull requests

1 participant