Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: kettenis@gnu.org, gdb-patches@sources.redhat.com
Subject: Re: dwarf2-frame clobbers memory
Date: Sun, 01 Jun 2003 07:49:00 -0000	[thread overview]
Message-ID: <20030601074733.GA12207@redhat.com> (raw)
In-Reply-To: <20030601033621.GA12145@redhat.com>

On Sat, May 31, 2003 at 08:36:21PM -0700, Richard Henderson wrote:
> At the following traceback, memmove is overwriting the "help"
> command, which results in a segv on the next command.  Is this
> enough to track down the problem?

Nevermind, found it.  Let us remember how pointer arithmetic works.  ;-)


r~


	* dwarf2-frame.c (dwarf2_frame_state_alloc_regs): Fix ptr arithmetic.

Index: dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.1
diff -c -p -d -r1.1 dwarf2-frame.c
*** dwarf2-frame.c	31 May 2003 19:18:05 -0000	1.1
--- dwarf2-frame.c	1 Jun 2003 07:45:41 -0000
*************** dwarf2_frame_state_alloc_regs (struct dw
*** 163,169 ****
      xrealloc (rs->reg, num_regs * size);
  
    /* Initialize newly allocated registers.  */
!   memset (rs->reg + rs->num_regs * size, 0, (num_regs - rs->num_regs) * size);
    rs->num_regs = num_regs;
  }
  
--- 166,172 ----
      xrealloc (rs->reg, num_regs * size);
  
    /* Initialize newly allocated registers.  */
!   memset (rs->reg + rs->num_regs, 0, (num_regs - rs->num_regs) * size);
    rs->num_regs = num_regs;
  }
  


  reply	other threads:[~2003-06-01  7:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-01  3:38 Richard Henderson
2003-06-01  7:49 ` Richard Henderson [this message]
2003-06-01  9:20   ` Mark Kettenis

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=20030601074733.GA12207@redhat.com \
    --to=rth@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@gnu.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