Bug#539171: liblog-trace-perl: Log::Trace does not correctly handle constants

Vincent Danjean vdanjean at debian.org
Wed Jul 29 15:17:21 UTC 2009


Package: liblog-trace-perl
Version: 1.070-2
Severity: normal
Tags: patch

  Hi,

  Look at this small program:
====
package MY;
use constant C1 => 0;
sub ok { }
package main;
sub ok { }
use Log::Trace warn => { 'AllSubs' => 1,
                         'Everywhere' => 1,
                         'Deep' => 1,
};
ok();
MY::ok();
====

  When running it, it fails:
====
vdanjean at eyak:/tmp$ perl ./test.pl
Not a GLOB reference at /usr/share/perl5/Log/Trace.pm line 275.
BEGIN failed--compilation aborted at ./test.pl line 10.
vdanjean at eyak:/tmp$ 
====
  If I patch /usr/share/perl5/Log/Trace.pm (near line 275)
                 # only wrap code references
+                next if (ref($symbols->{$typeglob}) eq 'SCALAR');
                 my $sub = *{$symbols->{$typeglob}}{CODE};
                 next unless (defined $sub and defined &$sub);
then, it works:
====
vdanjean at eyak:/tmp$ perl ./test.pl
main::ok(  )
MY::ok(  )
Config::DESTROY( Config, ... )
vdanjean at eyak:/tmp$ 
====

  Note that I'm not sure there are not others bugs.
In particular, if I do not set 'Deep' => 1, the result should not change.
However, in this case, the programm runs (with or without my patch) but
other modules such as MY::ok are not traced anymore!
====
vdanjean at eyak:/tmp$ perl ./test.pl
main::ok(  )
vdanjean at eyak:/tmp$ 
====

  This bug (and the fix) should probably reported upstream, too.

  Regards,
    Vincent

-- System Information:
Debian Release: squeeze/sid
  APT prefers oldstable
  APT policy: (500, 'oldstable'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-rc3-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages liblog-trace-perl depends on:
ii  perl                          5.10.0-24  Larry Wall's Practical Extraction 

Versions of packages liblog-trace-perl recommends:
ii  libdata-serializer-perl       0.49-1     module that serializes data struct

liblog-trace-perl suggests no packages.

-- no debconf information





More information about the pkg-perl-maintainers mailing list