ASLR sometimes stops working on Vista with 1.7? [was: Re: Cygwin 1.7 release (was ...)]

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Jun 5 12:09:00 GMT 2009


On Jun  4 19:49, Yaakov S wrote:
> On 04/06/2009 14:28, Yaakov (Cygwin/X) wrote:
>> I'm having similar problems with Avast 4.8 Home Edition on Windows 7 RC
>> x64 with cygwin-1.7. I never had a problem with this A/V on XP with 1.5
>> or 1.7. This continues even after rebaseall and peflagsall. I have yet
>> to try removing Avast.
>
> OK, I've uninstalled Avast, disabled Windows Firewall and Defender, ran  
> rebaseall and peflagsall (tried ASLR on and off), and I still the same  
> errors.  I can't even bootstrap cygport now, it's so bad.

I can reproduce the "unable to remap" on W7RC by running `cygport
automake1.11-1.11-10 compile'.  The culprit in my case is always the
same DLL, a run-time loaded perl DLL called Cwd.dll.  Even after
rebaseall, it still doesn't work because the Windows Loader tries to
load the DLL into an entirely different address.

When examining the memory layout of the parent, it stands out that
Cwd.dll was already loaded into another address than the DLLs base
address.  The base addr of Cwd.dll is 0x6ee00000, the end address would
be 0x6ee08000.  There's no other DLL in this memory area according to
the memory map.  Nevertheless the DLL has been loaded into the rather
low address 0xa00000 in the parent.  When trying to map this DLL into
the same address in the child, it fails.

When I rebase Cwd.dll to some other address like 0x65000000, then it
works for me.

Probably the memory at 0x6ee00000 is actually used by some Windows DLL
at that time.  The fact that the DLL got rebased already in the parent
is not exactly surprising, just very annoying.

I don't think that this has anything to do with ASLR.  It's not the way
ASLR is documented to work.  Setting or resetting the ASLR flag should
have no effect from all I can tell.  If anything, setting the ASLR
flag in the executable should make things worse in case of fork().

This is entirely the good old fork() problem trying to get the memory
layout of the child into the same shape as in the parent.

This is really a bad problem since it seem to have gotten even worse
with W7.  I think I'm going to ask MSFT if there's any workaround for
this problem.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list