New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] fix dl_find_symbol_anywhere() #16577
Labels
Comments
From @bulk88Created by @bulk88See attached patch. Perl Info
|
From @bulk880001-fix-dl_find_symbol_anywhere.patchFrom 8f4a947dd37d238e652bf4e11bdba595283b542f Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@cpanel.net>
Date: Sat, 2 Jun 2018 21:08:26 -0400
Subject: [PATCH] fix dl_find_symbol_anywhere()
return the address not the name.
Closes #352, thanks to @voegelas
bulk88: test extracted from cperl
commit bef2a1d84a31b54863909d8222c6d723a3c1d9b7 the bug fix is for a XS
implementation of sub dl_find_symbol_anywhere() in cperl that is not in
perl, but sub dl_find_symbol_anywhere() had no tests in perl or cperl prior
to that cperl bug report so bring the cperl test into perl so
sub dl_find_symbol_anywhere() has tests.
Signed-off-by: Daniel Dragan <bulk88@hotmail.com>
---
ext/DynaLoader/t/DynaLoader.t | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t
index 7fe30b3..bb44826 100644
--- a/ext/DynaLoader/t/DynaLoader.t
+++ b/ext/DynaLoader/t/DynaLoader.t
@@ -32,7 +32,7 @@ BEGIN {
'Time::HiRes' => q| ::is( ref Time::HiRes->can('usleep'),'CODE' ) |, # 5.7.3
);
-plan (26 + keys(%modules) * 3);
+plan (27 + keys(%modules) * 3);
# Try to load the module
use_ok( 'DynaLoader' );
@@ -146,15 +146,25 @@ for my $module (sort keys %modules) {
is( scalar @DynaLoader::dl_librefs, scalar keys %modules, "checking number of items in \@dl_librefs" );
is( scalar @DynaLoader::dl_modules, scalar keys %modules, "checking number of items in \@dl_modules" );
+my ($symbol, $symref);
+if ($modules{'List::Util'}) {
+ $symbol = 'boot_List__Util';
+ $symref = DynaLoader::dl_find_symbol_anywhere($symbol);
+}
+
my @loaded_modules = @DynaLoader::dl_modules;
for my $libref (reverse @DynaLoader::dl_librefs) {
+
+ my $module = pop @loaded_modules;
+ if ($module eq 'List::Util' and $modules{'List::Util'}) {
+ is($symref, DynaLoader::dl_find_symbol($libref, $symbol), 'dl_find_symbol');
+ }
TODO: {
todo_skip( "Can't safely unload with -DPERL_GLOBAL_STRUCT_PRIVATE (RT #119409)", 2 )
if $Config{ccflags} =~ /(?:^|\s)-DPERL_GLOBAL_STRUCT_PRIVATE\b/;
SKIP: {
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" );
--
2.5.0.windows.1
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migrated from rt.perl.org#133242 (status was 'new')
Searchable as RT133242$
The text was updated successfully, but these errors were encountered: