This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

R: Segfault with call to pthread_mutexattr_init under GDB

> Da: Nicholas Sherlock 
> Oggetto: Segfault with call to pthread_mutexattr_init under GDB
> A: cygwin
> Data: Mercoledì 7 ottobre 2009, 08:53
> 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

Have you tried the cygwin gbd ?

$ gcc-4 -o prova prova.c

$ gdb prova.exe
GNU gdb (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.


Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]