delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/07/27/06:30:38

X-Recipient: archive-cygwin AT delorie DOT 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
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=C+J/gtlsnf4aGUvpKB7w/2k4XHYUhO/6d2hxEh2MHK8
gAt5VqOqdifaFYTctUzIxfIA1fnY0+PdSGhedHbJO6VKCZYOSofVRxIUprMzQLlp
FzZNHnTNLRUDfs6wVKi3WaVpq1NkxRd/77l00p10Z//evpVBxU46pK693Rjiu6yM
=
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
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=oJJClr06nTFNP5JK8AHwt0XWazg=; b=UpO8lKcAPZS/pLIrQ
Gd1Dvddmd/OPJ1QjKiFaSXnYpG4aC9Uw4vD6H0O+QnqZfNjuoST9ZaPTSmoThUxq
9GFFWc8qfIazhQm11MWPBokNXUsE7kWz6BR0YKIbXi0qj13Nn3AKfqHz5gyPLC5S
y9zorb+LnUQld2vCEvIPPWBaTM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_MED,RCVD_IN_HOSTKARMA_W,RDNS_NONE autolearn=ham version=3.3.1
Message-ID: <51F3A133.8090805@star.sr.bham.ac.uk>
Date: Sat, 27 Jul 2013 11:30:11 +0100
From: Daniel Brown <ddb AT star DOT sr DOT bham DOT ac DOT uk>
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: 64-bit gdb: invalid decimal " 0x22DBF0"
References: <51F33E9D DOT 9030703 AT cs DOT utoronto DOT ca>
In-Reply-To: <51F33E9D.9030703@cs.utoronto.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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019