This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin bash crashes on Win Serv 2008


On Oct 23 17:52, Dave Korn wrote:
> Corinna Vinschen wrote on 23 October 2008 17:21:
> >     Attempt to execute non-executable address 00419d97
> > 
> > Huh?  Why should this address (this application function) be
> > "non-executable", while it's executable when TS is not installed?
> 
>   DEP?  ASLR?  SafeSEH?  As well as "dg" there are some other commands in
> windbg that'll show you memory types and attributes.

Huh!  It was DEP.  Apparently when installing TS, the default setting
for DEP is switched from "Turn on DEP for essential Windows programs
and services only" to "Turn on DEP for all programs and services
[with execptions]".  I switched it back, rebooted, and now bash, grep
and GDB work fine.

However, I don't understand why this happens.  The address in question
(419d97) is well within the .text segment:

  .text    401000 -> 46a510
  .data    46b000 -> 46d380

As for ASLR and SafeSEH, both functions are, afaik, only enabled if you
set a flag in the Windows specifc extended PE/COFF header.

And there's something else I don't get.  DEP is usually no problem when
running apps from the Cygwin net distro.  And if I enable DEP but TS
is not installed, bash and friends run fine.  Only the combination of
TS *and* DEP results in a crash.  If I exclude bash.exe explicitly, no
crash in bash.  Unfortunately it's not possible to exclude cygwin1.dll
and then all Cygwin apps magically work.

> > Could this have something to do with the executbale header gcc creates?
> 
>   Dunno - which executable header?  Seems unlikely since we're in a completely
> different memory page and well beyond the header area into the .text segment.

I mean the flags you can set in the extended PE/COFF header.

>   (Actually, are we in the .text segment, or is there a thunk of some kind in
> .rdata?  And is the difference perhaps related to the use-or-not, or the
> need-for-or-not, of ld's --{en,dis}able-runtime-pseudo-reloc options?)

There is a .rdata, but the function address is in .text and it has
been called by a simple call instruction from main(), also well within
the .text segment.

Thanks for the DEP hint.  So that's the (temporary?) solution for now,
don't enforce DEP on Cygwin apps when TS is installed.  But it's still
unclear to me why TS plus DEP would have an effect on an innocent
application like bash at all.


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]