delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/10/22/22:37:25

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <32703871.post@talk.nabble.com>
Date: Sat, 22 Oct 2011 19:37:02 -0700 (PDT)
From: "jan.kolar" <kolar AT math DOT cas DOT cz>
To: cygwin AT cygwin DOT com
Subject: Re: gdb problem
In-Reply-To: <4EA329A3.30800@cornell.edu>
MIME-Version: 1.0
References: <4EA329A3 DOT 30800 AT cornell DOT edu>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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


Difference with Linux might be matter of timing. (Or, might gdb version).

The problem is that gdb calls poll() while it has (all) data already in libc
buffers.
It also calls fileno() and isatty() arround that time.
(Also {m,c,re}alloc, free, pthread_sigmask, vsprints)

Gdb first calls poll() with timeout=0 and if there are no data on fd=0, 
it calls again poll() with timeout=-1. 
I verified the both calls come directly from gdb.exe, from the same address
(0x00456a8f when gdb is at 00400000-00892000 - gdb 7.3.50-1)

Is there in gdb's source visible, that a bad combination of fgetc (on
buffered stream)
and poll (on fd - unbuffered) ? 

JK

--
This was usefull:
break fgetc
break __srget_r         (  __sread        __srget_r     _read_r     read )
watch ((FILE *) 0x6116f370) -> _p
#  where the addres is    p fp         from  __srget_r()
break *(_sigbe+69)
break *(_sigfe+75)
break poll
break cygwin_select


-- 
View this message in context: http://old.nabble.com/gdb-problem-tp32702884p32703871.html
Sent from the Cygwin list mailing list archive at Nabble.com.


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