From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28713 invoked from network); 28 Mar 2022 19:52:41 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Mar 2022 19:52:41 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1648497161; b=mIz2dTxRwtbcJHgd4u//ujWOW94mLZWZKMqXQm9x4sVShJLaBUfat+q7MKSE6r2P0yp5aQdeay 8Lb5KCPg+oW15JkJi/+Z/OUSDqTi6cwVZf3XBk1FGqX6sc4Z4t5KzZCSZlognkX7w1YmXFMjuX Rr0BnufsYGndKMc3EN7/u2Csxa7mDzVQ0VqUdWiL78PxCZAfMiOGdfPX9Ye5b7jgBbcfkK4ywt wNw1oUfnk2KZeYTGXd+ftRVn+kYanvmO/04EJ6GLJ8YPbBbXfZGBwKdbhFf0hZvkiGV4fz+8XL ajAG4STawiedxu2wcsmt7Ks9JLhGxXR46uvilqpkpN1+Vg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1648497161; bh=KXvWifpUAglPDjA6NCWhhck+jeUQ7uek1xnkmln2l10=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:Content-Type: References:In-Reply-To:Date:To:From:Subject:Message-ID:DKIM-Signature: DKIM-Signature; b=OtUQgmaYVTKG6nrZnakOXajQlXV+zJWugVmAHsYH6HB4VJagSuggIfQq3CCFxJdcJo3EuVHlmj MbllCmDqwSwDj1TaqJW78XdpoKPZgEdtyBb6oHKGznpVKWGMSPvNh4W9yCZALJJ/+sXBjwxfCa ypP8aIypETA/c7ampQzpOZSRv8NQGW5oE5gFqNGH5NxwUjtDMyTaHOpMQNYzcieUGuTKjJnYkt P6P+Jnw/6lxsGcZoEkca6dRidf21D6v1JFJJJmUGUAVDyXaIipUSUUWLCtj4qy0HKDkNDgziE7 u/ZFJnWOnVt/803Et4Sxld/xJDFBbNhonjhhYd+HvVDWUg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Mime-Version:Content-Type:References:In-Reply-To:Date:To:From:Subject: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=l9eWIplUexHiDGlZhSdsDNrJUb00RYdlkbOJaz0+5hk=; b=LCSzGQfkm6mBdjJkCLiQ3BgklG KUxVunJGxnTeNYqVc8lVPS/oZ2zuqvC9ZzXazZlJDafVN0xkVICQEbdausADhbhDYzmaJtZEOhzlN 4N5nSW9PLxKli9CQwasGq1XPyBJIp7BMPWAsF/Bh7AXw8yowbxEsbMVixDi+c/+t2/vOeV8VO00bU F2TTFtXw7uX3nEi27zTqu4r6jjHgS8i9BqVwXwjzNaBG5v1PlSDRzf1A74aTHKSB4/IdgmdjjKoX/ GpCdO9OlabCXcrZnXzCqRXfSW6YanTz7EgB1cNcz5VqCyjK89r5sNezqTPcAjq6sflrZrXpsxvQ5p gV1eewdA==; Received: from authenticated user by zero.zsh.org with local id 1nYvPr-0004TR-Ht; Mon, 28 Mar 2022 19:52:39 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:47530) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1nYvPG-00047o-Jb; Mon, 28 Mar 2022 19:52:03 +0000 Received: from [212.54.57.110] (helo=csmtp6.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYvPG-0007Ro-CF for zsh-workers@zsh.org; Mon, 28 Mar 2022 21:52:02 +0200 Received: from pws-Zeus ([82.1.229.179]) by cmsmtp with ESMTPA id YvPFnJg9muFJVYvPGnggQR; Mon, 28 Mar 2022 21:52:02 +0200 X-SourceIP: 82.1.229.179 X-Authenticated-Sender: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.4 cv=DewEF9hW c=1 sm=1 tr=0 ts=624211e2 cx=a_exe a=W4rGJ7PGCSRRUvufKHO8Dg==:117 a=W4rGJ7PGCSRRUvufKHO8Dg==:17 a=IkcTkHD0fZMA:10 a=o8Y5sQTvuykA:10 a=16efffSWlgJj59gWOTMA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1648497122; bh=l9eWIplUexHiDGlZhSdsDNrJUb00RYdlkbOJaz0+5hk=; h=Subject:From:To:Date:In-Reply-To:References; b=zOVQVoLSxLCzL450qgp4xsW0mocrgp6McQoDI1FpbnXSgRZn3FdF8z6WVLF43eCet LenwrOZ5+VJ/sCyLxRFSbwW0VPD9ku7Wg2AwuRzyMpCFWdUqwzwEZv1dAygMuSnWir ztei/Uozt+Dbc1qv+N5Lf0LJ2p32WDWtyGmTAGjyCxn/qTkV3ccM/YzTskSC3u6bkg h1v+jkzJCPyev7vYPOn1nDJD3S8hb8PdChk9WtPSDRZI/df4QOAJP8lpFp9i67bHl/ GTVkTnqcJEMWyVSFhfFa+21tnGd40rbfjHlxRG/b5hLxm8DSihhUcMKbm9Saa340Lb MlnZnwhqN5ycQ== Message-ID: <1e36a19a15237624412bc502ebfcf99034dfbb79.camel@ntlworld.com> Subject: Re: Crash on jobstates since workers/49783 (commit 6a8aa2a) From: Peter Stephenson To: zsh-workers@zsh.org Date: Mon, 28 Mar 2022 20:52:01 +0100 In-Reply-To: References: <1409134730.698961.1648457237653@mail2.virginmedia.com> <1613542531.711035.1648478945973@mail2.virginmedia.com> <1830314137.713553.1648484054367@mail2.virginmedia.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfHSagdwc4g6Fxdxi7piIogqQf2Np7FoBI3QhIM4TS1jgKm/8fDXMin4Mf5gUCyEyrb7mdEjincq1tOLXxKEn/3IXTN9ULFELj973DnSvKBZj9VX8YDci 3aHzXNYPZGykswvwB9INylXDJQA/UT0X87feEy+wklYkZWhGgHQ4xEGUS7ZMGQY4zS3+BZejLfZISg== X-Seq: 49905 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Mon, 2022-03-28 at 09:44 -0700, Bart Schaefer wrote: > Another possibility that occurs to me is for the values in $jobstates to change. > > ... The keys are the job numbers and the values > are strings of the form 'JOB-STATE:MARK:PID=STATE...'. The > JOB-STATE gives the state the whole job is currently in, one of > 'running', 'suspended', or 'done'. > > What if JOB-STATE became "parent" in the subshell? Or something along > those lines. I guess that goes back to having to make a deep copy of > the saved job structure. I think if can get something that "just works" we'll save quite a lot of aggravation for ourselves both as users and as zsh-workers. If there's nothing too obviously wrong with magically pusthing the rabbit back into the hat again so it looks like a normal top hat, I'd prefer to try that. > Incidentally: > > % sleep 10 & print -aC2 ${(kv)jobstates}; (jobs -l; print -aC2 ${(kv)jobstates}) > [1] 69151 > 1 running:+:69151=running > [1] + 69151 running sleep 10 > 1 running:+ > > How is it that "jobs -l" still knows the PID from the parent job, but > $jobstates cannot report it? Hmm... on my home machine the crash is a bit more sporadic than it was on the NUC at work, so it's something to do with races rather than a simple invalid pointer as I originally assumed. When I simply print jobstates and it does crash I'm seeing what looks like the process number of the subshell process appear right before the crash (i.e. it's typically one more than the sleep that was just started). But I can't see what's different here from jobs. In both cases, when oldjobtab is non-NULL, we're scanning from job 1 to the maximum for jobs with stat and procs non-zero and no STAT_NOPRINT. Also, signals should be queued at this point. So I'm stuck at the moment. pws