zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk
Cc: 535232@bugs.debian.org
Subject: Re: Bug#535232: zsh: segfaults while trying to free in hend
Date: Sun, 16 Aug 2009 20:01:03 +0100	[thread overview]
Message-ID: <20090816200103.78034230@pws-pc> (raw)
In-Reply-To: <20090809184721.GA10870@scru.org>

On Sun, 9 Aug 2009 18:47:21 +0000
Clint Adams <schizo@debian.org> wrote:
> On Tue, Jun 30, 2009 at 06:21:33PM -0400, Alec Berryman wrote:
>> Recently (one or two weeks, probably when I upgraded to the current
>> version of zsh), I've been seeing intermittent segfaults - I'll run a
>> command like less or cd and my terminal will die on me.  I've never
>> seen it happen in a long-running shell; if it makes it through the
>> first few commands, everything works.

The following is at least safe and good practice, but it's impossible to
tell if it's the root of the problem.

Index: Src/hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/hist.c,v
retrieving revision 1.94
diff -u -r1.94 hist.c
--- Src/hist.c	23 Mar 2009 12:17:33 -0000	1.94
+++ Src/hist.c	16 Aug 2009 18:59:10 -0000
@@ -1156,6 +1156,7 @@
 	zfree(chline, hlinesz);
 	zfree(chwords, chwordlen*sizeof(short));
 	chline = NULL;
+	chwords = NULL;
 	histactive = 0;
 	unqueue_signals();
 	return 1;
@@ -1270,6 +1271,7 @@
     zfree(chline, hlinesz);
     zfree(chwords, chwordlen*sizeof(short));
     chline = NULL;
+    chwords = NULL;
     histactive = 0;
     if (isset(SHAREHISTORY)? histfileIsLocked() : isset(INCAPPENDHISTORY))
 	savehistfile(hf, 0, HFILE_USE_OPTIONS | HFILE_FAST);


-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


      reply	other threads:[~2009-08-16 19:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090630222133.8940.9856.reportbug@deng-aberr.internal.itasoftware.com>
2009-08-09 18:47 ` Clint Adams
2009-08-16 19:01   ` Peter Stephenson [this message]

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=20090816200103.78034230@pws-pc \
    --to=p.w.stephenson@ntlworld.com \
    --cc=535232@bugs.debian.org \
    --cc=zsh-workers@sunsite.dk \
    /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).