From nobody Sun Oct 16 05:07:41 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mqp6618H0z4fKxy for ; Sun, 16 Oct 2022 05:07:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mqp656HHNz3mGB for ; Sun, 16 Oct 2022 05:07:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Mqp6556d0zMTC for ; Sun, 16 Oct 2022 05:07:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 29G57ftU026796 for ; Sun, 16 Oct 2022 05:07:41 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 29G57fSv026795 for bugs@FreeBSD.org; Sun, 16 Oct 2022 05:07:41 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 267110] xargs return incorrect exit code when run in parallel mode Date: Sun, 16 Oct 2022 05:07:41 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: duliujimmy@hotmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665896861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JdV4dfFmK5yHkqSqqIW+NtPnbSw4b7ek4mbD7YJmcPA=; b=uPAc0UHesnWVzKqQ6mA9ZL5gR5AZ4UImuerqzp4DTWSNtkN4GQsdUR3TVMVgNCw0BPtIQU FkZWqlj2d3gVwbLtUKTvp628EsH7RiDtC3UjMWJ99YiB7vec3es8hUOhB5BBSW0Kf3LS+d 740jn4DPv6vrS55Ep7A52KvuOkoW/n1NLaCKbTRPUFXXec10MlYtYDFn5F3Cv7ePfh5dx2 3ydv630d73W0H0mVis9zSmO2xhoHpkjvMT9ZNeZdf9cxV8iB1Xc8rJLcLsjy2DaRODcav6 jnbvw8zV8qSRa04nXZiNi3vUit09B9BXq7VaZ7WRRNcjZ4PbC2a2hdIqq1pAXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665896861; a=rsa-sha256; cv=none; b=TF2mkMjGZlPTitd0dkgtxgtFv6OQlQWxTKf8Rw1U+DzCJRm0V3HnSPJLji1mz5UiY2znDk 0OHFe0EayN+Lgbfkhr9dCsm2Z/1Wje7Ycsqo8gYlYpjqAj8y3m9hobRc0sOvNUGxnDa4Tr Gwm3Z5V6kHqrPJTEcRdF7dDIxOpXrUcVKhjwbxcNtVKiKfyL0zI7tSZn7A7ddA0LVtknl9 vJnAkQ1tPZtGCpKv7HcO8ONtlmo5ckg00ISiEXjQE6YzjfgzCEhXEfOljXkz7sA7uaATu+ 9XnHJXeOiMn70YHzxDXOyT5PoqNQYSPwMZurBfAsiYL8LxJIBA0RGUQfU825nQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267110 Bug ID: 267110 Summary: xargs return incorrect exit code when run in parallel mode Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: duliujimmy@hotmail.com when xargs runs in parallel mode (using -P flag), it may sometimes return incorrect exit code.=20 The following code shows current (incorrect) behaviour: /bin directory exis= ts, /foo directory does not exist. `echo /bin /foo | xargs -n1 -P2 test -d` sometimes return 0 sometimes return 1: ``` root@freebsd:~ # test -d /bin root@freebsd:~ # echo $? 0 root@freebsd:~ # test -d /foo root@freebsd:~ # echo $? 1 root@freebsd:~ # echo /bin /foo | xargs -n1 -P2 test -d root@freebsd:~ # echo $? 0 root@freebsd:~ # echo /bin /foo | xargs -n1 -P2 test -d root@freebsd:~ # echo $? 1 root@freebsd:~ # echo /bin /foo | xargs -n1 -P2 test -d root@freebsd:~ # echo $? 0 ``` --=20 You are receiving this mail because: You are the assignee for the bug.=