public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "dje at google dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/17891] New: SIGFPE results in infinite loop?
Date: Thu, 29 Jan 2015 11:16:00 -0000	[thread overview]
Message-ID: <bug-17891-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=17891

            Bug ID: 17891
           Summary: SIGFPE results in infinite loop?
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

I was testing current gdb on a program compiled with Two Level Linetables
http://wiki.dwarfstd.org/index.php?title=TwoLevelLineTables
and found gdb went into an infinite loop of SIGFPE->handle_sigfpe->SIGFPE
->handle_sigfpe->...

The bug for bad line table header version handling is bug 17890.

This bug is for the bad SIGFPE handling.

How is this supposed to work?

Repro:
Add a divide-by-zero to gdb after the event loop has been set up, put a
breakpoint on handle_sigfpe, run, continue, continue, continue, ...

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 715b090..a4bc9ff 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -17140,6 +17140,9 @@ dwarf_decode_line_header (unsigned int offset, struct
dwarf2_cu *cu)
   struct dwarf2_section_info *section;
   bfd *abfd;

+  i = 0;
+  i = 3/i;
+
   section = get_debug_line_section (cu);
   dwarf2_read_section (dwarf2_per_objfile->objfile, section);
   if (section->buffer == NULL)


Program received signal SIGFPE, Arithmetic exception.
0x00000000007c688c in dwarf_decode_line_header (offset=0, cu=0x12b5610)
    at ../../binutils-gdb/gdb/dwarf2read.c:17144
17144     i = 3/i;
(top-gdb) c
Continuing.

Breakpoint 3, handle_sigfpe (sig=8) at ../../binutils-gdb/gdb/event-top.c:1006
1006      mark_async_signal_handler (sigfpe_token);
(top-gdb) 
Continuing.

Program received signal SIGFPE, Arithmetic exception.
0x00000000007c688c in dwarf_decode_line_header (offset=0, cu=0x12b5610)
    at ../../binutils-gdb/gdb/dwarf2read.c:17144
17144     i = 3/i;
(top-gdb) 
Continuing.

Breakpoint 3, handle_sigfpe (sig=8) at ../../binutils-gdb/gdb/event-top.c:1006
1006      mark_async_signal_handler (sigfpe_token);
(top-gdb) 
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.


             reply	other threads:[~2015-01-27 22:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 11:16 dje at google dot com [this message]
2021-08-11 11:35 ` [Bug gdb/17891] " cvs-commit at gcc dot gnu.org
2024-01-02 18:04 ` ssbssa at sourceware dot org

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