Still can't run XServer or any apps that require it

Ryan Johnson
Sat May 7 11:51:00 GMT 2011

On 2:59 PM, Jon TURNEY wrote:
> Looking into this a bit more, it's not quite clear what's going on here:
> There's a few failure modes which can be reported as "XKB: Could not invoke
> xkbcomp", but the assumption that this is a fork() failure seems likely, given
> that the problem can be made to go away by rebasing.
> But I think that, at the point which fork() is invoked, XWin hasn't loaded any
> DLLs yet, so the fork() failure shouldn't be due to an inability to remap DLLs
> in the child to the same address as the parent.
The address space layout randomization feature as implemented in 
Win7-x64 (and probably Vista/x86 as well) means that *any* dll can fail 
to map to the same address as its parent. Often it's the parent that's 
messed up, which means no subsequent fork() is likely to succeed.

That's why the problem comes in spurts: if you get a good parent, where 
nothing got pushed around the wrong way, fork() will eventually succeed 
thanks to Win7's feature which restarts crashed processes automatically 
(essentially retrying the fork until a "good" child arrives). If you get 
a bad parent, though, the chances of getting a compatibly bad child are 
pretty low. I see this a lot in emacs; Windows usually gives up after 
5-6 crashes in a row.

Enabling the tsaware bit for every dll should also help (see docs for 
peflagsall), because Windows will at least do its best to not clobber 
any dll with any other dll, but it still doesn't prevent a random thread 
stack or heap placement from pushing a dll out of its way.

>>>>> [1]
>>>> Also, I've found that using a different base address with rebaseall
>>>> seems to help with some X problems:
>>>> dash -c "rebaseall -b 0x77000000"
>>> Ok, that appears to have fixed my problem. Is that a "permanent" fix?
>> For now, yes. ;-)
> Humour-impaired persons, please note smiley
AFAICT, that's actually a 100% accurate description of rebaseall. The 
"fix"will last until the next time Windows hands you a badly laid-out 
parent process (transient problem, just restart the parent), or until 
the next run of cygwin setup replaces rebased dlls with 
newer-but-not-rebased versions (permanent, have to re-rebaseall).


Unsubscribe info:
Problem reports:

More information about the Cygwin-xfree mailing list