The startup instruction booklet, powered by my life (and other things I think about).
Tuesday, April 21, 2009
*** fatal error - unable to remap to same address as parent : Cygwin, Ruby on Rails, System calls
I was trying to run system commands from the Ruby console in my Cygwin environment today (since that's part of how I'm integrating with Python). I was running into a helluva problem. I was getting a fatal error, unable to remap .dll to same address as parent. It took a while to track this down and even longer to actually figure out what is happening.
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.
So what actually is happening? Well, in this case, the problem was a result of the way windows manages their .dll's. Windows uses ASLR (address space layout randomization) to manage its .dll's. It loads your dll's into different areas of memory every time you boot your computer. If this gets out of whack then the next time you look for that .dll - you can crash your system. Or if you look in the wrong place, you can crash your system. So how can this system get out of whack? Well, running your cygwin setup program can affect record keeping, especially if the ASLR has changed but Cygwin is holding on to an older copy (this can happen when setup doesn't complete).
ASLR is great for malware or hacker defense. Hackers can't constantly try new addresses for your .dll's without crashing your system.
Subscribe to:
Post Comments (Atom)
37 comments:
This post helped me out - thanks! I was getting the same error running "git svn" on Cygwin under Vista, and found this via Google. The fix worked and the explanation was useful.
Thanks, this helped me out! I was having a problem with svn.
This eliminates that problem, but now Emacs won't start.
Thanks! I also had problems with svn in cygwin, and doing this fixed it. In my case however, it took 2 reboots to fix all problems though.
Thank you! Your post saved me a good half hour of screwing around with the cygwin installer again.
Having run into this before I'm certain I will see it again.
Again, great info!
P.S. Didn't take a reboot to address my issue -- well... so far anyway :)
thx man!
Worked perfectly... but I hope I don't have to do this often! Got this 30 minutes after my first cygwin install :(
worked perfectly thanks, life saver.
This looked really good until I ran it and got:
$ /usr/bin/rebaseall
ReBaseImage (/usr/lib/perl5/5.10/i686-cygwin/auto/Compress/Raw/Bzip2.dll)
failed with last error = 6
I don't have a clue what I need to do to resolve this.
I've got the same problem as Scott, has anyone got a solution for this?
It worked! Thank you very much!
Thanks! This solved my problem running a django tutorial using Cygwin.
Thanks! This helped me get a working Python2.6 install in Cygwin.
Thanks! That completely fixed my issue.
Outstanding, thanks. Needed these steps to get python installed.
Thanks a lot! Your article helped to resolve the problem.
Max
Just to add to the +1s - yes, this works.
I also noticed that if your TMP variable points to a directory that doesn't exist or can't be written to that creates a problem.
Just type in TMP= at the prompt to solve this.
Thanks! Solved a problem with python!
This was a big help. Thanks!
Thanks a lot. I have tried to solve the problem for a hour already :)
I'm getting the same error with the WLMP 1.4.28-1 package. I tried the rebaseall, and it seemed to complete successfully (returned me to the prompt with no errors), then rebooted twice. Still getting the same remap error. If I run lighttpd with the -D parameter it does not produce this error and the server runs smoothly, but that isn't really a solution. Are there further steps I can take to troubleshoot this?
Thank you sir, you are a true gentleman.
I second that. Much obliged Sir!
You are a god among men, sir.
This saved our asses today; thanks a lot!
Thanks!
Wow, this fixed my issue like magic!!!
THANKS!!!
I saw this error the very first time I ran my script, but never seen it again
cygwin warning:
MS-DOS style path detected: %CommonProgramFiles%\System\ado\msado20.tlb
Preferred POSIX equivalent is: %CommonProgramFiles%/System/ado/msado20.tlb
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
@Scott with that Bzip2.dll it probably needs to have write permissions. I fix min by chmod 755 on the file. Exit shell, rebaseall again, now change Zlib.dll, etc.
thanks a lot, very helpful. clicked a few of your ads.
Great man ! Thanks a lot for this article.
Nice post but what happens when, while trying 'rebaseall' you get all dll files giving errors stating "skipped because not writable"? My problem is I really have no admin access at all.
Thanks a ton, very helpful to explain what's going on as well as the fix.
The first several times I tried this, I got "rebaseall: only ash or dash processes are allowed during rebasing", even though I thought I'd stopped everything. I finally discovered I could use "./ps" to list the Cygwin processes, which included one bash process besides the ash I knew about. I don't know where it was - I could find no such window. kill failed. But the Windows task manager let me kill it. Then rebaseall worked.
Sweeet, thanks! Massive help :)
Thanks for the info... fixed my issue with Cygwin, Ruby and Rake.
thank you for taking the time to post this info. this made all the difference.
Can we automate this using shell script ? I need help to automate cygwin rebasing if anyone have any idea or script that would be greatly appreciated
Great solution! Thanks!
Post a Comment