In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/ed57bf8d26295a956cc0a2b7959fd1088d7f8b2f?hp=49bb71aec3ca9a185f018c6b8f85bad3580522af>
- Log ----------------------------------------------------------------- commit ed57bf8d26295a956cc0a2b7959fd1088d7f8b2f Author: Father Chrysostomos <[email protected]> Date: Mon Dec 10 06:19:14 2012 -0800 Stop DynaLoader.t from unload File::Glob File::Glob now sets PL_opfreehook. That means that if we unload it we will leave PL_opfreehook pointing to an invalid address, resulting in a crash when ops are freed. I didnât catch this because the tests are skipped on darwin. They donât actually need to be, at least under recent versions, so I modi- fied the skip code. ----------------------------------------------------------------------- Summary of changes: ext/DynaLoader/t/DynaLoader.t | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t index 32b6a1b..57f1e48 100644 --- a/ext/DynaLoader/t/DynaLoader.t +++ b/ext/DynaLoader/t/DynaLoader.t @@ -32,6 +32,11 @@ plan tests => 22 + keys(%modules) * 3; # Try to load the module use_ok( 'DynaLoader' ); +# Some tests need to be skipped on old Darwin versions. +# Commit ce12ed1954 added the skip originally, without specifying which +# darwin version needed it. I know OS X 10.6 (Snow Leopard; darwin 10) +# supports it, so skip anything before that. +my $old_darwin = $^O eq 'darwin' && ($Config{osvers} =~ /^(\d+)/)[0] < 10; # Check functions can_ok( 'DynaLoader' => 'bootstrap' ); # defined in Perl section @@ -43,7 +48,7 @@ if ($Config{usedl}) { can_ok( 'DynaLoader' => 'dl_load_file' ); # defined in XS section can_ok( 'DynaLoader' => 'dl_undef_symbols' ); # defined in XS section SKIP: { - skip "unloading unsupported on $^O", 1 if ($^O eq 'VMS' || $^O eq 'darwin'); + skip "unloading unsupported on $^O", 1 if ($old_darwin || $^O eq 'VMS'); can_ok( 'DynaLoader' => 'dl_unload_file' ); # defined in XS section } } else { @@ -137,8 +142,9 @@ is( scalar @DynaLoader::dl_modules, scalar keys %modules, "checking number of it my @loaded_modules = @DynaLoader::dl_modules; for my $libref (reverse @DynaLoader::dl_librefs) { SKIP: { - skip "unloading unsupported on $^O", 2 if ($^O eq 'VMS' || $^O eq 'darwin'); + skip "unloading unsupported on $^O", 2 if ($old_darwin || $^O eq 'VMS'); my $module = pop @loaded_modules; + skip "File::Glob sets PL_opfreehook", 2 if $module eq 'File::Glob'; my $r = eval { DynaLoader::dl_unload_file($libref) }; is( $@, '', "calling dl_unload_file() for $module" ); is( $r, 1, " - unload was successful" ); -- Perl5 Master Repository
