all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Neal Becker <ndbecker2@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: valgrind emacs
Date: Sat, 22 Mar 2008 17:47:10 -0400	[thread overview]
Message-ID: <8763veo2ht.fsf@stupidchicken.com> (raw)
In-Reply-To: <fs3goc$2up$1@ger.gmane.org> (Neal Becker's message of "Sat\, 22 Mar 2008 13\:47\:56 -0400")

Neal Becker <ndbecker2@gmail.com> writes:

> Anyone try valgrind on emacs?  I get some errors:
> ==15930== Invalid free() / delete / delete[]
> ==15930==    at 0x4A05AF7: realloc (vg_replace_malloc.c:306)
> ==15930==    by 0x536A0D: xrealloc (alloc.c:788)
> ==15930==    by 0x4F9DBF: enlarge_buffer_text (buffer.c:5095)
> ==15930==    by 0x50458B: make_gap_larger (insdel.c:528)
> ==15930==    by 0x46FE5B: alloc_destination (coding.c:1124)
> ==15930==    by 0x4701B1: produce_chars (coding.c:6068)
> ==15930==    by 0x4750ED: decode_coding (coding.c:6403)
> ==15930==    by 0x476326: decode_coding_object (coding.c:7054)
> ==15930==    by 0x476AF8: code_convert_string (coding.c:8281)
> ==15930==    by 0x4DC268: main (emacs.c:555)
> ==15930==  Address 0x256FB60 is not stack'd, malloc'd or (recently) free'd

I don't see how this code path could occur.  This seems to be
complaining that b->text->beg in enlarge_buffer_text (buffer.c:5095)
is not a malloc'ed pointer.  But this code path is only activated when
BUFFERP (coding->dst_object) in alloc_destination (buffer.c:1142).
Which means that we already have a valid buffer.

I haven't used valgrind before, so I don't know how reliable it is.
Does anyone know how easy it is to confuse it?

(I haven't studied the rest of the errors closely, but they seem to be
of the same variety.)




  reply	other threads:[~2008-03-22 21:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-22 17:47 valgrind emacs Neal Becker
2008-03-22 21:47 ` Chong Yidong [this message]
2008-03-22 22:20 ` Andreas Schwab
2008-03-22 22:31   ` Neal Becker
2008-03-24 18:50     ` Stefan Monnier

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=8763veo2ht.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=ndbecker2@gmail.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.