X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Message-ID: <855431.45788.qm@web25508.mail.ukl.yahoo.com> Date: Wed, 7 Oct 2009 07:23:48 +0000 (GMT) From: Marco Atzeri Subject: R: Segfault with call to pthread_mutexattr_init under GDB To: cygwin AT cygwin DOT com, Nicholas Sherlock In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: 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 > Da: Nicholas Sherlock=20 > Oggetto: Segfault with call to pthread_mutexattr_init under GDB > A: cygwin cygwin.com > Data: Mercoled=EC 7 ottobre 2009, 08:53 > Hi everyone, >=20 > I'm experiencing a crash while using GDB to debug a C > program that calls pthread_mutexattr_init. I recently > updated Cygwin 1.7 to the latest version, as part of that I > saw my GCC 4 get updated. I don't know if that is the cause > of my recent problem or not, because I have not tried this > testcase in a while. >=20 > If I compile this program: >=20 > #include >=20 > pthread_mutexattr_t RECURSIVE_MUTEX_ATTR; >=20 > int main() { > =A0 =A0 > pthread_mutexattr_init(&RECURSIVE_MUTEX_ATTR); > } >=20 > gcc-4 -o test.exe test.c >=20 > And run it: >=20 > ./test.exe >=20 > It seems to run successfully. As expected, nothing is > printed to the screen and the program immediately > terminates. But now if I try to debug it, I get this error: >=20 > $ gdb test.exe > GNU gdb 6.6 > Copyright (C) 2006 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public > License, and you are welcome to change it and/or distribute > copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB.=A0 Type "show > warranty" for details. > This GDB was configured as "i686-pc-mingw32"... > (gdb) run > Starting program: D:\CL/test.exe > Error: dll starting at 0x77541000 not found. > Error: dll starting at 0x76e41000 not found. > Error: dll starting at 0x77541000 not found. > Error: dll starting at 0x77661000 not found. > Loaded symbols for C:\Windows\system32\ntdll.dll > Loaded symbols for C:\Windows\syswow64\kernel32.dll > Loaded symbols for C:\Windows\syswow64\KernelBase.dll > Loaded symbols for D:\cygwin1.7\bin\cygwin1.dll > Loaded symbols for C:\Windows\syswow64\advapi32.dll > Loaded symbols for C:\Windows\syswow64\msvcrt.dll > Loaded symbols for C:\Windows\SysWOW64\sechost.dll > Loaded symbols for C:\Windows\syswow64\rpcrt4.dll > Loaded symbols for C:\Windows\syswow64\sspicli.dll > Loaded symbols for C:\Windows\syswow64\cryptbase.dll > Loaded symbols for D:\cygwin1.7\bin\cyggcc_s-1.dll >=20 > Program received signal SIGSEGV, Segmentation fault. > 0x610d280d in _ZL25verifyable_object_isvalidPKvlPvS1_S1_ > () > =A0=A0=A0from D:\cygwin1.7\bin\cygwin1.dll > (gdb) where > #0=A0 0x610d280d in > _ZL25verifyable_object_isvalidPKvlPvS1_S1_ () > =A0=A0=A0from D:\cygwin1.7\bin\cygwin1.dll > #1=A0 0x610d699a in pthread_mutexattr_init () from > D:\cygwin1.7\bin\cygwin1.dll > #2=A0 0x610b4338 in _sigfe () from > D:\cygwin1.7\bin\cygwin1.dll > #3=A0 0x00000000 in ?? () >=20 > I can successfully debug the program if it does not call > pthread_mutexattr_init(). My cygcheck output is attached. >=20 > Cheers, > Nicholas Sherlock >=20 Have you tried the cygwin gbd ? $ gcc-4 -o prova prova.c $ gdb prova.exe GNU gdb 6.8.0.20080328-cvs (cygwin-special) Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-cygwin"... (gdb) run Starting program: /tmp/prova/prova.exe [New thread 12400.0x3f88] [New thread 12400.0x31b8] [New thread 12400.0x25a8] [New thread 12400.0x4744] [New thread 12400.0x45d4] Program exited normally. (gdb) Marco -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple