Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by Anonymous Monk
on Dec 06, 2012 at 13:39 UTC ( #1007568=note: print w/ replies, xml ) Need Help??


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

Same messsage :)

$ perl badcrabs.txt ret=1849688064 glr=2 $ perl -MDigest::SHA1 badcrabs.txt ret=0 glr=193

In depends.exe its now

LDR: LdrRelocateImageWithBias() failed 0xc000007b
LDR: OldBase     : 6E400000
LDR: NewBase     : 00A90000
LDR: Diff        : 0xffffffff92690000
LDR: NextOffset  : 00CC9F90
LDR: *NextOffset : 0x302e
LDR: SizeOfBlock : 0x5c

Compared to -MDigest::SHA1 -MXML::LibXML

LDR: LdrRelocateImageWithBias() failed 0xc000007b
LDR: OldBase     : 6E400000
LDR: NewBase     : 010A0000
LDR: Diff        : 0xffffffff92ca0000
LDR: NextOffset  : 012D9F90
LDR: *NextOffset : 0x302e
LDR: SizeOfBlock : 0x5c

Apparently LdrRelocate... errors happen ( Weird problem loading a dll with win32 LoadLibrary() function ) commonly with cygwin , and they recommend using some "rebaseall" shell script, and I saw they do some rebase-ing for MakeMaker/cygwin

So I look through my dlls $ perl -lne " chomp; print; print qx{objdump -x $_ |grep ImageBase }; " dlls.txt and both Digest/SHA1/SHA1.dll and auto/XML/LibXML/LibXML.dll share ImageBase 6e400000

Not sure if this is a problem but http://www.sourceware.org/ml/cygwin-apps/2011-07/msg00002.html / http://www.sourceware.org/ml/cygwin/2010-07/msg00258.html / perl5140delta suggests this collision is the problem , so I'll need to rebase, so I try that with the default rebase-2.4.2 address

 perl -pi.orig -e " s{^(LDDLFLAGS = )}{$1 -Wl,--image-base=0x70000000 }; " Makefile

and it worked!!!!!

*whew*

So from time to time I'll have to rebase a few dlls if I stick with this old OS


Comment on Re^11: if Digest::SHA1 loaded Can't load LibXML/LibXML.dll Invalid access to memory location
Select or Download Code
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

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2014-12-29 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (188 votes), past polls