zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: zargs with -P intermittently failing in zsh 5.9 and macOS
Date: Tue, 7 Jun 2022 15:51:51 +0900	[thread overview]
Message-ID: <E59BA6E8-91F0-4519-B2E1-ABBE8C182ED8@kba.biglobe.ne.jp> (raw)
In-Reply-To: <B95C19DB-C826-4DBD-B025-C07AAC8BC529@kba.biglobe.ne.jp>


> 2022/05/30 20:16, Jun T <takimoto-j@kba.biglobe.ne.jp> wrote:
> 
> (5) Revised patch with test

It seems this test "sometimes" fails on macOS:

--- /tmp/zsh.ztst.40838/ztst.err	2022-06-07 12:45:24.000000000 +0900
+++ /tmp/zsh.ztst.40838/ztst.terr	2022-06-07 12:45:25.000000000 +0900
@@ -0,0 +1 @@
+(eval):kill:4: kill 47169 failed: no such process
Test ./A05execution.ztst failed: error output differs from expected as shown above for:
  sleep 1 & pid=$!
  kill -STOP $pid
  sleep 1
  kill -CONT $pid
  wait $pid
Was testing: wait for stopped and continued process

The failed 'kill' is the second one: 'kill -CONT $pid'.
If I remove the 'sleep 1' between the two 'kill's then the test
always passes on macOS. But this is not a solution, because then
the test passes even without the patch for signals.c (at least on
Linux). The only way I can think of to make it pass on macOS (but
fails on Linux without the fix for signals.c) is to increase
the background sleep time to 'sleep 2'.

Is there any better solution? Or is this test necessary?

Patch for jobs.c below is just to silence the warning.


diff --git a/Src/jobs.c b/Src/jobs.c
index aa32f4e80..e0e453ed8 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -2221,7 +2221,9 @@ addbgstatus(pid_t pid, int status)
 {
     static long child_max;
     Bgstatus bgstatus_entry;
+#ifdef DEBUG
     LinkNode node;
+#endif
 
     if (!child_max) {
 #ifdef _SC_CHILD_MAX
diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst
index b257ddf2c..bcadc6d56 100644
--- a/Test/A05execution.ztst
+++ b/Test/A05execution.ztst
@@ -396,7 +396,7 @@ F:anonymous function, and a descriptor leak when backgrounding a pipeline
 # TBD: the 0 above is believed to be bogus and should also be turned
 # into 127 when the ccorresponding bug is fixed in the main shell.
 
-  sleep 1 & pid=$!
+  sleep 2 & pid=$!
   kill -STOP $pid
   sleep 1
   kill -CONT $pid





  reply	other threads:[~2022-06-07  6:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24 16:09 Eric Nielsen
2022-05-24 17:32 ` Bart Schaefer
2022-05-24 20:21   ` Eric Nielsen
2022-05-24 20:35     ` Bart Schaefer
2022-05-26  8:57   ` Jun T
2022-05-26 11:21     ` Jun. T
2022-05-27  3:39     ` Bart Schaefer
2022-05-27  4:18       ` Lawrence Velázquez
2022-05-27  5:29       ` Jun T
2022-05-27 16:10         ` Bart Schaefer
2022-05-27 17:25           ` Jun. T
2022-05-29  3:30             ` Bart Schaefer
2022-05-29 14:47               ` Jun. T
2022-05-29 20:07                 ` Bart Schaefer
2022-05-30 11:16                   ` Jun T
2022-06-07  6:51                     ` Jun T [this message]
2022-06-09  2:56                       ` Bart Schaefer
2022-06-12 16:43                 ` Eric Nielsen

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=E59BA6E8-91F0-4519-B2E1-ABBE8C182ED8@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --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).