Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by syphilis (Canon)
on Jan 05, 2013 at 03:15 UTC ( #1011754=note: print w/ replies, xml ) Need Help??


in reply to Re^13: 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

rebasing seems to have fixed it

Pardon the dumb question ... but how does one do this rebasing ?
There's a few (native Win32, not Cygwin) dll's that I'd like to try this on, but I don't understand how to go about it. (A step-by-step guide would be handy.)

Cheers,
Rob


Comment on Re^14: if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location
Replies are listed 'Best First'.
Re^15: if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location
by Anonymous Monk on Jan 05, 2013 at 09:16 UTC
    update: ok, step by step
    • perl Makefile.PL
    • dmake test :) and you notice this error pops up
    • if you know which dll it is , edit MAKEFILE LDDLFLAGS add   -Wl,--image-base=0x70000000 and  dmake test again (0x70000000 is default rebase address)

    and I'm pooped :)

    See Re^3: if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location, Re^11: if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location

    one way is specify the base by adding   -Wl,--image-base=0x70000000 to LDDLFLAGS , when doing Makefile dance

    This works well if you trigger the error during the test suite like I did

    Another way (i've not tried) is using msdn rebase

    or editbin.exe /REBASE

    or http://cygwin.wikia.com/wiki/Rebaseall

    If you got mingw.org you can  mingw-get install msys-rebase and you'll need  mingw-get install msys-dash   for rebaseall (its a 224 line shell script)

    I don't know where to get the sources, rebase -V doesn't say, I guess cygwin someplace I already posted before http://www.tishler.net/jason/software/rebase/

    http://gmod.org/wiki/GBrowse_Cygwin_HOWTO#Rebaseall

    I guess strawberry / citrusperl ought to package rebase.exe and a rebaseall.pl to go along with it

    I don't remember now, but I've either read something about a way to have -enable-auto-image-base keep a database of image bases/ranges, so it issues a non conflicting imagebase/range (a free space)

    or I thought about it/or patching MakeMaker (or CBuilder whatever) to do the same (keeping a database of image bases/ranges, and replace -enable-auto-image-base with -Wl,--image-base= ) for pre-vista operating systems

    but the issue is kinda rare , I've only encountered it less than 6 times in many years, always on a perl install with ~ 1040 cpan distributions :) but only 200-400 dlls

    so I suppose PAR-ed up rebaseall.pl packing rebase.exe ought to suffice, if we FAQ up the issue adequately, so folks know what to do :)

    If citrusperl offered more binary packages for download (ala ppm), only one guy would have to rebaseall before releasing :)

      if you know which dll it is , edit MAKEFILE LDDLFLAGS add -Wl,--image-base=0x70000000 and dmake test again (0x70000000 is default rebase address)

      Excellent !! That fixes the problem I have with 32-bit perls and PDL::Graphics::PLplot (when PDL::Graphics::PLplot is built as part of the PDL build).

      However, it doesn't help with 64-bit perls.
      Could it be that the 0x70000000 needs to be a different value on 64-bit perls ?

      Note: With 32-bit perls the dll fails to load, with an error message stating that the dll is not a valid Win32 application.
      With 64-bit perls the dll also fails to load, but the error message is a little different, claiming an "Invalid access to memory location". After amending the Makefile as per suggested, PDL::Graphics::PLplot *does* get rebuilt (as expected), but the failure and error message remain unchanged.

      Cheers,
      Rob
        Tried a newer GCC or the other Mingw build (org or w64)?

        Invalid access to memory location usually means DllMain did a segfault and Windows caught that exception, and unloaded the DLL, so the LoadLibrary failed.

        Could it be that the 0x70000000 needs to be a different value on 64-bit perls ?

        Probably not, but I have read in one of those rebase links that rebas-ing should be done @ install time for least conflicts, so you should get more info, check for ImageBase conflicts for all dll's involved (even those in %WINDIR% )

        Also try depends.exe Ctrl+O perl.exe , F7 ...foo.pl to see a LoadLibrary trace, maybe you'll see something new, but so far it sounds like the same thing I saw

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011754]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2015-08-01 01:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls