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.5-83-g43e4250 breaks JJORE/Enbugger-2.016.tar.gz #13831

Closed
p5pRT opened this issue May 13, 2014 · 6 comments
Closed

Bleadperl v5.19.5-83-g43e4250 breaks JJORE/Enbugger-2.016.tar.gz #13831

p5pRT opened this issue May 13, 2014 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented May 13, 2014

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

Searchable as RT121862$

@p5pRT
Copy link
Author

p5pRT commented May 13, 2014

From @andk

git bisect


commit 43e4250
Author​: Father Chrysostomos <sprout@​cpan.org>
Date​: Mon Oct 28 16​:14​:35 2013 -0700

  [perl #119799] Set breakpoints without *DB​::dbline

diagnostics


http​://www.cpantesters.org/cpan/report/c3d2dc84-da4d-11e3-af68-4cfd72305bfd

ticket at rt.cpan


https://rt.cpan.org/Ticket/Display.html?id=95079

perl -V


Summary of my perl5 (revision 5 version 19 subversion 6) configuration​:
  Commit id​: ffff3c4
  Platform​:
  osname=linux, osvers=3.13-1-amd64, archname=x86_64-linux-thread-multi-ld
  uname='linux k83 3.13-1-amd64 #1 smp debian 3.13.7-1 (2014-03-25) x86_64 gnulinux '
  config_args='-Dprefix=/home/sand/src/perl/repoperls/installed-perls/perl/v5.19.6/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.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='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.18'
  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_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 Apr 2 2014 07​:09​:42
  %ENV​:
  PERL5LIB=""
  PERL5OPT=""
  PERL5_CPANPLUS_IS_RUNNING="14108"
  PERL5_CPAN_IS_RUNNING="14108"
  PERL_MM_USE_DEFAULT="1"
  @​INC​:
  /home/sand/src/perl/repoperls/installed-perls/perl/v5.19.6/a2da/lib/site_perl/5.19.6/x86_64-linux-thread-multi-ld
  /home/sand/src/perl/repoperls/installed-perls/perl/v5.19.6/a2da/lib/site_perl/5.19.6
  /home/sand/src/perl/repoperls/installed-perls/perl/v5.19.6/a2da/lib/5.19.6/x86_64-linux-thread-multi-ld
  /home/sand/src/perl/repoperls/installed-perls/perl/v5.19.6/a2da/lib/5.19.6
  .
--
andreas

@p5pRT
Copy link
Author

p5pRT commented May 15, 2014

From @tonycoz

On Tue May 13 11​:40​:17 2014, andreas.koenig.7os6VVqR@​franz.ak.mind.de wrote​:

git bisect
----------
commit 43e4250
Author​: Father Chrysostomos <sprout@​cpan.org>
Date​: Mon Oct 28 16​:14​:35 2013 -0700

[perl #119799] Set breakpoints without *DB​::dbline

diagnostics
-----------
http​://www.cpantesters.org/cpan/report/c3d2dc84-da4d-11e3-af68-
4cfd72305bfd

ticket at rt.cpan
-----------------
https://rt.cpan.org/Ticket/Display.html?id=95079

I think this is a case of Enbugger simply needing to be updated to match the new magic handling of the %{"_<$filename"} hashes.

Enbugger sets the following magic specifically on %DB​::dbline​:

  hv_magic(hv, NULL, PERL_MAGIC_dbfile);

and the mg_obj of NULL is copied to the element magic (and turned into dbline) when the element temp is created.

This worked fine before 43e4250.

With 43e4250, perl sets the following magic on the HV​:

  hv_magic(GvHVn(gv), GvAVn(gv), PERL_MAGIC_dbfile);

and the dbline magic expects the mg_obj to contain the AV associated with the breakpoint HV so it can check whether there is a line to break on and which op to break on.

So when the new dbline magic code interacts with the older magic set by Enbugger, bad things happen.

I've attached a possible fix, this passes all tests on blead, and on 5.18.0 (though it does unnecessary things on 5.18.0).

Tony

@p5pRT
Copy link
Author

p5pRT commented May 15, 2014

From @tonycoz

Enbugger.diff
diff -ru Enbugger-2.016-orig/Enbugger.xs Enbugger-2.016/Enbugger.xs
--- Enbugger-2.016-orig/Enbugger.xs	2014-04-26 01:58:29.000000000 +1000
+++ Enbugger-2.016/Enbugger.xs	2014-05-15 10:51:28.000000000 +1000
@@ -231,13 +231,12 @@
 Enbugger_set_magic_dbfile(rv)
     SV *rv
   INIT:
-    HV *hv;
+    GV *gv;
   CODE:
     assert(SvROK(rv));
-
-    hv = (HV*) SvRV(rv);
-    assert(SVt_PVHV == SvTYPE(hv));
-    hv_magic(hv, NULL, PERL_MAGIC_dbfile);
+    gv = (GV*)SvRV(rv);
+    assert(SVt_PVGV == SvTYPE(gv));
+    hv_magic(GvHVn(gv), GvAVn(gv), PERL_MAGIC_dbfile);
 
 
 
diff -ru Enbugger-2.016-orig/lib/Enbugger.pm Enbugger-2.016/lib/Enbugger.pm
--- Enbugger-2.016-orig/lib/Enbugger.pm	2014-04-26 01:58:29.000000000 +1000
+++ Enbugger-2.016/lib/Enbugger.pm	2014-05-15 10:51:28.000000000 +1000
@@ -356,11 +356,11 @@
      if ( not defined $file ) {
          *DB::dbline = [];
          *DB::dbline = {};
-         Enbugger::set_magic_dbfile( \%DB::dbline );
      }
      else {
          no strict 'refs';
          *DB::dbline = \*{"main::_<$file"};
+         Enbugger::set_magic_dbfile( \*DB::dbline );
      }
 }
 
@@ -399,8 +399,8 @@
 
     if ( ! *$glob{HASH} ) {
         my %breakpoints;
-        Enbugger::set_magic_dbfile(\%breakpoints);
         *$glob = \%breakpoints;
+        Enbugger::set_magic_dbfile($glob);
     }
     
     $$symname ||= $file;

@p5pRT
Copy link
Author

p5pRT commented May 15, 2014

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

@p5pRT
Copy link
Author

p5pRT commented Jun 9, 2014

From @rjbs

Resolved as the patch has been filed with the dist.

--
rjbs

@p5pRT p5pRT closed this as completed Jun 9, 2014
@p5pRT
Copy link
Author

p5pRT commented Jun 9, 2014

@rjbs - 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