zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Heap corruption [the thread formerly known as substitution]
Date: Thu, 01 Oct 2015 15:28:23 +0100	[thread overview]
Message-ID: <20151001152823.19512ecd@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20151001094140.413b5401@pwslap01u.europe.root.pri>

On Thu, 1 Oct 2015 09:41:40 +0100
Peter Stephenson <p.stephenson@samsung.com> wrote:
> > On Sep 30,  3:04pm, Peter Stephenson wrote:
> > } In some complex git completion --- reproducible only in one set up ---
> > } the heap allocation is apparently going out of bounds.

Some progress.  I've copied some heap info at the point the allocation
takes place --- this is a bespoke debug structure but it's pointing to
standard shell info:

(gdb) p copied_heap_info 
$1 = {heap = 0x2b98ac551000, arena = 0x2b98ac551028, size = 16344, 
  alloc = 0x2b98ac555000}
(gdb) p *copied_heap_info.heap
$2 = {next = 0x0, size = 16384, used = 16344, sp = 0x27a13b0, heap_id = 38650}

That "alloc" is what gdb, valgrind and the OS itself agree is out of
bounds.  Sure enough, the sums say the heap finishes at 0x2b98ac555000,
heap + 16384 or equivalently arena + 16344.  Likely this is the last
heap allocated.

All the addresses look consistent, no obvious of corruption unless it's
being very sneaky, so this is starting to look like a real heap problem
when you happen to get a chance address clash (remember this is a 64-bit
system, if that's relevant).

Bart, any immediate reaction before I dig further?

pws


  reply	other threads:[~2015-10-01 14:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-26 12:19 Substitution ${...///} slows down when certain UTF character occurs Sebastian Gniazdowski
2015-09-26 20:44 ` Bart Schaefer
2015-09-27  8:13   ` Sebastian Gniazdowski
2015-09-27 16:11     ` Bart Schaefer
2015-09-28  8:51       ` Peter Stephenson
2015-09-28 11:30         ` Peter Stephenson
2015-09-28 19:23         ` Peter Stephenson
2015-09-29  8:44           ` Peter Stephenson
2015-09-29 18:37             ` Peter Stephenson
2015-09-29 19:23               ` Bart Schaefer
2015-09-30  8:59                 ` Peter Stephenson
2015-09-30 14:04                   ` Peter Stephenson
2015-09-30 21:19                     ` Bart Schaefer
2015-10-01  8:41                       ` Peter Stephenson
2015-10-01 14:28                         ` Peter Stephenson [this message]
2015-10-01 15:07                           ` Heap corruption [the thread formerly known as substitution] Bart Schaefer
2015-10-01 15:13                           ` Peter Stephenson
2015-10-03 18:59                             ` Peter Stephenson
2015-10-01 13:45       ` Substitution ${...///} slows down when certain UTF character occurs Sebastian Gniazdowski

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=20151001152823.19512ecd@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).