How can I track the origin of Devel :: Peek

Out of sight, I began to see these lines:

SV = PVIV(0x38fe3f0) at 0x3de5b80
  REFCNT = 1
  FLAGS = (PADMY)
  IV = 0
  PV = 0

They are not displayed sequentially, and if I run the script several times, with the same input, this output sometimes appears, sometimes even twice, and sometimes at all.

And from time to time, the script freezes and displays an error message stating that "Perl, unfortunately, does not work."

This is obviously the output Devel::Peek, but none of my modules use it, and the only CPAN modules I use are Log :: Log4perl, Data :: Dumper :: AutoEncode (which, of course, uses Data :: Dumper) and List :: Util. I use all this widely, and I never received such a conclusion.

Insert: Win-7 Pro 64 bit

Summary of my perl5 version (version 5 of version 18 of subversion 2):

  Platform:
    osname=MSWin32, osvers=6.2, archname=MSWin32-x64-multi-thread
    uname='Win32 strawberry-perl 5.18.2.1 #1 Tue Jan  7 22:32:35 2014 x64'

- , , ?

+4
3

script :

BEGIN {
    use Carp qw( );
    use Devel::Peek qw( );
    my $old = \&Devel::Peek::Dump;
    my $new = sub { Carp::cluck("Devel::Peek::Dump got called somewhere!"); &$old };
    no warnings 'redefine';
    *Devel::Peek::Dump = $new;
}

, - Dump Devel:: Peek.

Carp::cluck .

+8

, , . sv_dump XS.

use Inline C => <<'__EOI__';

   void dump_sv(SV* sv) {
      sv_dump(sv);
   }

__EOI__

dump_sv(1);

:

SV = IV(0x34cd588) at 0x34cd598
  REFCNT = 1
  FLAGS = (IOK,READONLY,PROTECT,pIOK)
  IV = 1

:

  • perl sv_dump. ( )
  • .dll sv_dump. ( ?)
  • , . ( )
+5

Thank you everybody.

The culprit was most likely the lack of instructions $sth->finish;after several database search operations. Since I added them, I no longer see these posts!

0
source

Source: https://habr.com/ru/post/1617763/


All Articles