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]

Re: 64-bit gdb: invalid decimal " 0x22DBF0"

I have also ran into this problem, in my case though I have managed to reduce the issue down to an fgets call when reading a pipe.
The following code causes the issue for me if I try and debug it:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char** argv) {
    char out[100] = {0};
    FILE *pipe;

    if ((pipe = popen("uname -r", "rt")) == NULL)
        fprintf(stderr,"Failed to execute popen command");

    if(fgets(out, 100, pipe) == NULL)
        fprintf(stderr,"Failed to read popen buffer");

    printf("%s\n", out);


    return (EXIT_SUCCESS);

I compile with `gcc -g main.c` then `gdb a.exe` and type `run`, the error `invalid decimal " 0x23DBF0"` then pops up. I have tried the latest snapshot cygwin1.dll (1.7.23s(0.268/5/3)) and the error is still there.


On 27/07/2013 04:29, Ryan Johnson wrote:
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
invalid decimal " 0x22DBF0"
(gdb) c
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
Cannot execute this command while the selected thread is running.
(gdb) detach
Detaching from program: /home/Ryan/experiments/a.exe, Pid 3536

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.


Problem reports:
Unsubscribe info:

Problem reports:
Unsubscribe info:

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