Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 34066
Status: open
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Segfault when calling CPAN::HandleConfig->load (5.5.5,5.6.2)
On FreeBSD-6.2 (amd64) with CPAN 1.9258 I get segfaults using this command: $ perl5.00505 -MCPAN -e 'CPAN::HandleConfig->load' CPAN: Term::ANSIColor loaded ok (v1.12) CPAN: File::HomeDir loaded ok (v0.66) [1] 41799 segmentation fault (core dumped) perl5.00505 -MCPAN -e 'CPAN::HandleConfig->load' $ perl5.6.2 -MCPAN -e 'CPAN::HandleConfig->load' CPAN: Term::ANSIColor loaded ok (v1.03) CPAN: File::HomeDir loaded ok (v0.66) [1] 41807 segmentation fault (core dumped) perl5.6.2 -MCPAN -e 'CPAN::HandleConfig->load' A workaround is to explicitely preload File::HomeDir $ perl5.6.2 -MFile::HomeDir -MCPAN -e 'CPAN::HandleConfig->load' $ perl5.00505 -MFile::HomeDir -MCPAN -e 'CPAN::HandleConfig->load' In both cases the backtrace looks the same: #0 0x00000000004642aa in Perl_leave_scope () #1 0x000000000044b516 in Perl_pp_leavesub () #2 0x00000000004812e3 in Perl_runops_standard () #3 0x00000000004162b9 in perl_run () #4 0x0000000000412860 in main () Regards, Slaven
I have tried several variations under 5.6.2 and 5.5.5 but get no SEGV. I do get the following from a 5.6.2: Attempt to free unreferenced scalar at /home/src/perl/repoperls/installed-perls/maint-5.6/perl-5.6.2/pVMpUbx/perl-5.6.1@22233/lib/5.6.1/CPAN/HandleConfig.pm line 471. For what it's worth: This noise goes away when I uninstall File::HomeDir.
On Sun Mar 16 15:00:16 2008, ANDK wrote: Show quoted text
> I have tried several variations under 5.6.2 and 5.5.5 but get no SEGV. > > I do get the following from a 5.6.2: > > Attempt to free unreferenced scalar at > /home/src/perl/repoperls/installed-perls/maint-5.6/perl- > 5.6.2/pVMpUbx/perl-5.6.1@22233/lib/5.6.1/CPAN/HandleConfig.pm > line 471. > > For what it's worth: This noise goes away when I uninstall > File::HomeDir. >
The problem also goes away with this diff: --- lib/CPAN/HandleConfig.pm (Revision 2839) +++ lib/CPAN/HandleConfig.pm (Arbeitskopie) @@ -491,7 +491,7 @@ # why one load message pops up even when verbosity is turned off. # This means File::HomeDir load messages are never seen, but I # think that's probably OK -- DAGOLDEN - local $CPAN::Config->{load_module_verbosity} = q[none]; +# local $CPAN::Config->{load_module_verbosity} = q[none]; if ($CPAN::META->has_usable("File::HomeDir")) { $home = File::HomeDir->my_data; unless (defined $home) { And another interesting point: it seems that home() is called recursively here. If I add a Carp::cluck() here I get: at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN/HandleConfig.pm line 494 CPAN::HandleConfig::home() called at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN/HandleConfig.pm line 471 CPAN::HandleConfig::require_myconfig_or_config() called at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN/HandleConfig.pm line 515 CPAN::HandleConfig::load('CPAN::HandleConfig') called at -e line 1 at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN/HandleConfig.pm line 494 CPAN::HandleConfig::home() called at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN/HandleConfig.pm line 471 CPAN::HandleConfig::require_myconfig_or_config() called at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN/HandleConfig.pm line 515 CPAN::HandleConfig::load('CPAN::HandleConfig') called at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN.pm line 3279 CPAN::Shell::optprint('CPAN::Shell', 'load_module', 'CPAN: File::HomeDir loaded ok (v0.66)^J') called at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN.pm line 1441 CPAN::has_inst('CPAN=HASH(0x646720)', 'File::HomeDir', undef) called at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN.pm line 1338 CPAN::has_usable('CPAN=HASH(0x646720)', 'File::HomeDir') called at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN/HandleConfig.pm line 496 CPAN::HandleConfig::home() called at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN/HandleConfig.pm line 471 CPAN::HandleConfig::require_myconfig_or_config() called at /mnt/i386/usr/local/src/work/CPAN-svn/blib/lib/CPAN/HandleConfig.pm line 515 CPAN::HandleConfig::load('CPAN::HandleConfig') called at -e line 1 While it still seems to be a perl bug, I wonder if the loading of HandleConfig while in HandleConfig can cause also other problems and should be probably avoided? Regards, Slaven