Segfault with call to pthread_mutexattr_init under GDB
Nicholas Sherlock
n.sherlock@gmail.com
Wed Oct 7 06:54:00 GMT 2009
Hi everyone,
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.
If I compile this program:
#include <pthread.h>
pthread_mutexattr_t RECURSIVE_MUTEX_ATTR;
int main() {
pthread_mutexattr_init(&RECURSIVE_MUTEX_ATTR);
}
gcc-4 -o test.exe test.c
And run it:
./test.exe
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:
$ 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. 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
Program received signal SIGSEGV, Segmentation fault.
0x610d280d in _ZL25verifyable_object_isvalidPKvlPvS1_S1_ ()
from D:\cygwin1.7\bin\cygwin1.dll
(gdb) where
#0 0x610d280d in _ZL25verifyable_object_isvalidPKvlPvS1_S1_ ()
from D:\cygwin1.7\bin\cygwin1.dll
#1 0x610d699a in pthread_mutexattr_init () from
D:\cygwin1.7\bin\cygwin1.dll
#2 0x610b4338 in _sigfe () from D:\cygwin1.7\bin\cygwin1.dll
#3 0x00000000 in ?? ()
I can successfully debug the program if it does not call
pthread_mutexattr_init(). My cygcheck output is attached.
Cheers,
Nicholas Sherlock
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20091007/83fb8905/attachment.ksh>
-------------- next part --------------
--
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
More information about the Cygwin
mailing list