public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "ppluzhnikov at google dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/13045] New: crash in put_field while printing NaN
Date: Sat, 30 Jul 2011 17:44:00 -0000	[thread overview]
Message-ID: <bug-13045-4717@http.sourceware.org/bugzilla/> (raw)

http://sourceware.org/bugzilla/show_bug.cgi?id=13045

           Summary: crash in put_field while printing NaN
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: ppluzhnikov@google.com


gdb crashes when printing NaN:

cat float.c

float foo ()
{
  float x = 0;
  x = 1.0 / x;
  return x;
}

int main ()
{
  foo ();
  return 0;
}

gcc -g -m32 float.c

(top) run a.out
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
GNU gdb (GDB) 7.3.50.20110729-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/a.out...done.
(gdb) b foo
Breakpoint 1 at 0x80483ba: file float.c, line 3.
(gdb) run 

Breakpoint 1, foo () at float.c:3
3      float x = 0;
(gdb) n
4      x = 1.0 / x;
(gdb) 
5      return x;
(gdb) p x
$1 = inf    ### OK so far

(gdb) fin
0x080483dd in main () at float.c:10
10      foo();

Program received signal SIGSEGV, Segmentation fault.
0x000000000069edb1 in put_field (data=0xffe8b0 "", order=floatformat_little,
total_len=32, start=9, len=32, stuff_to_put=1) at ../../src/gdb/doublest.c:312
312          *(data + cur_byte) &=
(top) p cur_byte
$3 = 4294967294
(top) bt
#0  0x000000000069edb1 in put_field (data=0xffe8b0 "",
order=floatformat_little, total_len=32, start=9, len=32, stuff_to_put=1) at
../../src/gdb/doublest.c:312
#1  0x000000000069f1d9 in convert_doublest_to_floatformat (fmt=0x9e2840,
from=0x7fffffffcf00, to=0xffe8b0) at ../../src/gdb/doublest.c:451
#2  0x000000000069fc9c in floatformat_from_doublest (fmt=0x9e2840,
in=0x7fffffffcf00, out=0xffe8b0) at ../../src/gdb/doublest.c:760
#3  0x00000000006a00ae in convert_typed_floating (from=0x7fffffffcf70,
from_type=0xf5bdb0, to=0xffe8b0, to_type=0xf92b40) at
../../src/gdb/doublest.c:910
#4  0x000000000049f681 in i386_extract_return_value (gdbarch=0xf8f170,
type=0xf92b40, regcache=0x100ee30, valbuf=0xffe8b0 "") at
../../src/gdb/i386-tdep.c:2423
#5  0x000000000049fc11 in i386_return_value (gdbarch=0xf8f170,
func_type=0xf93030, type=0xf92b40, regcache=0x100ee30, readbuf=0xffe8b0 "",
writebuf=0x0) at ../../src/gdb/i386-tdep.c:2623
#6  0x00000000005d3964 in gdbarch_return_value (gdbarch=0xf8f170,
functype=0xf93030, valtype=0xf92b40, regcache=0x100ee30, readbuf=0xffe8b0 "",
writebuf=0x0) at ../../src/gdb/gdbarch.c:2421
#7  0x00000000005a7e33 in print_return_value (func_type=0xf93030,
value_type=0xf92b40) at ../../src/gdb/infcmd.c:1442
#8  0x00000000005a814d in finish_command_continuation (arg=0xfc25e0, err=0) at
../../src/gdb/infcmd.c:1531
#9  0x000000000055da0a in do_my_continuations_1 (pmy_chain=0x7fffffffd1d8,
err=0) at ../../src/gdb/continuations.c:61
#10 0x000000000055da8e in do_my_continuations (list=0xf66b80, err=0) at
../../src/gdb/continuations.c:85
#11 0x000000000055dca9 in do_all_continuations_ptid (ptid=...,
continuations_p=0xf66b80, err=0) at ../../src/gdb/continuations.c:195
#12 0x000000000055dd0a in do_all_continuations_thread_callback
(thread=0xf66a90, data=0x7fffffffd2ec) at ../../src/gdb/continuations.c:206
#13 0x00000000005bfab1 in iterate_over_threads (callback=0x55dcba
<do_all_continuations_thread_callback>, data=0x7fffffffd2ec) at
../../src/gdb/thread.c:378
#14 0x000000000055dd56 in do_all_continuations (err=0) at
../../src/gdb/continuations.c:223
#15 0x00000000005a85ae in finish_forward (function=0xf8e650, frame=0xd9bb80) at
../../src/gdb/infcmd.c:1646
#16 0x00000000005a8862 in finish_command (arg=0x0, from_tty=0) at
../../src/gdb/infcmd.c:1742
#17 0x00000000004fb0ed in do_cfunc (c=0xd82520, args=0x0, from_tty=0) at
../../src/gdb/cli/cli-decode.c:67
#18 0x00000000004fe1b4 in cmd_func (cmd=0xd82520, args=0x0, from_tty=0) at
../../src/gdb/cli/cli-decode.c:1777
#19 0x0000000000476f96 in execute_command (p=0xd23993 "", from_tty=1) at
../../src/gdb/top.c:442
#20 0x00000000005cb547 in command_handler (command=0xd23990 "fin") at
../../src/gdb/event-top.c:524
#21 0x00000000005cbb56 in command_line_handler (rl=0xfc2740 "") at
../../src/gdb/event-top.c:727
#22 0x00000000006e73db in rl_callback_read_char () at
../../src/readline/callback.c:220
#23 0x00000000005cad05 in rl_callback_read_char_wrapper (client_data=0x0) at
../../src/gdb/event-top.c:178
#24 0x00000000005cb436 in stdin_event_handler (error=0, client_data=0x0) at
../../src/gdb/event-top.c:459
#25 0x00000000005c9c9b in handle_file_event (data=...) at
../../src/gdb/event-loop.c:827
#26 0x00000000005c919b in process_event () at ../../src/gdb/event-loop.c:402
#27 0x00000000005c9265 in gdb_do_one_event (data=0x0) at
../../src/gdb/event-loop.c:467
#28 0x00000000005c333b in catch_errors (func=0x5c91a9 <gdb_do_one_event>,
func_args=0x0, errstring=0x8bbb8f "", mask=6) at ../../src/gdb/exceptions.c:506
#29 0x00000000005143fa in tui_command_loop (data=0x0) at
../../src/gdb/tui/tui-interp.c:172
#30 0x00000000005c3af9 in current_interp_command_loop () at
../../src/gdb/interps.c:291
#31 0x000000000046c19c in captured_command_loop (data=0x0) at
../../src/gdb/main.c:230
#32 0x00000000005c333b in catch_errors (func=0x46c18b <captured_command_loop>,
func_args=0x0, errstring=0x897a7f "", mask=6) at ../../src/gdb/exceptions.c:506
#33 0x000000000046d207 in captured_main (data=0x7fffffffda60) at
../../src/gdb/main.c:937
#34 0x00000000005c333b in catch_errors (func=0x46c1d0 <captured_main>,
func_args=0x7fffffffda60, errstring=0x897a7f "", mask=6) at
../../src/gdb/exceptions.c:506
#35 0x000000000046d23d in gdb_main (args=0x7fffffffda60) at
../../src/gdb/main.c:946
#36 0x000000000046beb2 in main (argc=2, argv=0x7fffffffdb68) at
../../src/gdb/gdb.c:35

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


             reply	other threads:[~2011-07-30 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-30 17:44 ppluzhnikov at google dot com [this message]
2011-08-01 16:02 ` [Bug gdb/13045] " cvs-commit at gcc dot gnu.org
2011-08-01 16:04 ` ppluzhnikov at google dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-13045-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).