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

5.12.0 crash on diverse platforms #10335

Closed
p5pRT opened this issue Apr 21, 2010 · 10 comments
Closed

5.12.0 crash on diverse platforms #10335

p5pRT opened this issue Apr 21, 2010 · 10 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 21, 2010

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

Searchable as RT74542$

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

From occitan@esperanto.org

One of the utilities of makepp SEGVs in the regression test on each of Linux
x86 and Win (both ActiveState) and Solaris 10 Sparc self compiled as 32bit.
This last worked with CPAN testers on i86pc-solaris-V5.11.5.

I have narrowed it down to the following little test​:

#!/usr/bin/perl -w

sub f {
  lstat '/';
  -d _;
}

$_ = split /x/, f;

The context split (with any regexp) is needed, though it crashes in -d _.

#0 0x0810f3fb in Perl_pp_ftrowned ()
#1 0x080cb352 in Perl_runops_standard ()
#2 0x08074af2 in S_run_body ()
#3 0x0807498a in perl_run ()
#4 0x08060ded in main ()

Besides a fix for future versions, I am desperate for a workaround ;-)

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

--
lerne / learn / apprends / lär dig / ucz się Esperanto​:
  http​://lernu.net / http​://ikurso.net

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

From @rgarcia

On 21 April 2010 02​:03, Daniel Pfeiffer <perlbug-followup@​perl.org> wrote​:

One of the utilities of makepp SEGVs in the regression test on each of Linux
x86 and Win (both ActiveState) and Solaris 10 Sparc self compiled as 32bit.
This last worked with CPAN testers on i86pc-solaris-V5.11.5.

I have narrowed it down to the following little test​:

#!/usr/bin/perl -w

sub f {
  lstat '/';
  -d _;
}

$_ = split /x/, f;

The context split (with any regexp) is needed, though it crashes in -d _.

#0  0x0810f3fb in Perl_pp_ftrowned ()
#1  0x080cb352 in Perl_runops_standard ()
#2  0x08074af2 in S_run_body ()
#3  0x0807498a in perl_run ()
#4  0x08060ded in main ()

Besides a fix for future versions, I am desperate for a workaround ;-)

Apparently, a workaround is to use a perl compiled with -DDEBUGGING support...

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

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

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

From @nwc10

On Wed, Apr 21, 2010 at 03​:08​:58PM +0200, Rafael Garcia-Suarez wrote​:

On 21 April 2010 02​:03, Daniel Pfeiffer <perlbug-followup@​perl.org> wrote​:

One of the utilities of makepp SEGVs in the regression test on each of Linux
x86 and Win (both ActiveState) and Solaris 10 Sparc self compiled as 32bit.
This last worked with CPAN testers on i86pc-solaris-V5.11.5.

I have narrowed it down to the following little test​:

#!/usr/bin/perl -w

sub f {
  lstat '/';
  -d _;
}

$_ = split /x/, f;

The context split (with any regexp) is needed, though it crashes in -d _.

#0  0x0810f3fb in Perl_pp_ftrowned ()
#1  0x080cb352 in Perl_runops_standard ()
#2  0x08074af2 in S_run_body ()
#3  0x0807498a in perl_run ()
#4  0x08060ded in main ()

Besides a fix for future versions, I am desperate for a workaround ;-)

Apparently, a workaround is to use a perl compiled with -DDEBUGGING support...

I'm not sure. I've now build a perl without that on Linux, and I see no
problem either. I can't replicate this.

$ ./perl -Ilib -V
Summary of my perl5 (revision 5 version 13 subversion 0) configuration​:
  Derived from​: f768f60
  Platform​:
  osname=linux, osvers=2.6.18.8-xenu, archname=x86_64-linux
  uname='linux eris 2.6.18.8-xenu #1 smp sat oct 3 10​:27​:42 bst 2009 x86_64 gnulinux '
  config_args='-Dusedevel=y -Dcc=ccache gcc -Dld=gcc -Ubincompat5005 -Uinstallusrbinperl -Dcf_email=nick@​ccl4.org -Dperladmin=nick@​ccl4.org -Dinc_version_list= -Dinc_version_list_init=0 -Doptimize=-Os -Uusethreads -Uuse64bitall -Uusemymalloc -Duseperlio -Dprefix=/Sandpit/snap5.9.x-v5.13.0-14-gf768f60 -Uusevendorprefix -Uvendorprefix=/Sandpit/snap5.9.x-v5.13.0-14-gf768f60 -Dinstallman1dir=none -Dinstallman3dir=none -Uuserelocatableinc -de'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=define, use64bitall=undef, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='ccache gcc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-Os',
  cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.3.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='gcc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64
  libs=-lnsl -ldb -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 -Os -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl)​:
  Compile-time options​: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP PERL_USE_DEVEL
  USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO
  USE_PERL_ATOF
  Locally applied patches​:
  uncommitted-changes
  Built under linux
  Compiled at Apr 21 2010 14​:21​:19
  @​INC​:
  lib
  /home/nick/Sandpit/snap5.9.x-v5.13.0-14-gf768f60/lib/perl5/site_perl/5.13.0/x86_64-linux
  /home/nick/Sandpit/snap5.9.x-v5.13.0-14-gf768f60/lib/perl5/site_perl/5.13.0
  /home/nick/Sandpit/snap5.9.x-v5.13.0-14-gf768f60/lib/perl5/5.13.0/x86_64-linux
  /home/nick/Sandpit/snap5.9.x-v5.13.0-14-gf768f60/lib/perl5/5.13.0
  .

So I'm not sure how to replicate this, or, for that matter, what changes
ActiveState make from the 5.12.0 release to build their perl

A​: could you send the output of perl -V for your perl on Linux
B​: are you able to build the 5.12.0 release from source (on Linux is most
  useful) and replicate your problem with that? Stack traces sadly aren't
  that useful unless they have debugging symbols.
  (Source is at http​://www.cpan.org/src/perl-5.12.0.tar.bz2 for example)

Nicholas Clark
 

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

From @jdhedden

On Wed, Apr 21, 2010 at 09​:34, Nicholas Clark <nick@​ccl4.org> wrote​:

On Wed, Apr 21, 2010 at 03​:08​:58PM +0200, Rafael Garcia-Suarez wrote​:

On 21 April 2010 02​:03, Daniel Pfeiffer <perlbug-followup@​perl.org> wrote​:

One of the utilities of makepp SEGVs in the regression test on each of Linux
x86 and Win (both ActiveState) and Solaris 10 Sparc self compiled as 32bit.
This last worked with CPAN testers on i86pc-solaris-V5.11.5.

I have narrowed it down to the following little test​:

#!/usr/bin/perl -w

sub f {
  lstat '/';
  -d _;
}

$_ = split /x/, f;

The context split (with any regexp) is needed, though it crashes in -d _.

#0  0x0810f3fb in Perl_pp_ftrowned ()
#1  0x080cb352 in Perl_runops_standard ()
#2  0x08074af2 in S_run_body ()
#3  0x0807498a in perl_run ()
#4  0x08060ded in main ()

Besides a fix for future versions, I am desperate for a workaround ;-)

Apparently, a workaround is to use a perl compiled with -DDEBUGGING support...

I'm not sure. I've now build a perl without that on Linux, and I see no
problem either. I can't replicate this.

I tried this with blead under Cygwin on Windows, and it segfaults.

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

From @rgs

This is now fixed by the patch below, which I would like to nominate for inclusion in 5.12.1.

commit 94fa954
Author​: Rafael Garcia-Suarez <rgs@​consttype.org>
Date​: Wed Apr 21 15​:47​:36 2010 +0200

  Fix [perl #74542] 5.12.0 crash on diverse platforms
 
  Filetest ops don't always expect an op on the stack, so we should use
  TOPs only if we're sure that we're not stat'ing the _ filehandle.
  This is indicated by OPf_KIDS (as checked in ck_ftst).

Inline Patch
diff --git a/pp.h b/pp.h
index 9d078af..c36502a 100644
--- a/pp.h
+++ b/pp.h
@@ -474,7 +474,8 @@ Does not use C<TARG>.  See also C<XPUSHu>, C<mPUSHu> and 
C. \#define tryAMAGICftest\(chr\) \\   STMT\_START \{ \\   assert\(chr \!= '?'\); \\ \- if \(SvAMAGIC\(TOPs\)\) \{ \\ \+ if \(\(PL\_op\->op\_flags & OPf\_KIDS\) \\ \+ && SvAMAGIC\(TOPs\)\) \{ \\   const char tmpchr = \(chr\); \\   SV \* const tmpsv = amagic\_call\(TOPs\, \\   newSVpvn\_flags\(&tmpchr\, 1\, SVs\_TEMP\)\, \\

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

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

@p5pRT p5pRT closed this as completed Apr 21, 2010
@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

From perl@profvince.com

On 21 April 2010 02​:03, Daniel Pfeiffer<perlbug-followup@​perl.org> wrote​:

One of the utilities of makepp SEGVs in the regression test on each of Linux
x86 and Win (both ActiveState) and Solaris 10 Sparc self compiled as 32bit.
This last worked with CPAN testers on i86pc-solaris-V5.11.5.

I have narrowed it down to the following little test​:

#!/usr/bin/perl -w

sub f {
lstat '/';
-d _;
}

$_ = split /x/, f;

The context split (with any regexp) is needed, though it crashes in -d _.

#0 0x0810f3fb in Perl_pp_ftrowned ()
#1 0x080cb352 in Perl_runops_standard ()
#2 0x08074af2 in S_run_body ()
#3 0x0807498a in perl_run ()
#4 0x08060ded in main ()

Besides a fix for future versions, I am desperate for a workaround ;-)

Apparently, a workaround is to use a perl compiled with -DDEBUGGING support...

Replacing the bare '_' with '*_' will also prevent the segfault.

Vincent.

@p5pRT
Copy link
Author

p5pRT commented Apr 21, 2010

From perl@profvince.com

This is now fixed by the patch below, which I would like to nominate for inclusion in 5.12.1.

I approve of this patch.

V.

@p5pRT
Copy link
Author

p5pRT commented Apr 22, 2010

From @obra

On Wed, Apr 21, 2010 at 04​:37​:53PM +0200, Vincent Pit wrote​:

This is now fixed by the patch below, which I would like to nominate for inclusion in 5.12.1.
I approve of this patch.

+1

V.

--

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