gcc + gdb + breakpoint => SIGSEGV

2008-03-02 Thread Dave Ohlsson

Hi,

I have a problem when trying to use gdb with a program compiled with gcc in 
Cygwin.

I compile this program:


int main(int argc, char** argv)
{
return 0;
}


with this command:

gcc -g main.c

and I get this file:

9757 Mar  1 21:27 a.exe

I then start gdb:

gdb a.exe

and running the program in gdb works:

(gdb) run
Starting program: /c/TEMP/a.exe
Loaded symbols for /c/WINNT/system32/ntdll.dll
Loaded symbols for /c/WINNT/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /c/WINNT/system32/advapi32.dll
Loaded symbols for /c/WINNT/system32/rpcrt4.dll
Loaded symbols for /c/WINNT/system32/secur32.dll

Program exited normally.

but doing the same with a breakpoint yields SIGSEGV:

gdb a.exe
(gdb) list
1   int main(int argc, char** argv)
2   {
3   return 0;
4   }
(gdb) break 3
Breakpoint 1 at 0x40107a: file main.c, line 3.
(gdb) run
Starting program: /c/TEMP/a.exe
Loaded symbols for /c/WINNT/system32/ntdll.dll
Loaded symbols for /c/WINNT/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /c/WINNT/system32/advapi32.dll
Loaded symbols for /c/WINNT/system32/rpcrt4.dll
Loaded symbols for /c/WINNT/system32/secur32.dll

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 44692.0xaea4]
0x005c004d in ?? ()
(gdb)

What could be wrong?

I have completely uninstalled, then reinstalled Cygwin, without help.

-- dave

The versions I use
--
`gcc -v' yields:


Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/
configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --
infodir=/usr/share/info --enable-languages=c,ada,c+
+,d,f77,pascal,java,objc --enable-nls --without-included-gettext --
enable-version-specific-runtime-libs --without-x --enable-libgcj --
disable-java-awt --with-system-zlib --enable-interpreter --disable-
libgcj-debug --enable-threads=posix --enable-java-gc=boehm --disable-
win32-registry --enable-sjlj-exceptions --enable-hash-synchronization
--enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)


When starting gdb, I get:


GNU gdb 6.5.50.20060706-cvs (cygwin-special)
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-cygwin".

_
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008

--
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/



[ANNOUNCEMENT] Updated: [experimental] cygwin-1.5.25-10

2008-03-02 Thread Corinna Vinschen
I've uploaded another test version of the Cygwin DLL and its utilities,
version 1.5.25-10. 

The main purpose of this update is to allow Cygwin to run correctly on
Windows 2008 Server.  A change in the exception handling in Windows 2008
Server requires to change the exception handling in the Cygwin DLL as
well, otherwise an exception in a Cygwin process results in an endless
loop in the OS, taking 100% CPU.  I reported this problem upstream.

News: The problem has been confirmed to be a missing check in one of
the OS DLLs.

Apart from that, this new release contains a couple of additional fixes
which cropped up in the last two months.

Please give it a test. 

The official release will be delayed for a couple of days.  A patch
to fflush/ftell sent to the newlib list looks serious enough to be
considered for inclusion into 1.5.25.

Changes since version 1.5.25-9:

- Another change in exception handling.

Changes since version 1.5.25-8:

- Revert to the former Linux-like behaviour in exception handling.

Changes since version 1.5.25-7:

- Allow cygcheck to run on Windows 9x again.

- Fix testing for Samba shares to use more reliable test available with
  upcoming versions of Samba (3.0.28a, 3.2.0).

- Change exception handling to run under Windows 2008 Server.

- Fix a crash when creating stackdumps on Windows XP x64 Edition and
  Windows 2003 Server x64 Edition.

- Fix pthread_kill to deal with signal 0 as per POSIX.

- Fix ambiguity in thread signal mask handling.

- Try harder to make a pipe into a full-cygwin device.

- Fix strtod to handle incomplete hex strings correctly.


To update your installation, click on the "Install Cygwin now" link on
the http://cygwin.com/ web page.  This downloads setup.exe to your
system.  Save it and run setup, answer the questions, then look for
'cygwin' in the 'Base' category (it should already be selected).  You
will need to use the 'Exp' radio button to get the test version.

If you have questions or comments, please send them to the Cygwin
mailing list.  See http://cygwin.com/lists.html for details.

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there.  It will be in the format:

[EMAIL PROTECTED]

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that is available
starting at this URL.

Corinna Vinschen
Red Hat

--
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/



Re: [ANNOUNCEMENT] Updated: [experimental] cygwin-1.5.25-10

2008-03-02 Thread Troy Bull
On Sun, Mar 2, 2008 at 6:49 AM, Corinna Vinschen
<[EMAIL PROTECTED]> wrote:
> I've uploaded another test version of the Cygwin DLL and its utilities,
>  version 1.5.25-10.


What mirror should i point my setup.exe at to get the latest updates?
Right now my mirror says aht -9 is the newest..  As I run this on
Server 08 I am interested in having the latest version.

Thanks
Troy

--
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/



Re: [ANNOUNCEMENT] Updated: [experimental] cygwin-1.5.25-10

2008-03-02 Thread Larry Hall (Cygwin)

Troy Bull wrote:

On Sun, Mar 2, 2008 at 6:49 AM, Corinna Vinschen
<[EMAIL PROTECTED]> wrote:

I've uploaded another test version of the Cygwin DLL and its utilities,
 version 1.5.25-10.



What mirror should i point my setup.exe at to get the latest updates?
Right now my mirror says aht -9 is the newest..  As I run this on
Server 08 I am interested in having the latest version.


Make sure you've switched to "Exp" not "Curr" in 'setup.exe'.  If you have
done this and still don't see -10, either try other mirrors or wait a while
until -10 propagates to your favorite mirror.

--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
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/



RE: [ANNOUNCEMENT] Updated: [experimental] cygwin-1.5.25-10

2008-03-02 Thread Karl M

Hi All...
 
I just tried 1.5.25-10 on a fairly vanilla XP with ssh/sshd installed.
 
ssh localhost
 
hangs. Reverting to current restores normal operation. If it is not readilly 
reproducible, I will dig further.
 
Thanks,
 
...Karl

> Date: Sun, 2 Mar 2008 16:50:21 -0500
> From: [EMAIL PROTECTED]
> To: cygwin@cygwin.com
> Subject: Re: [ANNOUNCEMENT] Updated: [experimental] cygwin-1.5.25-10
>
> Troy Bull wrote:
>> On Sun, Mar 2, 2008 at 6:49 AM, Corinna Vinschen
>>  wrote:
>>> I've uploaded another test version of the Cygwin DLL and its utilities,
>>> version 1.5.25-10.
>>
>>
>> What mirror should i point my setup.exe at to get the latest updates?
>> Right now my mirror says aht -9 is the newest.. As I run this on
>> Server 08 I am interested in having the latest version.
>
> Make sure you've switched to "Exp" not "Curr" in 'setup.exe'. If you have
> done this and still don't see -10, either try other mirrors or wait a while
> until -10 propagates to your favorite mirror.
>
> --
> Larry Hall http://www.rfk.com
> RFK Partners, Inc. (508) 893-9779 - RFK Office
> 216 Dalton Rd. (508) 893-9889 - FAX
> Holliston, MA 01746
>
> _
>
> A: Yes.
>> Q: Are you sure?
>>> A: Because it reverses the logical flow of conversation.
 Q: Why is top posting annoying in email?
>
> --
> 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/
>

_
Helping your favorite cause is as easy as instant messaging. You IM, we give.
http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join

--
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/



Re: gcc + gdb + breakpoint => SIGSEGV

2008-03-02 Thread Ray Hurst

I had the same issue a couple of weeks ago.
I never figured it out.

I ended up updating the compiler to v4.2.3 then I updated gdb to v6.7.1.
Everything started working.

You might try just updating gdb and see what happens.

The issue was only with cygwin. The same versions you have below ran 
under linux just find.

Ray


Dave Ohlsson wrote:

Hi,

I have a problem when trying to use gdb with a program compiled with gcc in 
Cygwin.

I compile this program:


int main(int argc, char** argv)

{
return 0;
}



with this command:

gcc -g main.c

and I get this file:

9757 Mar  1 21:27 a.exe

I then start gdb:

gdb a.exe

and running the program in gdb works:

(gdb) run
Starting program: /c/TEMP/a.exe
Loaded symbols for /c/WINNT/system32/ntdll.dll
Loaded symbols for /c/WINNT/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /c/WINNT/system32/advapi32.dll
Loaded symbols for /c/WINNT/system32/rpcrt4.dll
Loaded symbols for /c/WINNT/system32/secur32.dll

Program exited normally.

but doing the same with a breakpoint yields SIGSEGV:

gdb a.exe
(gdb) list
1   int main(int argc, char** argv)
2   {
3   return 0;
4   }
(gdb) break 3
Breakpoint 1 at 0x40107a: file main.c, line 3.
(gdb) run
Starting program: /c/TEMP/a.exe
Loaded symbols for /c/WINNT/system32/ntdll.dll
Loaded symbols for /c/WINNT/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /c/WINNT/system32/advapi32.dll
Loaded symbols for /c/WINNT/system32/rpcrt4.dll
Loaded symbols for /c/WINNT/system32/secur32.dll

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 44692.0xaea4]
0x005c004d in ?? ()
(gdb)

What could be wrong?

I have completely uninstalled, then reinstalled Cygwin, without help.

-- dave

The versions I use
--
`gcc -v' yields:


Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/
configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --
infodir=/usr/share/info --enable-languages=c,ada,c+
+,d,f77,pascal,java,objc --enable-nls --without-included-gettext --
enable-version-specific-runtime-libs --without-x --enable-libgcj --
disable-java-awt --with-system-zlib --enable-interpreter --disable-
libgcj-debug --enable-threads=posix --enable-java-gc=boehm --disable-
win32-registry --enable-sjlj-exceptions --enable-hash-synchronization
--enable-libstdcxx-debug
Thread model: posix
gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)


When starting gdb, I get:


GNU gdb 6.5.50.20060706-cvs (cygwin-special)
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-cygwin".

_
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008




--
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/