Cygwin fatal error unable to remap.. What does it mean?

30

18

When running python in cygwin, I get the following error:

    0 [main] python 6140 C:\cygwin\bin\python.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\python2.6\lib-dynload\time.dll to same address as parent: 0x2B0000 != 0x360000
Stack trace:
Frame     Function  Args
00288E68  6102749B  (00288E68, 00000000, 00000000, 00000000)
00289158  6102749B  (61177B80, 00008000, 00000000, 61179977)
0028A188  61004AFB  (611A136C, 6124112C, 002B0000, 00360000)
End of stack trace
    0 [main] python 9048 fork: child 6140 - died waiting for dll loading, errno 11
abort: Resource temporarily unavailable

What does it mean, and what should I do to fix it?

Jon Erickson

Posted 2010-09-30T18:51:04.170

Reputation: 2 144

Answers

40

You need to run the rebaseall command from the rebase package to fix the problem.

  1. Install the rebase package using the Cygwin setup.exe utility
  2. Close everything running that uses the cygwin1.dll
  3. Open a Cygwin shell
  4. Type rebaseall at the prompt

Rebasing is usually only required when installed packages are installed that modify libraries that are dynamically loaded. I'll admit a bad habit of always running rebaseall after installing or upgrading packages in a Cygwin install rather than waiting for that error you hit to show up.

As for why you got that error and how rebasing solves the problem, this post has this to say about it:

You have it backwards. Forking doesn't break the relocation. Relocation breaks forking. cygwin1.dll needs to have a very special memory layout to implement the fork semantics in Win32. If this memory layout is disrupted, fork breaks. Relocating cygwin1.dll disrupts the required memory layout. 'rebaseall' does its best to locate all Cygwin DLLs that it knows of into a layout that avoids collisions. This maintains the required memory layout so fork can do its job.

Ian C.

Posted 2010-09-30T18:51:04.170

Reputation: 5 383

1i was trying this and it didn't work... that is until i restarted windows (after a rebaseall and peflagsall) – Jon Erickson – 2010-09-30T20:12:58.210

Ian C: You are my hero! – Stefan Rusek – 2011-02-15T08:30:33.963

Also, rebaseall seems to need Administrator rights on Windows 7. – xtofl – 2011-04-09T12:44:04.743

Sepcifying a base address could in some cases help, as suggested here: http://cygwin.com/ml/cygwin/2011-04/msg00306.html

– lapo – 2011-09-19T06:02:45.360

2You need to do this in ash or dash not through the normal Cygwin Terminal. Launch it with Start -> Run, its in cygwin\usr\bin\ash. Once ash is running, type /usr/bin/rebaseall and hit enter. – Maciej Swic – 2011-12-28T19:03:18.537

I am trying to rebase but bin/ash, bin/ash, bin/dash, and bin/rebase won't start. Is there a solution to this problem? – Giorgio – 2012-03-29T13:53:31.617

I meant bin/bash, bin/ash, bin/dash, and bin/rebase won't start. – Giorgio – 2012-03-29T14:00:27.537

@Giorgio you should ask a new question. – Ian C. – 2012-03-29T15:18:56.910

@Ian C: I did not want to add a new question if it is not needed. I will try to figure out what went wrong and in case I don't find what the problem is I will ask a new question. Thanks a lot. – Giorgio – 2012-03-29T15:32:17.640

10

It means that either a 3rd party program such as a virus scanner or the DLL address randomisation feature that was introduced in Vista have interfered with your process in such a way that it couldn't successfully be forked.

The rebaseall utility can be used to pin down DLLs such that the problem is avoided. It's installed by default. See rebaseall --help on how to use it, and /usr/share/doc/Cygwin/rebase-3.0.1.README for further details. If it doesn't help, peflagsall is another one worth trying.

ak2

Posted 2010-09-30T18:51:04.170

Reputation: 3 387

thanks =) both answers helped me out... but i can only accept one =\ – Jon Erickson – 2010-09-30T20:13:44.833

5

I had the same problem after compiling "numpy". Die affected dll was mtrand.dll. Simple

$ /bin/rebaseall

did not work.

What helped was the following: Examine whether the affected dll (in this case time.dll) is acutally "rebased":

$ /bin/rebaseall -v

If not create a list which contains the full path of the affected dll. E.g.:

$ find /lib -name 'time.dll' > /tmp/mydll.txt

The file may also contain more dlls, one per line. Then, call

$ /bin/rebaseall -v -T /tmp/mydll.txt

with no other cygwin stuff running, as described above. The time.dll should now be rebased (additionally to the "normal" rebaseall).

(Strange: In 10 years of using cygwin with nt, windows2000, xp, I had to "rebase" only once. In one day with (64 bit) window-7 this was already neccessary.)

Sebastian Sohr

Posted 2010-09-30T18:51:04.170

Reputation: 51

2

There is answer for the problem.

Source: https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)


Unable to Remap to Same Address as Parent

fatal error – unable to remap \?\C:\cygwin\lib\python2.6\lib-dynload\time.dll to same address as parent: 0×360000 != 0×3E0000

This is not an issue with node.js either. Install base → rebase using setup.exe first then close all Cygwin instances. Start dash or ash (located in the bin directory under Cygwin's installation) and run:

$ /bin/rebaseall -v

It should finish with no errors. If instead the above results in an error like:

rebaseall:'/cygdrive/c/Users/ADMINI~1/AppData/Local/Temp' is not writable

Open up a Cygwin shell and run:

$ chmod 777 ~/AppData/Local/Temp

Close your shell window and repeat the steps above. Once you are done, restart your PC. Remember to close all open Cygwin shells before using rebaseall.

Tun

Posted 2010-09-30T18:51:04.170

Reputation: 121

It's good practice to copy the information from the link for future users in case the link ever fails. – paradd0x – 2011-06-21T20:18:18.723