zsh-users
 help / color / mirror / code / Atom feed
From: Dennis Schwartz <dennis.schwartz@protonmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: "zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: Re: TRAPINT doesn't work reliably
Date: Thu, 26 Sep 2019 14:48:21 +0000	[thread overview]
Message-ID: <EwtKvyologv1mcP4t0gYc4lnyj-ccruEDWJM6kEh3_-H1P6kvlnSEV_LunkUg4AxuDZkdVcoPHq2KnqTqQ4pOAzRd2bXfkj0tjAvgg2-cQQ=@protonmail.com> (raw)
In-Reply-To: <1569434163.10786.26.camel@samsung.com>

On Wednesday, September 25, 2019 7:56 PM, Peter Stephenson <p.stephenson@samsung.com> wrote:

> On Wed, 2019-09-25 at 16:25 +0000, Dennis Schwartz wrote:
>
> > ==1896==  Block was alloc'd at
> > ==1896==    at 0x483877F: malloc (vg_replace_malloc.c:299)
> > ==1896==    by 0x136A13: zcontext_save_partial (in /usr/bin/zsh)
> > ==1896==    by 0x165622: parse_subscript (in /usr/bin/zsh)
> > ==1896==    by 0x17A446: getindex (in /usr/bin/zsh)
> > ==1896==    by 0x17ABCF: fetchvalue (in /usr/bin/zsh)
> > ==1896==    by 0x19BDB0: ??? (in /usr/bin/zsh)
> > ==1896==    by 0x1A0C87: prefork (in /usr/bin/zsh)
> > ==1896==    by 0x13ABE6: execsubst (in /usr/bin/zsh)
> > ==1896==    by 0x1674CB: execfor (in /usr/bin/zsh)
> > ==1896==    by 0x13E44C: ??? (in /usr/bin/zsh)
> > ==1896==    by 0x13FB6E: ??? (in /usr/bin/zsh)
> > ==1896==    by 0x13FF11: ??? (in /usr/bin/zsh)
> > ==1896==
> > ==1896== Invalid read of size 1
>
> One kind of interesting thing here is there's some suggestion that the
> original allocation was not simply in top level code, but in some kind
> of block (at least a for block) --- assuming, of course, this is
> relevant.  Is there some structure about the point where you're setting
> up the trap?  If so, does changing it (making it simpler) have any
> effect on the problem?

Okay, after quite some time debugging (I will spare you the details of
all what I've tried), I can now reliably reproduce the bug. However, I
lack the knowledge of zsh to understand what is causing the bug.

To trigger the bug, I just open a fresh new shell (e.g. run `zsh`) and
type `ls` and hit TAB to trigger the autocompletion function.

However, I can only reproduce the bug if I have the following code in my
`~/.zshrc`:

    # Antigen zsh plugins
    if [ -f "/usr/share/zsh-antigen/antigen.zsh" ]; then
        source "/usr/share/zsh-antigen/antigen.zsh"

        # load some plugins here, but they are not relevant to trigger
        # the bug
    fi

So, I conditionally `source` another file. Apparently, this is causing
*super weird* behavior. Unbelievably, if I open the file `.zshrc` (e.g.,
vim/gedit) and _save_ the file, I cannot trigger the bug. However, if I
open the file, but _do not save_ the file, I always trigger the bug.

To complicate it further, I can trigger the bug when I compile from
source `zsh-5.7.1`, but I cannot trigger the bug anymore if VERSION in
`Config/version.mk` is updated (i.e., the next commit).

These findings leave me totally confused. Not sure if it's relevant but
I mount my home folder with the `noatime` option.

Any ideas? Thanks for your help!


Cheers,
Dennis

  reply	other threads:[~2019-09-26 14:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190917164905epcas1p4ad458ffcd504501780d522880c81de3e@epcas1p4.samsung.com>
2019-09-17 16:47 ` Dennis Schwartz
2019-09-24  8:44   ` Peter Stephenson
2019-09-25 13:02     ` Dennis Schwartz
2019-09-25 14:01       ` Peter Stephenson
2019-09-25 16:25         ` Dennis Schwartz
2019-09-25 17:04           ` Peter Stephenson
2019-09-25 18:46             ` Daniel Shahaf
2019-09-26 15:27               ` Peter Stephenson
2019-09-27 13:43                 ` Daniel Shahaf
2019-09-25 17:56           ` Peter Stephenson
2019-09-26 14:48             ` Dennis Schwartz [this message]
2019-09-26 15:25               ` Peter Stephenson
2019-09-26 17:10                 ` Dennis Schwartz
2019-09-27 13:46                   ` Daniel Shahaf
2019-09-28 11:16                     ` Dennis Schwartz
2019-09-28 14:29                       ` Daniel Shahaf
2019-09-28 18:21                         ` Dennis Schwartz
2019-09-28 18:58                           ` Dennis Schwartz
2019-09-28 16:00                       ` Bart Schaefer
2019-09-29 16:54                         ` Peter Stephenson
2019-09-27 19:05                   ` Peter Stephenson

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='EwtKvyologv1mcP4t0gYc4lnyj-ccruEDWJM6kEh3_-H1P6kvlnSEV_LunkUg4AxuDZkdVcoPHq2KnqTqQ4pOAzRd2bXfkj0tjAvgg2-cQQ=@protonmail.com' \
    --to=dennis.schwartz@protonmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-users@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).