From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32573 invoked by alias); 2 Dec 2001 16:44:23 -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 32552 invoked from network); 2 Dec 2001 16:44:22 -0000 Received: from unknown (HELO nic.osagesoftware.com) (65.186.161.49) by hostedprojects.ges.redhat.com with SMTP; 2 Dec 2001 16:44:22 -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 fB2GiLI25176 for ; Sun, 2 Dec 2001 11:44:21 -0500 Message-Id: <4.3.2.7.2.20011202114313.00c40ab0@mail.osagesoftware.com> X-Sender: relson@mail.osagesoftware.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Sun, 02 Dec 2001 08:44:00 -0000 To: gdb@sources.redhat.com From: David Relson Subject: Problem with threaded program Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-SW-Source: 2001-12/txt/msg00001.txt.bz2 Greetings, The problem below was originally reported to the Linux Kernel Mailing List. It looks to me to be a gdb problem. I used a freshly compiled and installed copy of gdb-5.1 (configured as "i686-pc-linux-gnu") for this test on a Pentium III 500mhz running the 2.4.16 kernel. The same problem happens with gdb-5.0. gdb-4.18 appears to work fine. 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? David P.S. -------------------------------------------------------- David Relson Osage Software Systems, Inc. relson@osagesoftware.com Ann Arbor, MI 48103 www.osagesoftware.com tel: 734.821.8800