This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: 64-bit gdb: invalid decimal " 0x22DBF0"
- From: Daniel Brown <ddb at star dot sr dot bham dot ac dot uk>
- To: cygwin at cygwin dot com
- Date: Sat, 27 Jul 2013 11:30:11 +0100
- Subject: Re: 64-bit gdb: invalid decimal " 0x22DBF0"
- References: <51F33E9D dot 9030703 at cs dot utoronto dot ca>
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);
pclose(pipe);
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.
Thanks,
Daniel
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
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
--
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
--
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