X-Spam-Check-By: sourceware.org Date: Fri, 16 Jun 2006 09:03:41 -0400 (EDT) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: Mikael Rosbacke cc: cygwin AT cygwin DOT com Subject: Re: Segmentation fault when debugging C++ with gdb. In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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/