delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/10/07/03:24:01

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 <marco_atzeri AT yahoo DOT it>
Subject: R: Segfault with call to pthread_mutexattr_init under GDB
To: cygwin AT cygwin DOT com, Nicholas Sherlock <n DOT sherlock AT gmail DOT com>
In-Reply-To: <hahdsr$lvh$1@ger.gmane.org>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <pthread.h>
>=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 <http://gnu.org/licenses/gpl.htm=
l>
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019