From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3926 invoked by alias); 10 Aug 2015 15:18:28 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36071 Received: (qmail 28302 invoked from network); 10 Aug 2015 15:18:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f4-f79c56d0000012ee-e8-55c8c0bcb101 Date: Mon, 10 Aug 2015 16:18:17 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Wait test failure Message-id: <20150810161817.080bcdee@pwslap01u.europe.root.pri> In-reply-to: <20150810135050.7b8499e2@pwslap01u.europe.root.pri> References: <20150808200521.4e3c85d1@ntlworld.com> <20150810135050.7b8499e2@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsVy+t/xK7p7DpwINWh4wGFxsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4MqbdncZUsJ6tYt/6c8wNjN9Zuhg5OSQETCSOfjjODmGLSVy4 t56ti5GLQ0hgKaPEpKfXoJwZTBLrrk1nh3C2MUpsO9oGlOHgYBFQlZizUAykm03AUGLqptmM ILaIgLjE2bXnwTYIC8hJnDiyCyzOK2AvcfZxKxOIzSngILFi+X5GiJlTGCWm7J8EluAX0Je4 +vcTE8RJ9hIzr5yBahaU+DH5HthQZgEtic3bmlghbHmJzWveMoPYQgLqEjfu7mafwCg0C0nL LCQts5C0LGBkXsUomlqaXFCclJ5rqFecmFtcmpeul5yfu4kRErZfdjAuPmZ1iFGAg1GJh3fG 5uOhQqyJZcWVuYcYJTiYlUR4U1adCBXiTUmsrEotyo8vKs1JLT7EKM3BoiTOO3fX+xAhgfTE ktTs1NSC1CKYLBMHp1QDY9lkV1HHfoPQnOLaZ/qz59y7mbWWP+CU4Xqd2DPlZevzbh79s3PG 9hsii/JNrq3Yu8ny8r/EnX2XBN6di2xbu/SRhZ7d22sHAqNUVnZfyXx2U/WV/40fh27G6Avd Wi/nUMTmkHiX/1zVWeWUNf0CM63NTB4+W3Lku/pE+5qXRzb/i7bqkPznvFeJpTgj0VCLuag4 EQB8cnoaVwIAAA== Adding this code at the end of addbgstatus() in jobs.c fprintf(stderr, "Added bgstatus %d for %d\n", status, pid); fflush(stderr); shows it's adding the wrong status (2) at the start: Added bgstatus 2 for 24507 Added bgstatus 2 for 24506 Added bgstatus 3 for 24508 i.e. the problem isn't in the wait, it's already got the wrong status when the process exits. However, running this from the command line doesn't show the problem, even with MONITOR turned off. I'm wondering if in (exit 1) & one=$! (exit 2) & two=$! when we handle the first background process, sometimes the second has already exited so we use the status from that instead? That would be quite serious --- and quite possibly not a new effect, just exacerbated by additional signal blocking. pws