From: Jos I. B. <ka...@xs...> - 2004-10-15 11:24:43
|
On Oct 15, 2004, at 8:28 AM, Mike Schilli wrote: > Thanks for the patch ... I can certainly add it, but I'd rather like to > understand what's causing the problem. Do you have a test case? I'll be > happy to install SPOPS and try it out. It might be specific to our db-scheme, i don't know, but i can't share it right now. What i have done is add some debug info in Logger.pm: *{__PACKAGE__ . "::is_$lclevel"} = sub { $_[0]->{"is_" . $level}->($_[0], "is_" . $lclevel) if $_[0]->{"is_".$level}; unless( $_[0]->{"is_".$level} ) { use Carp::Trace qw[trace]; use Data::Dumper; warn trace(); warn Dumper \@_; warn "level: $level\nlclevel: $lclevel\n"; } }; So now it warns with a bunch of information when we find the sub is undefined... the output this produces during our 'make test' is below the sig, but it basically looks like you have, unexpectedly, ended up with an empty log::log4perl object. > Ideally, I'd like to have a test case that I could add to our test > suite to make sure the bug gets fixed completely. Yeah, the spops test suite doesn't catch this, but to be honest, i'm not quite sure where to test this, or what this code is even supposed to be doing... this was a poor man's patch to make it Stop Complaining ;) Hope the debug output below gives you something to go on though. -- Jos Boumans How do I prove I am not crazy to people who are? CPANPLUS http://cpanplus.sf.net [kane@god-dev ~...GOD/MMDB]$ make test PERL_DL_NONLAZY=1 /usr/local/bin/perl5.8.3 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/000-connect...................ok t/010-MMDB-Base.................ok 56/0Unknown type 93, defaulting to VARCHAR at /usr/local/lib/perl5/site_perl/5.8.3/SPOPS/SQLInterface.pm line 41. t/010-MMDB-Base.................ok 387/0 main::(eval) [3] void - no new stash t/010-MMDB-Base.t line 0 SPOPS::DESTROY [2] void - new stash t/010-MMDB-Base.t line 0 Log::Log4perl::Logger::__ANON__ [1] scalar - new stash /usr/local/lib/perl5/site_perl/5.8.3/SPOPS.pm line 183 $VAR1 = [ bless( {}, 'Log::Log4perl::Logger' ) ]; level: DEBUG lclevel: debug Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.6.1/Carp/Trace.pm line 40 during global destruction. main::(eval) [4] void - no new stash t/010-MMDB-Base.t line 0 SPOPS::DESTROY [3] void - new stash t/010-MMDB-Base.t line 0 SPOPS::AUTOLOAD [2] list - new stash /usr/local/lib/perl5/site_perl/5.8.3/SPOPS.pm line 183 Log::Log4perl::Logger::__ANON__ [1] scalar - new stash /usr/local/lib/perl5/site_perl/5.8.3/SPOPS.pm line 671 $VAR1 = [ bless( {}, 'Log::Log4perl::Logger' ) ]; level: INFO lclevel: info Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/Log/Log4perl/Logger.pm line 684 during global destruction. (in cleanup) Undefined subroutine &main:: called at /usr/local/lib/perl5/site_perl/5.8.3/Log/Log4perl/Logger.pm line 684 during global destruction. t/010-MMDB-Base.................ok t/020-MMDB-Basic-Transaction....ok 63/0Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.6.1/Carp/Trace.pm line 40 during global destruction. main::(eval) [3] void - no new stash t/020-MMDB-Basic-Transaction.t line 0 SPOPS::DESTROY [2] void - new stash t/020-MMDB-Basic-Transaction.t line 0 Log::Log4perl::Logger::__ANON__ [1] scalar - new stash /usr/local/lib/perl5/site_perl/5.8.3/SPOPS.pm line 183 $VAR1 = [ bless( {}, 'Log::Log4perl::Logger' ) ]; level: DEBUG lclevel: debug Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.6.1/Carp/Trace.pm line 40 during global destruction. main::(eval) [4] void - no new stash t/020-MMDB-Basic-Transaction.t line 0 SPOPS::DESTROY [3] void - new stash t/020-MMDB-Basic-Transaction.t line 0 SPOPS::AUTOLOAD [2] list - new stash /usr/local/lib/perl5/site_perl/5.8.3/SPOPS.pm line 183 Log::Log4perl::Logger::__ANON__ [1] scalar - new stash /usr/local/lib/perl5/site_perl/5.8.3/SPOPS.pm line 671 $VAR1 = [ bless( {}, 'Log::Log4perl::Logger' ) ]; level: INFO lclevel: info Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/Log/Log4perl/Logger.pm line 684 during global destruction. (in cleanup) Undefined subroutine &main:: called at /usr/local/lib/perl5/site_perl/5.8.3/Log/Log4perl/Logger.pm line 684 during global destruction. t/020-MMDB-Basic-Transaction....ok t/021-MMDB-Data-Transaction.....ok 19/0Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.6.1/Carp/Trace.pm line 40 during global destruction. main::(eval) [3] void - no new stash t/021-MMDB-Data-Transaction.t line 0 SPOPS::DESTROY [2] void - new stash t/021-MMDB-Data-Transaction.t line 0 Log::Log4perl::Logger::__ANON__ [1] scalar - new stash /usr/local/lib/perl5/site_perl/5.8.3/SPOPS.pm line 183 $VAR1 = [ bless( {}, 'Log::Log4perl::Logger' ) ]; level: DEBUG lclevel: debug Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.6.1/Carp/Trace.pm line 40 during global destruction. main::(eval) [4] void - no new stash t/021-MMDB-Data-Transaction.t line 0 SPOPS::DESTROY [3] void - new stash t/021-MMDB-Data-Transaction.t line 0 SPOPS::AUTOLOAD [2] list - new stash /usr/local/lib/perl5/site_perl/5.8.3/SPOPS.pm line 183 Log::Log4perl::Logger::__ANON__ [1] scalar - new stash /usr/local/lib/perl5/site_perl/5.8.3/SPOPS.pm line 671 $VAR1 = [ bless( {}, 'Log::Log4perl::Logger' ) ]; level: INFO lclevel: info Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.3/Log/Log4perl/Logger.pm line 684 during global destruction. (in cleanup) Undefined subroutine &main:: called at /usr/local/lib/perl5/site_perl/5.8.3/Log/Log4perl/Logger.pm line 684 during global destruction. t/021-MMDB-Data-Transaction.....ok All tests successful. Files=4, Tests=473, 3 wallclock secs ( 2.02 cusr + 0.14 csys = 2.16 CPU) [kane@god-dev ~...GOD/MMDB]$ |