delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/06/16/09:04:00

X-Spam-Check-By: sourceware.org
Date: Fri, 16 Jun 2006 09:03:41 -0400 (EDT)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Mikael Rosbacke <Mikael DOT Rosbacke AT tritech DOT se>
cc: cygwin AT cygwin DOT com
Subject: Re: Segmentation fault when debugging C++ with gdb.
In-Reply-To: <EB9F423ED26F2747947B3CEE6241B6D5B181EB@srvsund01.tritech.se>
Message-ID: <Pine.GSO.4.63.0606160859320.715@access1.cims.nyu.edu>
References: <EB9F423ED26F2747947B3CEE6241B6D5B181EB AT srvsund01 DOT tritech DOT se>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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.
	Igor
P.S. There was no need to repost this -- we heard you the first time.
cygwin.com and sourceware.org are the same machine.
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
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:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019