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: Segmentation fault when debugging C++ with gdb.

On Fri, 16 Jun 2006, Mikael Rosbacke wrote:

> Hello!
> I'm having problem to debug my C++ programs using GDB under cygwin. I
> get a seg-fault in the c-startup before the main function has been
> started.
> [snip]
> Trying to compile and run this program in cygwin give me the following
> result:
> [snip]
> Program received signal SIGSEGV, Segmentation fault.
> 0x610ae938 in pthread_key_create () from /usr/bin/cygwin1.dll
> [snip]
> Seems like the initialization of the static iostream objects causes the
> seg-fault.

Searching this list for "SEGFAULT pthread_key_create" would have shown you
the solution (and all of the information I'm providing below).

> I've tried to download gcc version 4.0 and a new gdb as tarballs and
> compiled it from source. Using these tools it seems to work. But it is
> not a good solution for us to have a separate compiler from the rest of
> the distribution. Any ideas how to fix this?

This is exactly the fix (well, you can use stock gcc, but you *will* need
to build gdb from source).  Until Cygwin 1.5.20 comes out, that's your
ideal course of action.  Once the new Cygwin version is out, the new gdb
should be released that will contain that fix, and you'll be able to
switch to stock gdb as well.
P.S. There was no need to repost this -- we heard you the first time. and are the same machine.
      |\      _,,,---,,_ |
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

Unsubscribe info:
Problem reports:

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