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

Bleadperl v5.19.0-246-g13b0f67 breaks ROCKY/Devel-Trepan-0.50.tar.gz #13058

Closed
p5pRT opened this issue Jun 25, 2013 · 13 comments
Closed

Bleadperl v5.19.0-246-g13b0f67 breaks ROCKY/Devel-Trepan-0.50.tar.gz #13058

p5pRT opened this issue Jun 25, 2013 · 13 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 25, 2013

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

Searchable as RT118627$

@p5pRT
Copy link
Author

p5pRT commented Jun 25, 2013

From @andk

git bisect


13b0f67 is the first bad commit
commit 13b0f67
Author​: David Mitchell <davem@​iabyn.com>
Date​: Wed May 22 16​:38​:29 2013 +0100

  re-enable Copy-on-Write by default.

sample fail report


http​://www.cpantesters.org/cpan/report/f1a6bdd2-dbbc-11e2-9c4f-ca11697f9654

I have already communicated with rocky that this is the difference
between expected and got​:

% diff -au t/data/opt-e.{right,got}

Inline Patch
--- t/data/opt-e.right  2013-06-23 06:23:12.000000000 +0200
+++ t/data/opt-e.got    2013-06-24 07:39:14.142577837 +0200
@@ -1,6 +1,6 @@
 -- (tempfile.pl:1)
-no warnings "once";$x=1; $y=2
+se Devel::Trepan;no warnings "once";$x=1; $y=2
 -- (tempfile.pl:1)
-no warnings "once";$x=1; $y=2
+se Devel::Trepan;no warnings "once";$x=1; $y=2
 Debugged program terminated.  Use 'q' to quit or 'R' to restart.
 trepan.pl: That's all, folks...

There are binary nulls involved too.

perl -V


% /home/src/perl/repoperls/installed-perls/perl/v5.19.0-246-g13b0f67/a2da/bin/perl -V
Summary of my perl5 (revision 5 version 19 subversion 1) configuration​:
  Commit id​: 13b0f67
  Platform​:
  osname=linux, osvers=3.9-1-amd64, archname=x86_64-linux-thread-multi-ld
  uname='linux k83 3.9-1-amd64 #1 smp debian 3.9.6-1 x86_64 gnulinux '
  config_args='-Dprefix=/home/src/perl/repoperls/installed-perls/perl/v5.19.0-246-g13b0f67/a2da -Dmyhostname=k83 -Dinstallusrbinperl=n -Uversiononly -Dusedevel -des -Ui_db -Duseithreads -Duselongdouble -DDEBUGGING=-g'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=define, usemultiplicity=define
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=define, use64bitall=define, uselongdouble=define
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2 -g',
  cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.8.1', 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='long double', nvsize=16, Off_t='off_t', lseeksize=8
  alignbytes=16, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
  libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
  libc=, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.17'
  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'

Characteristics of this binary (from libperl)​:
  Compile-time options​: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
  PERL_DONT_CREATE_GVSV
  PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
  PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
  PERL_NEW_COPY_ON_WRITE PERL_NEW_COPY_ON_WRITE
  PERL_PRESERVE_IVUV PERL_USE_DEVEL USE_64_BIT_ALL
  USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
  USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC USE_LONG_DOUBLE USE_PERLIO
  USE_PERL_ATOF USE_REENTRANT_API
  Built under linux
  Compiled at Jun 25 2013 00​:57​:43
  @​INC​:
  /home/src/perl/repoperls/installed-perls/perl/v5.19.0-246-g13b0f67/a2da/lib/site_perl/5.19.1/x86_64-linux-thread-multi-ld
  /home/src/perl/repoperls/installed-perls/perl/v5.19.0-246-g13b0f67/a2da/lib/site_perl/5.19.1
  /home/src/perl/repoperls/installed-perls/perl/v5.19.0-246-g13b0f67/a2da/lib/5.19.1/x86_64-linux-thread-multi-ld
  /home/src/perl/repoperls/installed-perls/perl/v5.19.0-246-g13b0f67/a2da/lib/5.19.1
  .

--
andreas

@p5pRT
Copy link
Author

p5pRT commented Jul 11, 2013

From @cpansprout

On Mon Jun 24 19​:20​:07 2013, andreas.koenig.7os6VVqR@​franz.ak.mind.de wrote​:

git bisect
----------
13b0f67 is the first bad commit
commit 13b0f67
Author​: David Mitchell <davem@​iabyn.com>
Date​: Wed May 22 16​:38​:29 2013 +0100

re\-enable Copy\-on\-Write by default\.

sample fail report
------------------
http​://www.cpantesters.org/cpan/report/f1a6bdd2-dbbc-11e2-9c4f-
ca11697f9654

I have already communicated with rocky that this is the difference
between expected and got​:

% diff -au t/data/opt-e.{right,got}
--- t/data/opt-e.right 2013-06-23 06​:23​:12.000000000 +0200
+++ t/data/opt-e.got 2013-06-24 07​:39​:14.142577837 +0200
@​@​ -1,6 +1,6 @​@​
-- (tempfile.pl​:1)
-no warnings "once";$x=1; $y=2
+se Devel​::Trepan;no warnings "once";$x=1; $y=2
-- (tempfile.pl​:1)
-no warnings "once";$x=1; $y=2
+se Devel​::Trepan;no warnings "once";$x=1; $y=2
Debugged program terminated. Use 'q' to quit or 'R' to restart.
trepan.pl​: That's all, folks...

There are binary nulls involved too.

If I modify readlines in LineCache.pm like this​:

sub readlines($)
{
  my $path = shift;
  if (-r $path) {
warn $path;
system "cat \Q$path";
  my $fh;
  open($fh, '<', $path);
  seek $fh, 0, 0;
  my @​lines = <$fh>;
  close $fh;
  return @​lines;
  } else {
  return undef;
  }
}

I get this output (truncated).

$ /usr/local/bin/perl5.19.2 bin/trepan.pl --no-highlight --testing
t/data/opt-e.cmd -e '$x=1; $y=2;'
/private/var/folders/48/6ysnwsz12ync5qd2xyc3p2c00000gq/T/lMjR.pl at
/Users/sprout/.cpan/build/Devel-Trepan-0.50-RgNr0o/lib/Devel/Trepan/DB/LineCache.pm
line 1042.
se Devel​::Trepan;$x=1; $y=2;

This shows that the temporary file (lMjR.pl) is being written with that
mangled string.

Which part of the code writes that file?

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jul 11, 2013

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

@p5pRT
Copy link
Author

p5pRT commented Jul 11, 2013

From @cpansprout

On Wed Jul 10 21​:33​:39 2013, sprout wrote​:

On Mon Jun 24 19​:20​:07 2013, andreas.koenig.7os6VVqR@​franz.ak.mind.de
wrote​:

git bisect
----------
13b0f67 is the first bad commit
commit 13b0f67
Author​: David Mitchell <davem@​iabyn.com>
Date​: Wed May 22 16​:38​:29 2013 +0100

re\-enable Copy\-on\-Write by default\.

sample fail report
------------------
http​://www.cpantesters.org/cpan/report/f1a6bdd2-dbbc-11e2-9c4f-
ca11697f9654

I have already communicated with rocky that this is the difference
between expected and got​:

% diff -au t/data/opt-e.{right,got}
--- t/data/opt-e.right 2013-06-23 06​:23​:12.000000000 +0200
+++ t/data/opt-e.got 2013-06-24 07​:39​:14.142577837 +0200
@​@​ -1,6 +1,6 @​@​
-- (tempfile.pl​:1)
-no warnings "once";$x=1; $y=2
+se Devel​::Trepan;no warnings "once";$x=1; $y=2
-- (tempfile.pl​:1)
-no warnings "once";$x=1; $y=2
+se Devel​::Trepan;no warnings "once";$x=1; $y=2
Debugged program terminated. Use 'q' to quit or 'R' to restart.
trepan.pl​: That's all, folks...

There are binary nulls involved too.

If I modify readlines in LineCache.pm like this​:

sub readlines($)
{
my $path = shift;
if (-r $path) {
warn $path;
system "cat \Q$path";
my $fh;
open($fh, '<', $path);
seek $fh, 0, 0;
my @​lines = <$fh>;
close $fh;
return @​lines;
} else {
return undef;
}
}

I get this output (truncated).

$ /usr/local/bin/perl5.19.2 bin/trepan.pl --no-highlight --testing
t/data/opt-e.cmd -e '$x=1; $y=2;'
/private/var/folders/48/6ysnwsz12ync5qd2xyc3p2c00000gq/T/lMjR.pl at
/Users/sprout/.cpan/build/Devel-Trepan-0.50-
RgNr0o/lib/Devel/Trepan/DB/LineCache.pm
line 1042.
se Devel​::Trepan;$x=1; $y=2;

This shows that the temporary file (lMjR.pl) is being written with
that
mangled string.

Which part of the code writes that file?

Never mind that. I have reduced this bug further​:

$ ./perl -Ilib -Mstrict -de0

Loading DB routines from perl5db.pl version 1.41
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main​::(-e​:1)​: 0
  DB<1> x @​DB​::dblines
  empty array
  DB<2> x @​DB​::dbline
0 "\c@​EGIN { require 'perl5db.pl' };use strict;\cJ"
1 0

  DB<3>

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jul 12, 2013

From @cpansprout

On Thu Jul 11 06​:31​:13 2013, sprout wrote​:

I have reduced this bug further​:

$ ./perl -Ilib -Mstrict -de0

Loading DB routines from perl5db.pl version 1.41
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main​::(-e​:1)​: 0
DB<1> x @​DB​::dblines
empty array
DB<2> x @​DB​::dbline
0 "\c@​EGIN { require 'perl5db.pl' };use strict;\cJ"
1 0

DB<3>

4e917a0 should fix it. Andreas, will you please test Devel​::Trepan
against blead now?

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jul 13, 2013

From @andk

"Father Chrysostomos via RT" <perlbug-followup@​perl.org> writes​:

4e917a0 should fix it. Andreas, will you please test Devel​::Trepan
against blead now?

Done so with 4 different recent bleadperls, all passed all tests.

--
andreas

@p5pRT
Copy link
Author

p5pRT commented Jul 13, 2013

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

@p5pRT p5pRT closed this as completed Jul 13, 2013
@p5pRT
Copy link
Author

p5pRT commented Jul 14, 2013

From @rocky

Wow! Thanks everyone! I'm sure I've been seeing this bug
intermittently for a quite while on smoker reports (often on NetBSD
and Windows).

Is there a way I can see if COW is enabled so on older Perl's I can
disable this test?

Thanks again.

On Thu, Jul 11, 2013 at 11​:30 PM, Father Chrysostomos via RT
<perlbug-followup@​perl.org> wrote​:

On Thu Jul 11 06​:31​:13 2013, sprout wrote​:

I have reduced this bug further​:

$ ./perl -Ilib -Mstrict -de0

Loading DB routines from perl5db.pl version 1.41
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main​::(-e​:1)​: 0
DB<1> x @​DB​::dblines
empty array
DB<2> x @​DB​::dbline
0 "\c@​EGIN { require 'perl5db.pl' };use strict;\cJ"
1 0

DB<3>

4e917a0 should fix it. Andreas, will you please test Devel​::Trepan
against blead now?

--

Father Chrysostomos

---
via perlbug​: queue​: perl5 status​: open
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=118627

@p5pRT
Copy link
Author

p5pRT commented Jul 14, 2013

From @cpansprout

On Sun Jul 14 04​:52​:26 2013, rocky@​cpan.org wrote​:

Wow! Thanks everyone! I'm sure I've been seeing this bug
intermittently for a quite while on smoker reports (often on NetBSD
and Windows).

Is there a way I can see if COW is enabled so on older Perl's I can
disable this test?

There is Config​::Perl​::V, but it has only been a core modules since
5.17.9. The new copy-on-write mechanism was introduced in 5.17.7.

$ ./perl -Ilib -l -MConfig​::Perl​::V -e 'print
Config​::Perl​::V​::myconfig->{build}{options}{PERL_NEW_COPY_ON_WRITE}'
1

Eventually, if copy-on-write becomes the only option, that will likely
give undef (maybe in 5.22 or 5.24).

But do you really want to disable the test? It shows that there is a
real problem (solved by switching away from that dev version of perl).

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jul 14, 2013

From @rocky

On Sun, Jul 14, 2013 at 9​:43 AM, Father Chrysostomos via RT
<perlbug-followup@​perl.org> wrote​:

On Sun Jul 14 04​:52​:26 2013, rocky@​cpan.org wrote​:

Wow! Thanks everyone! I'm sure I've been seeing this bug
intermittently for a quite while on smoker reports (often on NetBSD
and Windows).

Is there a way I can see if COW is enabled so on older Perl's I can
disable this test?

There is Config​::Perl​::V, but it has only been a core modules since
5.17.9. The new copy-on-write mechanism was introduced in 5.17.7.

I hadn't realized this was so recent. However I have been getting
smoker errors with very similar behavior before 5.17.7. See for
example​:

  http​://www.cpantesters.org/cpan/report/ff9fb702-de7f-11e2-a763-77f6fec28264

$ ./perl -Ilib -l -MConfig​::Perl​::V -e 'print
Config​::Perl​::V​::myconfig->{build}{options}{PERL_NEW_COPY_ON_WRITE}'
1

Eventually, if copy-on-write becomes the only option, that will likely
give undef (maybe in 5.22 or 5.24).

But do you really want to disable the test? It shows that there is a
real problem (solved by switching away from that dev version of perl).

I don't want to disable it when using a Perl that behaves correctly.
However it is not good to run the test on a Perl where copy-on-write
was set AND we have a Perl version between 5.17.7 and before that
commit.

A failure will likely keep this from installing automatically and I
get smoker errors for a something that is not a problem with
Devel​::Trepan.

--

Father Chrysostomos

---
via perlbug​: queue​: perl5 status​: resolved
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=118627

@p5pRT
Copy link
Author

p5pRT commented Jul 14, 2013

From @cpansprout

On Sun Jul 14 13​:51​:22 2013, rocky@​cpan.org wrote​:

On Sun, Jul 14, 2013 at 9​:43 AM, Father Chrysostomos via RT
<perlbug-followup@​perl.org> wrote​:

On Sun Jul 14 04​:52​:26 2013, rocky@​cpan.org wrote​:

Wow! Thanks everyone! I'm sure I've been seeing this bug
intermittently for a quite while on smoker reports (often on NetBSD
and Windows).

Is there a way I can see if COW is enabled so on older Perl's I can
disable this test?

There is Config​::Perl​::V, but it has only been a core modules since
5.17.9. The new copy-on-write mechanism was introduced in 5.17.7.

I hadn't realized this was so recent. However I have been getting
smoker errors with very similar behavior before 5.17.7. See for
example​:

 http&#8203;://www\.cpantesters\.org/cpan/report/ff9fb702\-de7f\-11e2\-a763\-

77f6fec28264

To clarify​: Perl has had a copy-on-write mechanism since 5.8 or so. But
it only applied to hash keys and package names. It was not until perl
5.10 that basic assignment would cause the two scalars to share strings
(if the RHS scalar originated as a package name (__PACKAGE__) or hash
key (from each, keys)).

There were many core bugs in the handling of COW scalars, which I have
been fixing gradually, most of them in 5.16. But a few remained. I
think I have squashed most of them now. It was probably one of those
that caused that failure.

The new COW mechanism, introduced in 5.17.7, allows *any* scalar holding
a string to turn COW at any time, allowing these bovids to make their
way into code paths theretofore untrodden by ungulates. That was what
caused the ${"_<-e"}[0] bug.

$ ./perl -Ilib -l -MConfig​::Perl​::V -e 'print
Config​::Perl​::V​::myconfig->{build}{options}{PERL_NEW_COPY_ON_WRITE}'
1

Eventually, if copy-on-write becomes the only option, that will
likely
give undef (maybe in 5.22 or 5.24).

But do you really want to disable the test? It shows that there is
a
real problem (solved by switching away from that dev version of
perl).

I don't want to disable it when using a Perl that behaves correctly.
However it is not good to run the test on a Perl where copy-on-write
was set AND we have a Perl version between 5.17.7 and before that
commit.

A failure will likely keep this from installing automatically and I
get smoker errors for a something that is not a problem with
Devel​::Trepan.

(BTW, you could work around the bug if you want by shifting, not just
"use Devel​::Trepan;\n" off the array of lines, but also "\0se
Devel​::Trepan;\n".)

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jul 17, 2013

From @rocky

This Perl double free or corruption
crash<http​://www.cpantesters.org/cpan/report/0c0b6856-ebdc-11e2-91f5-efb6f1ff63fb>
doesn't
look good for Perl 5.19.0

Comments?

On Sat, Jul 13, 2013 at 4​:56 PM, Andreas Koenig <
andreas.koenig.7os6VVqR@​franz.ak.mind.de> wrote​:

"Father Chrysostomos via RT" <perlbug-followup@​perl.org> writes​:

4e917a0 should fix it. Andreas, will you please test Devel​::Trepan
against blead now?

Done so with 4 different recent bleadperls, all passed all tests.

--
andreas

@p5pRT
Copy link
Author

p5pRT commented Jul 17, 2013

From @andk

Rocky Bernstein <rocky@​cpan.org> writes​:

 This Perl double free or corruption crash doesn't look good for Perl 5.19.0

Comments? 

5.19.0 was just a devel snapshot, I wouldn't overrate it. Current git
repository has 973 commits on top of 5.19.0.

--
andreas

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