help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org, "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
Subject: Re: Probabilistic crash on zsh 5.9 on x86_64
Date: Thu, 13 Apr 2023 11:47:49 +0100 (BST)	[thread overview]
Message-ID: <267594676.4158370.1681382869709@mail.virginmedia.com> (raw)
In-Reply-To: <5C4788C8-4E40-4565-AFE8-84D57949BC8C@ntlworld.com>

> On 11/04/2023 17:29 Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> This indicates something is wrong with the reference counting:
> it shouldn't be possible for a shell code chunk to be visible
> to the user without it being marked as having at least one reference.

This should reliably pick up the problem, though it needs tracing back
to where the function is set up.

It was crashing 100% for me, too, and this is the only time I see this debug
message, so I think this is safe to commit and should give us a heads up
on other cases.

diff --git a/Src/exec.c b/Src/exec.c
index 3b3d1235e..49c196bfd 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -5942,6 +5942,8 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval)
 	funcsave->fstack.filename = getshfuncfile(shfunc);
 	prog = shfunc->funcdef;
+	DPUTS1(!prog->nref, "function definition %s has zero reference count",
+	       (fname && *fname) ? fname : "<anon>");
 	if (prog->flags & EF_RUN) {
 	    Shfunc shf;

  reply	other threads:[~2023-04-13 10:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-08 17:28 zsh bug report throwaway email thing
2023-04-08 21:36 ` Mikael Magnusson
2023-04-11 16:14   ` Jun. T
2023-04-11 16:29     ` Peter Stephenson
2023-04-13 10:47       ` Peter Stephenson [this message]
2023-04-13 11:12         ` Peter Stephenson
2023-04-13 13:02           ` Jun. T
2023-04-13 13:19             ` Peter Stephenson
2023-04-13 14:03               ` Peter Stephenson
2023-04-13 14:13                 ` Peter Stephenson
2023-04-13 16:40                 ` Jun. T
2023-04-13 16:55                   ` Peter Stephenson
2023-04-14  8:29                     ` Peter Stephenson
2023-04-14 12:21                       ` Mikael Magnusson

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=267594676.4158370.1681382869709@mail.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \


* 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


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).