From: "Eli Zaretskii" <eliz@elta.co.il>
To: Eli Zaretskii <eliz@elta.co.il>
Cc: gdb-patches@sources.redhat.com
Subject: [RFA] Fix a crash in coffread.c (Was: GDB 6.1 branch 2004-02-26-gmt)
Date: Sun, 22 Feb 2004 21:07:00 -0000 [thread overview]
Message-ID: <3099-Sun22Feb2004230710+0200-eliz@elta.co.il> (raw)
In-Reply-To: <9791-Sat21Feb2004181440+0200-eliz@elta.co.il>
> Date: Sat, 21 Feb 2004 18:14:41 +0200
> From: "Eli Zaretskii" <eliz@elta.co.il>
>
> I built today the latest snapshot of CVS HEAD and found a new
> regression: the DJGPP port crashes at startup while debugging itself.
Bug squashed, I think. It turned out to be a very old one, actually;
the current CVS HEAD didn't introduce it, it just exposed it because
the GDB binary is now so large.
The bug happens only when GDB (or any other large program) is compiled
with COFF debug info and the line table overflows the 64K limit
allowed by COFF debug info. I think the patch below fixes that.
Okay to commit?
2004-02-22 Eli Zaretskii <eliz@elta.co.il>
* coffread.c (enter_linenos): Don't let rawptr reference memory
outside linetab[]'s limits.
--- gdb/coffread.c~0 2004-02-14 17:46:32.000000000 +0200
+++ gdb/coffread.c 2004-02-22 22:42:34.000000000 +0200
@@ -1362,11 +1362,15 @@ enter_linenos (long file_offset, int fir
/* line numbers start at one for the first line of the function */
first_line--;
- for (;;)
+ /* If the line number is full (e.g. 64K lines in COFF debug info),
+ the next function's L_LNNO32 might not be zero, so don't overstep
+ the table's end in any case. */
+ for ( ; rawptr <= &linetab[0] + linetab_size; )
{
bfd_coff_swap_lineno_in (symfile_bfd, rawptr, &lptr);
rawptr += local_linesz;
- /* The next function, or the sentinel, will have L_LNNO32 zero; we exit. */
+ /* The next function, or the sentinel, will have L_LNNO32 zero;
+ we exit. */
if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
record_line (current_subfile, first_line + L_LNNO32 (&lptr),
lptr.l_addr.l_paddr
next parent reply other threads:[~2004-02-22 21:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040220011823.848FD4B104@berman.michael-chastain.com>
[not found] ` <9791-Sat21Feb2004181440+0200-eliz@elta.co.il>
2004-02-22 21:07 ` Eli Zaretskii [this message]
2004-02-23 15:13 ` Elena Zannoni
2004-02-23 19:11 ` Eli Zaretskii
2004-02-23 21:01 ` Elena Zannoni
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=3099-Sun22Feb2004230710+0200-eliz@elta.co.il \
--to=eliz@elta.co.il \
--cc=gdb-patches@sources.redhat.com \
/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