Cygwin fatal error unable to remap.. What does it mean?
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?
You need to run the rebaseall
command from the rebase
package to fix the problem.
- Install the
rebase
package using the Cygwinsetup.exe
utility - Close everything running that uses the
cygwin1.dll
- Open a Cygwin shell
- 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.
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.
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.)
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.