Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by bulk88 (Priest)
on Dec 06, 2012 at 16:55 UTC ( #1007620=note: print w/ replies, xml ) Need Help??


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

Some reverse engineering says the only way to get a "LdrRelocateImageWithBias() failed 0xc000007b" is to have LdrProcessRelocationBlockLongLong fail, the error in reactos is different from windows, but http://code.google.com/searchframe#S3vzerue4i0/trunk/reactos/lib/rtl/image.c&q=LdrRelocateImageWithBias%20package:reactos-mirror\.googlecode\.com&l=484 in Windows causes LdrRelocateImageWithBias() failed 0xc000007b. http://code.google.com/searchframe#S3vzerue4i0/trunk/reactos/lib/rtl/image.c&q=LdrProcessRelocationBlockLongLong%20package:reactos-mirror%5C.googlecode%5C.com&l=364. So its a GCC bug, not Perl related. GCC created a relocation entry http://source.winehq.org/source/include/winnt.h#L3027 for an relocation type unknown to 32 bit x86 windows. Which is the rogue entry, I don't know since I dont have the DLL, you do. You can try a "dumpbin /relocations" and post the contents, or analyze them yourself.


Comment on Re^12: if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location
Re^13: if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location
by Anonymous Monk on Dec 06, 2012 at 18:29 UTC

    GCC created a relocation entry http://source.winehq.org/source/include/winnt.h#L3027 for an relocation type unknown to 32 bit x86 windows. Which is the rogue entry, I don't know since I dont have the DLL, you do. You can try a "dumpbin /relocations" and post the contents, or analyze them yourself.

    What would I be looking for? objdump doesn't list any unknown types, without -s its

    339 ABSOLUTE 44811 HIGHLOW
    about ~2MB worth of text

    With -s its

    494 ABSOLUTE 75652 HIGHLOW

    I could send you the dlls (if you know a no-hassle service), but rebasing seems to have fixed it, or was that just coincidence?

      Rebasing it fixed it because it didnt have to be rebased by windows! Its bugs with GCC.

        Rebasing it fixed it because it didnt have to be rebased by windows! Its bugs with GCC.

        I kinda doubt that

      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
        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 :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-10-23 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (124 votes), past polls