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: [BUG] Nasty bug persists on x86-64

On Sep  2 11:06, Pavel Fedin wrote:
>  Hello Corinna!
> > Try `bt' at this point.  Maybe the backtrace shows something of
> > interest.
>  You haven't read the message completely. 'bt' cannot help since
>  there's no debug information for ntdll and gdb is unable to unwind
>  the stack correctly.
> > Apart from that, try the latest snapshot from
> >  I converted the internal exception
> > handling avoiding crashes from system functions to SEH.  Perhaps the
> > above doesn't show up with it.
>  I have installed the snapshot, and looks like it's now stable.
>  However, this exception actually persists. I can tell you some more
>  details. The actual malfunction happens when this exception fires
>  twice in a row. I managed to catch this with strace a couple of
>  times, but didn't save logs unfortunately.
>  I want to try to bisect for the origin of this crash. Currently i
>  know that it happens before main(). But is main() a real entry point
>  ? I believe it's not. Can you tell me what is the real binary's entry
>  point in Cygwin ?

There are three entry points:

-, function dll_entry(), is called when the Cygwin DLL gets
  initialized.  This in turn calls dll_crt0_0() in which the real
  action goes on.  This function runs to completion right before your
  exception, visible by the preceeding debug output
    finished dll_crt0_0 initialization

- mainCRTStartup() in crt0.c, linked into the executable, is the "real"
  entry point.  From there it calls cygwin_crt0() in the statically
  linked part of libcygwin.a, which calls _dll_crt0() in
  _dll_crt0 is now part of the DLL.  It performs some basic
  initialization and then calls (indirectly via _cygtls::call) the
  function dll_crt0_1 in  This is where the second part of the
  real action starts.  From here it eventually calls the application's
  main entry point.

- DllMain in lib/dll_entry.c, using the DECLARE_CYGWIN_DLL macro from
  include/cygwin/cygwin_dll.h is the entry point for all cygwin-built
  DLLs.  Basically it calls cygwin_attach_dll in lib/cygwin_attach_dll.c,
  which calls dll_dllcrt0 in, which calls dll_dllcrt0_1 in  This function initializes the datastructures for
  bookkeeping DLLs linked to or loaded by the application.

>  Yesterday in the evening i replied from home with some more
>  information, but my reply got lost again :(

Raw email address in your SIG again, perhaps?


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpO56EcFRkqQ.pgp
Description: PGP signature

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