X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:message-id:date:from:mime-version:to:subject
	:content-type; q=dns; s=default; b=Wxy128RsPBq0mbMXlyZDJGalrmZy2
	grho2OC81KTPjcQWxtfS6g5Ix8PkTbJEUqnQpb8W8c76YXcM1026D++8AEewBu4p
	oGMfbk7livk5fgqSsX9vrvt/XpCS61/600jxH7VhOJ3DUZSL1UdCBqoUjwxmPkgo
	AH1YWywitqTxAU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:message-id:date:from:mime-version:to:subject
	:content-type; s=default; bh=uR7wNrQD3sffZcLlSTQ/VWecpc8=; b=wNZ
	kXVK6ov1UaPBBMD4KG59gDP4lp+3uNzNlU4/OMKF/W5xxW3geXVjvnd2Wv4cZadK
	aVEpsUMfbQ7nCtp6Iueqvl+fps730X1MS7gIy2KU8aJzlsbn3J4aOA/fcSgCDqzP
	My/xjqUCvXHqPhsONRf9R4opViN2hOd/yK/vPAxo=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_NO,RDNS_NONE,SPF_NEUTRAL autolearn=no version=3.3.1
Message-ID: <51F33E9D.9030703@cs.utoronto.ca>
Date: Fri, 26 Jul 2013 23:29:33 -0400
From: Ryan Johnson <ryan.johnson@cs.utoronto.ca>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
MIME-Version: 1.0
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: 64-bit gdb: invalid decimal " 0x22DBF0"
Content-Type: multipart/mixed; boundary="------------030509040001010506020803"
X-Virus-Found: No

--------------030509040001010506020803
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi all,

The latest 64-bit gdb/cygwin combo chokes whenever a process it has 
attached to is backgrounded (and also if it blocks on I/O, I think). To 
repro with the attached STC:

1. gcc -g bug.c && ./a
<prints its PID>
2. gdb -p <PID>
3. Continue gdb
4. ^Z the STC
5. STC freezes, gdb gets confused.

An example gdb session is below. Note that, in spite of gdb thinking the 
threads are all running, the victim is actually frozen; once this 
happens, the only option is to detach from the process.
> (gdb) attach 2468
> Attaching to program `/home/Ryan/experiments/a.exe', process 3536
> [New Thread 3536.0x1134]
> [New Thread 3536.0x1284]
> [New Thread 3536.0x13e4]
> Reading symbols from /home/Ryan/experiments/a.exe...done.
> (gdb) c
> Continuing.
> invalid decimal " 0x22DBF0"
> (gdb) c
> Continuing.
> Cannot execute this command without a live selected thread.
> (gdb) i th
>   Id   Target Id         Frame
>   2    Thread 3536.0x1284 (running)
>   1    Thread 3536.0x1134 (running)
>
> The current thread <Thread ID 3> has terminated.  See `help thread'.
> (gdb) t 1
> [Switching to thread 1 (Thread 3536.0x1134)](running)
> (gdb) c
> Continuing.
> Cannot execute this command while the selected thread is running.
> (gdb) detach
> Detaching from program: /home/Ryan/experiments/a.exe, Pid 3536
> (gdb)

I first discovered this trying to debug emacs, where I/O and perhaps 
other events sometimes also cause the same "invalid decimal" to pop up 
and freeze the program. I'm not sure how to repro those other cases, tho.

Thoughts?
Ryan


--------------030509040001010506020803
Content-Type: text/plain; charset=windows-1252;
 name="bug.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="bug.c"

#include <stdio.h>
#include <unistd.h>

int main() {
    int c;
    printf("pid: %d\n", getpid());
    while ( (c=getchar()) > 0 ) 
        printf("Received \\%03o\n", c);
    return 0;
}


--------------030509040001010506020803
Content-Type: text/plain; charset=us-ascii

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