http://www.perlmonks.org?node_id=1007432


in reply to Re^11: if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location
in thread if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location

Both ok and broken loaded correctly without error. Win32::LoadLibrary returns a handle for both and reading that handle as a mem block, the first 2 letters were MZ (dll/exe magic). Can not reproduce.
  • Comment on Re^12: if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location

Replies are listed 'Best First'.
Re^13: if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location
by syphilis (Archbishop) on Dec 06, 2012 at 01:03 UTC
    Win32::LoadLibrary returns a handle for both

    Yep - just checked, and Win32::LoadLibrary loads them both just fine for me, too.
    Which means ... what ... it's a DynaLoader bug ?

    For my check, I ran this script (as per the one you posted earlier in this thread):
    use warnings; use strict; use Win32; my $ret = Win32::LoadLibrary('C:\sisyphusion\PLplot_broken.dll'); print "ret=$ret glr=".Win32::GetLastError()."\n"; $ret = Win32::LoadLibrary('C:\sisyphusion\PLplot_ok.dll'); print "ret=$ret glr=".Win32::GetLastError()."\n";
    and that produced the following output:
    ret=1647050752 glr=0 ret=1659895808 glr=0
    It's not just 5.8.9 where this happens, but also 5.8.8, 5.14.0. 5.16.0 (and perhaps other perls as well).

    Cheers,
    Rob
        I got "Can't load PDL::Core module at C:/sperl/589/perl/lib/DynaLoader.pm line 249." ... with broken dll.

        I get that, too - with *both* broken dll *and* ok dll
        With the ok dll:
        C:\>pmver PDL::Graphics::PLplot 0.61 C:\>perl -MDynaLoader -e"@PDL::Graphics::PLplot::ISA = ('DynaLoader'); + DynaLoader::bootstrap('PDL::Graphics::PLplot');" Can't load PDL::Core module at C:/MinGW/perl589/lib/DynaLoader.pm line + 249.
        Then switch to the broken dll:
        C:\>pmver PDL::Graphics::PLplot Can't load 'C:/MinGW/perl589/site/lib/auto/PDL/Graphics/PLplot/PLplot. +dll' for module PDL::Graphics::PLplot: load_file:%1 is not a valid Wi +n32 application at C: /MinGW/perl589/lib/DynaLoader.pm line 226. at -e line 1 Compilation failed in require at -e line 1. C:\>perl -MDynaLoader -e"@PDL::Graphics::PLplot::ISA = ('DynaLoader'); + DynaLoader::bootstrap('PDL::Graphics::PLplot ');" Can't load PDL::Core module at C:/MinGW/perl589/lib/DynaLoader.pm line + 249.
        I don't know what to make of that - the PDL::Graphics::PLplot module is fine so long as I use the ok dll.
        Doesn't this merely demonstrate that PDL::Graphics::PLplot has a dependency on PDL::Core ?

        Cheers,
        Rob