3

My Cygwin environment (Windows 7 O/S) has developed a strange problem. A couple of days ago I was running a perl script fine, but today I'm getting

0 [main] perl 5056 C:\cygwin\bin\perl.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\perl
5\5.10\i686-cygwin\auto\Socket\Socket.dll to same address as parent: 0x8F0000 != 0x960000
Stack trace:
Frame     Function  Args
0088B508  6102749B  (0088B508, 00000000, 00000000, 00000000)
0088B7F8  6102749B  (61177B80, 00008000, 00000000, 61179977)
0088C828  61004AFB  (611A136C, 6123E0FC, 008F0000, 00960000)
End of stack trace

I tried running rebase, as advised here but the problem persists. Any answers appreciated, as I have a demo tomorrow for which this script is needed. Wasn't expecting a problem like this!

Andrew Fielden
  • 3,751
  • 3
  • 31
  • 47
  • 1
    Have you rebooted the system this is running on? – Jim Garrison Aug 01 '11 at 17:43
  • do you have any other versions of PERL (e.g., windows native) version running? If things get really, bad, try using a different version like Strawberry PERL: http://stackoverflow.com/questions/463947/how-can-i-modify-my-cygwin-environment-to-use-strawberry-perl-instead-of-the-pack – davidosomething Aug 01 '11 at 18:03
  • Occam's razor strikes again. In the end a reboot sorted things out. Don't you just love Windows :) – Andrew Fielden Aug 02 '11 at 08:15
  • Keep those links handy. If my experience is any guide a reboot won't be a permanent solution. – mob Aug 02 '11 at 19:43

2 Answers2

3

This is a semi-informed answer, as I have had similar difficulty and eventually flailed around until the problem went away.

rebaseall with no arguments will rebase all of the dll files that were installed from cygwin packages. However you will often have many other dlls from other programs you have built and installed, including from installed Perl modules with XS code, and you will need to tell rebaseall about these modules somehow.

There may be an easier way to do this, and I hope I haven't forgotten any steps, but I think I had some success doing something like this:

  1. Get a list of all the dll's in your system that run under cygwin. Maybe something like find /bin /lib /usr /home -name \*.dll > /tmp/file1
  2. exit all cygwin processes, open as ash or dash shell from a Windows command prompt, and run /bin/rebaseall -v > /tmp/file2. The -v switch sets a Verbose flag in rebase that lists all the files that get rebased with the default setting.
  3. Use /tmp/file1 and /tmp/file2 to create a new file, say /tmp/file3 with the complete list of files you will want to rebase. From what I remember it is important for the system dlls (all the files in /tmp/file2) to be listed first,
  4. Now run rebaseall -v -T /tmp/file3 (in ash, after closing all cygwin procs, etc.). Pay attention to the output. If there are error messages about rebasing some particular dll, remove that entry from /tmp/file3 and try again.

This may not solve your problem, but maybe it will get you most of the way there. If you do eventually figure it out, I hope you will come back and fill in some of the holes in this solution.

mob
  • 117,087
  • 18
  • 149
  • 283
  • Oh my God this is terrible. I've been using Unix systems for years and never run into this problem. Come to that I've never seen it on cygwin before. Your answer makes a lot of sense, but sounds like a complete pain to resolve. Here's another approach to solving it http://code.google.com/p/chromium/wiki/CygwinDllRemappingFailure – Andrew Fielden Aug 01 '11 at 22:20
0

I think it is useful to point out that for most people running into this a simple "rebaseall" without any arguments seems to resolve this issue. I'll post a link to a very useful blog post from My Life, Starting up (I have no relation to that blog):

http://www.mylifestartingup.com/2009/04/fatal-error-unable-to-remap-to-same.html

The action list, (copied directly from the blog) is:

Let me tell you what you can do if you don't care what's actually happening.

1) Close out of Cygwin (and all cygwin processes).

2) Open a Windows command prompt (start -> run - > type 'cmd' or on vista : start -> type 'cmd' in the start search window)

3) Go to your cygwin bin directory. For me it is c:\cygwin\bin.

4) Type ash

5) Type '/usr/bin/rebaseall'

6) Resolve any errors (I had a warning that went unresolved and it still worked fine)

7) Reboot...and you should be good.

And if you DO care what's actually happening, read the blog entry, in addition to the answer by mob here on this same question.

Magnus
  • 23,900
  • 1
  • 30
  • 28
  • This happens every bloody time I install a CPAN module. Perl has become practically unuseable on Cygwin (and I spend a *lot* of time writing Perl scripts). – reinierpost Oct 24 '12 at 12:57