zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: Bug: Searching through sufficiently large $historywords causes seg fault
Date: Wed, 10 May 2023 09:39:44 +0100 (BST)	[thread overview]
Message-ID: <290263641.10091739.1683707984531@mail.virginmedia.com> (raw)
In-Reply-To: <CAH+w=7bug=bENC9LMOe_UkeLk2yKwmdhtujv2tjM_gxpnyOPfg@mail.gmail.com>

> On 10/05/2023 00:05 Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Tue, May 9, 2023 at 12:01 PM Peter Stephenson
> <p.w.stephenson@ntlworld.com> wrote:
> >
> > On Tue, 2023-05-09 at 09:58 -0700, Bart Schaefer wrote:
> > >
> > > Scratch that ... I had not correctly recompiled.  After correctly
> > > recompiling, I can't reproduce the segmentation fault at all with
> > > 51722, but the event added with "print -S" is entirely missing from
> > > $historywords even though it is found when scrolling the history.
> >
> > That sounds fine --- it's the division into words, not the line, that's
> > causing the problems which this avoids.
> 
> It's fine that an event is missing from historywords?  Doesn't that
> mean that we've just skipped over the problem code rather than figure
> out why it's wrong?

The current patch is entirely about safety to cover all the possible
cases where history word numbering is going wrong and preventing crashes.
Completion is particularly sensitive to this as it looks at all words
for all lines, so if it can go wrong, it will.  The patch now seems to
be doing its job.

Tracking down all possible cases where a history word number can be
calculated wrongly from any possible source is another thing entirely.
Possibly some DPUTS() in the earlier code are a good idea, as now we
know it is showing up in error later on trapping it there isn't going
to help any more.

pws


  reply	other threads:[~2023-05-10  8:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08  8:58 Marlon Richert
2023-05-08 17:01 ` Bart Schaefer
2023-05-09 16:53   ` Bart Schaefer
2023-05-09 16:58     ` Bart Schaefer
2023-05-09 19:01       ` Peter Stephenson
2023-05-09 23:05         ` Bart Schaefer
2023-05-10  8:39           ` Peter Stephenson [this message]
2023-05-12  9:28             ` Peter Stephenson
2023-05-12 16:12               ` Bart Schaefer

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=290263641.10091739.1683707984531@mail.virginmedia.com \
    --to=p.w.stephenson@ntlworld.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).