64-bit gdb: invalid decimal " 0x22DBF0"

Ryan Johnson ryan.johnson@cs.utoronto.ca
Sat Jul 27 04:21:00 GMT 2013

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.


-------------- next part --------------
#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;

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