From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7399 invoked by alias); 7 Dec 2001 00:37:45 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 7357 invoked from network); 7 Dec 2001 00:37:43 -0000 Received: from unknown (HELO nic.osagesoftware.com) (65.186.161.49) by sources.redhat.com with SMTP; 7 Dec 2001 00:37:43 -0000 Received: from maple.osagesoftware.com (maple.osagesoftware.com [192.168.1.20]) by nic.osagesoftware.com (8.10.1/8.10.1) with ESMTP id fB70bfI12594; Thu, 6 Dec 2001 19:37:41 -0500 Message-Id: <4.3.2.7.2.20011206193552.00bae3f0@mail.osagesoftware.com> X-Sender: relson@mail.osagesoftware.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Thu, 06 Dec 2001 16:37:00 -0000 To: Kevin Buettner From: David Relson Subject: Re: Problem with threaded program Cc: gdb@sources.redhat.com In-Reply-To: <1011207000357.ZM8745@ocotillo.lan> References: <4.3.2.7.2.20011202114313.00c40ab0@mail.osagesoftware.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-SW-Source: 2001-12/txt/msg00072.txt.bz2 Kevin Way to go fella! I patched my gdb-5.1 source code, rebuilt, tested, and got the right result! I've forwarded the news to Emmanuel Blindauer who discovered the problem. I'm sure he'll be pleased. David At 07:03 PM 12/6/01, Kevin Buettner wrote: >On Dec 2, 11:44am, David Relson wrote: > > > Here's the test program, test.c: > > > > #include > > int main() { > > char *t="1.0"; > > double d=0; > > d=strtod(t,(char **)NULL); > > printf( "%f\n", d ); > > return 0; > > } > > > > Build using "gcc -g -lpthread test.c"; run using "gdb a.out". > > > > If you step through the program one line at a time and display variable d > > after each assignment, the strtod() call seems to return > > "nan(0x8000000000000)", which is also shown by print(). > > > > If you restart the program with a breakpoint at printf(), let it run, and > > display d at the breakpoint, the value shown is "1.000000" which is > correct. > > > > Is this a defect in gdb, or is my analysis wrong? > >It's a defect in gdb. > >I've just posted a patch which fixes this bug. See > > http://sources.redhat.com/ml/gdb-patches/2001-12/msg00183.html > >It hasn't been approved yet, but once it has, I'll push for getting >it into 5.1.1 too. > >Thanks, > >Kevin