From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13737 invoked by alias); 4 Apr 2012 11:00:18 -0000 Received: (qmail 13715 invoked by uid 22791); 4 Apr 2012 11:00:18 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Apr 2012 11:00:05 +0000 From: "dpovey at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/13943] New: gdb does not correctly handle underflow in the "print" command Date: Wed, 04 Apr 2012 11:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dpovey at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2012-q2/txt/msg00014.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13943 Bug #: 13943 Summary: gdb does not correctly handle underflow in the "print" command Product: gdb Version: 7.3 Status: NEW Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned@sourceware.org ReportedBy: dpovey@gmail.com Classification: Unclassified If a and b are doubles, and a / b underflows to zero, gdb "print" will wrap around the exponent to make a very large value. Example below. a09:s3: cat foo.cc #include main() { double a = 9.8813129168249309e-323, b = 1000; abort(); } a09:s3: g++ -g foo.cc -o foo a09:s3: gdb foo GNU gdb (GDB) 7.3-debian Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /export/proceedings/dpovey_temp/kaldi-trunk/egs/rm/s3/foo...done. (gdb) r Starting program: /export/proceedings/dpovey_temp/kaldi-trunk/egs/rm/s3/foo Program received signal SIGABRT, Aborted. 0x00007ffff72ef405 in *__GI_raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. in ../nptl/sysdeps/unix/sysv/linux/raise.c (gdb) up #1 0x00007ffff72f2680 in *__GI_abort () at abort.c:92 92 abort.c: No such file or directory. in abort.c (gdb) list 87 in abort.c (gdb) up #2 0x0000000000400568 in main () at foo.cc:5 5 abort(); (gdb) list 1 #include 2 3 main() { 4 double a = 9.8813129168249309e-323, b = 1000; 5 abort(); 6 } 7 (gdb) p a / b $2 = -3.1933444952555512e+291 <-------------- HERE IS THE BUG. Should be small (gdb) quit -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.