X-Spam-Check-By: sourceware.org Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: SV: Segmentation fault when debugging C++ with gdb. Date: Fri, 16 Jun 2006 15:23:44 +0200 Message-ID: From: "Mikael Rosbacke" To: Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k5GDNfcs021801 Thank you for the answer. Tried searching "cygwin C++ gdb" and variants in Google and mailing lists, but to no use. Sorry for the duplicate email but I got a no-delivery notification for sourceware.org. I'll try to see if I can get a better behaviour with stock gcc and a recently built gdb from source. But since the issue should be resolved with version 1.5.20 I could probably wait for that version. --- Mikael R -----Ursprungligt meddelande----- Från: Igor Peshansky [mailto:pechtcha AT cs DOT nyu DOT edu] Skickat: den 16 juni 2006 15:04 Till: Mikael Rosbacke Kopia: cygwin AT cygwin DOT com Ämne: 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. 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/