Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15924

Re: Procsub.tests on OSes using named pipes

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From "CHIGOT, CLEMENT" <clement.chigot@atos.net>
Newsgroups gnu.bash.bug
Subject Re: Procsub.tests on OSes using named pipes
Date Thu, 20 Feb 2020 14:32:54 +0000
Lines 65
Approved bug-bash@gnu.org
Message-ID <mailman.1249.1582209189.2412.bug-bash@gnu.org> (permalink)
References <96a8e651-ce82-b295-fa3e-53a2f94e53c9@case.edu> <DB7PR02MB4075FD0320086B0A7327AD3CEA130@DB7PR02MB4075.eurprd02.prod.outlook.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="iso-8859-1"
Content-Transfer-Encoding quoted-printable
X-Trace usenet.stanford.edu 1582209190 17875 209.51.188.17 (20 Feb 2020 14:33:10 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Chet Ramey <chet.ramey@case.edu>
To "bug-bash@gnu.org" <bug-bash@gnu.org>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=atos.net; i=@atos.net; q=dns/txt; s=mail; t=1582209183; x=1613745183; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=M/wa9g26m8Wi8U2KUP2MbDObV8h6xr25pnmttToarKQ=; b=iX/EQdPnPo7SN0MqwZr5NKxKOQHSYcksbyyAWBCQdmtSqxuNGsHHHCGf sEMh6Kd8x5Rv62/kkxLCixxYYbE95FmZZ/rxi7LY/o9w5bkUSZlpnrkyi iC/G4NtngL3iji8IleBQAWoEz+5CWL8/h2jQX8/+0eEJwLKhgdPCQXCmS U=;
IronPort-SDR Jww7ztxSiE0SHvUHwoI14w7RjT1QqUEhW++Riqmie2wK81MkdnFcyhSDHCYPsZrlU8EDTpvlY+ O1LvM1gCJO2lrYWFAlhgTg/snugfPnoKTbuMmSyTBx++4tPZy3p0JTevn2sGIlht7XHUIciLgQ r9zP+BBDj+s6qlTeetdoCpupzEc9XM8zoNiRDgO4rEJHcIXf/c64Jk0yUOXrqs16tDZmU2LJ+g KOeDzKevKpIMYdjBxTOGH34flKBrDP0FaDBMTUvyFSVHFsiVGSXLpmDw27uwmSMBnYi57ypP+U PzO7a1mUGIiCYHoWOJ+D4Mkp
X-IronPort-AV E=Sophos;i="5.70,464,1574118000"; d="scan'208";a="53882174"
X-MGA-submission MDEumVJkQk+B5yuD1sbJaW5NbVUeLH7PfPI5xuaR5wW8UInQCNnrWrWdzlM4XEw++QabNAJ9uMhjRw+gMqDGvIpbz7JaxxotOV3KPiVz6JkhmA5G6R0Mgq0rVk8ii1h6VeF1bs0YNl06S3Kf1rludmL/
ARC-Seal i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l/yA+gY4WyVNhCudMd/6Wg9wBf7aETQ8Ru3Mjm7n8r7GWaTKN2O/YxSm7qO42QQEktBihaGJuwRBtY3AzB2mmLt/Uyk7+pW0+JULEIQZ+wWhINzd3LZn0/HRjQOXtTCpNpWDLxoTlLQ6poRoO/obUYHRkr4ybDOvNAfCEj1njyuiCwglpvmPklisOCPJ0EiYPxSZvi+xsgS1JmcbkxSdFZAC+4wLUtTi+/UbJhamfaGedcKvS65cD8onvOVmjlfiM4ngEJ8vIyXNEVuJpxEqN6FYRrK5Dw4nC3DoQ9D1k4tjm9ridk4mnr7D+ILxj68KiEb89rarZYCvTjaXkInFfg==
ARC-Message-Signature i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M/wa9g26m8Wi8U2KUP2MbDObV8h6xr25pnmttToarKQ=; b=GGNjY0/OQ/L2o/S0SKQiUxa3QHS/66a7tLMfyTjCMQQQGNnWzcYcRDaOjFiQdc0qrURHXUurgOd5e/md7PvdgymPW/hwCus/in6CJTpE8E049HM1M2tYmxnFA/4MDyg/gbeXKlaXoLPqayssmVCwJku/ohQaHjn2R6ogsYZZUe/YtKOabT4GZz1ki8+WcsYJZA/c2t9sm8PeZQrRgRMzQSfpGeywUbXHu649Ey6cYPYy6cYMlUyTHUous1BzmBWedO5W0TInoZ1L3pxfO+FQlZwn8rKeFQgl3UX3jb8OCElVGzhYZT7b85WvvYXjUDCudVPyCCKFv8R35z+DJazHNw==
ARC-Authentication-Results i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=atos.net; dmarc=pass action=none header.from=atos.net; dkim=pass header.d=atos.net; arc=none
Thread-Topic Procsub.tests on OSes using named pipes
Thread-Index AQHV4lMjRZ+lXL7UvEW8UUbE72cdUKgcq94AgAeBDt0=
In-Reply-To <96a8e651-ce82-b295-fa3e-53a2f94e53c9@case.edu>
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
msip_labels MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_Enabled=True; MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_SiteId=33440fc6-b7c7-412c-bb73-0e70b0198d5a; MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_SetDate=2020-02-20T14:33:25.164Z; MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_Name=Atos For Internal Use - All Employees; MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_ContentBits=0; MSIP_Label_e463cba9-5f6c-478d-9329-7b2295e4e8ed_Method=Standard;
authentication-results spf=none (sender IP is ) smtp.mailfrom=clement.chigot@atos.net;
x-originating-ip [193.56.241.24]
x-ms-publictraffictype Email
x-ms-office365-filtering-correlation-id c76428f4-a0d5-4614-d953-08d7b611c621
x-ms-traffictypediagnostic DB7PR02MB4283:
x-microsoft-antispam-prvs <DB7PR02MB4283D33470D9756BD5E8311EEA130@DB7PR02MB4283.eurprd02.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers OLM:8882;
x-forefront-prvs 031996B7EF
x-forefront-antispam-report SFV:NSPM; SFS:(10019020)(4636009)(39860400002)(366004)(346002)(136003)(376002)(396003)(199004)(189003)(6916009)(52536014)(478600001)(7696005)(66946007)(26005)(5660300002)(33656002)(186003)(316002)(6506007)(55016002)(9686003)(76116006)(86362001)(64756008)(8936002)(66476007)(81156014)(81166006)(8676002)(71200400001)(66446008)(66556008)(2906002)(4326008); DIR:OUT; SFP:1102; SCL:1; SRVR:DB7PR02MB4283; H:DB7PR02MB4075.eurprd02.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf None (protection.outlook.com: atos.net does not designate permitted sender hosts)
x-ms-exchange-senderadcheck 1
x-microsoft-antispam BCL:0;
x-microsoft-antispam-message-info P0aajUyztQcCCTym9jpZsKMRLeFgjVsDpxXt73HddEuFDmCkxFxw16yy0e4bn1KrrCM6xXfIizIgOPbjvMNGLnhFsAD9xIFufX8yJSsmZjqppcJrT+u2UWNDOn/HHxwSUxT32ziwJ+ufPzJBcBpkQYDJHY3V408vUPZH3QAd9/7V7nrxPTDN4arwMBVlHkgNPR1hIuEsFoVFbP9k5LNDm9tQCUdicISGMTsyoooTwemOzLcD4T2KmLH/3Vvib0xrk4oFwfkV7bpU7nGIJclffMlzz3WHarrn8lEaSdXH99YyzriINrlBWq5avlfyzTDDoXUjD+5XFWImxeI8HI7WixHaOUIR9/550tutoC8wg3JlAskkiu8i8X3WajcZ8iuOcflvKbc2F1IMYjziLXCLdNR1sY/EHkrccBUULKDD7aoqnpXh0zZ9hxo2V4eA43S4
x-ms-exchange-antispam-messagedata F/Y/a6ALEom8VxUPey9vxC4ExVSq69gdXnKpKf0Qa0olRiGjRBd7g+m8TT0oI2EtsNZQIe5LSkGqjGfAWLraZFms/GZbLafFRgYqZRJTuMUSyHRyibokBCGgDv+9KF8GCmJCZ6fiLjJtnuVor+zx0Q==
x-ms-exchange-transport-forked True
X-MS-Exchange-CrossTenant-Network-Message-Id c76428f4-a0d5-4614-d953-08d7b611c621
X-MS-Exchange-CrossTenant-originalarrivaltime 20 Feb 2020 14:32:54.9571 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader Hosted
X-MS-Exchange-CrossTenant-id 33440fc6-b7c7-412c-bb73-0e70b0198d5a
X-MS-Exchange-CrossTenant-mailboxtype HOSTED
X-MS-Exchange-CrossTenant-userprincipalname 4+ooCLPp1w388xXjSlvFBDKEmMi5L3UAgCRxAyVtHHYpAjM57rn9TVZ4LIZC12XsrirKA3NvKHxUQB9y/ns+NQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped DB7PR02MB4283
X-OriginatorOrg atos.net
X-detected-operating-system by eggs.gnu.org: FreeBSD 9.x [fuzzy]
X-Received-From 193.56.114.176
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <DB7PR02MB4075FD0320086B0A7327AD3CEA130@DB7PR02MB4075.eurprd02.prod.outlook.com>
X-Mailman-Original-References <DB7PR02MB4075AEFED9BEDC6FDC0C2D2EEA1A0@DB7PR02MB4075.eurprd02.prod.outlook.com>, <96a8e651-ce82-b295-fa3e-53a2f94e53c9@case.edu>
Xref csiph.com gnu.bash.bug:15924

Show key headers only | View raw


I've just figured that the [ -e "$1" ] in the handler might cause some problems. 
Sometimes, the named pipes isn't yet removed thus [ -e "$1" ] will be true and the return part won't be called. 
I'm not sure why it isn't removed directly, but it might just be how the AIX kernel is handling files. 
Therefore, here is the second version of the patch. 

Note that I'm still trying to find a fix for the unkilled subprocesses stuck in the open syscall. 
I might have found a workaround but not a true fix yet. Moreover, I still have some freezes sometimes. 
The workaround consists on forcing an open + unlink of all the FIFOs created by a bash when this one is closing.  
I'll keep you update. 

-----------------------------------------------------

[PATCH] tests: fix procsubs tests on OSes using named pipes

On OSes using named pipes (like AIX), the pipe's file is suppressed
after the first read. Thus every commands trying to read it afterwards
will fail with ENOENT errno.
---
 tests/procsub.tests | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/tests/procsub.tests b/tests/procsub.tests
index 01ba46a8..22c0b29f 100644
--- a/tests/procsub.tests
+++ b/tests/procsub.tests
@@ -69,10 +69,12 @@ count_lines()
 {
     wc -l < $1

-#    case "$1" in
-#    *sh-np*)  [ -e "$1" ] || { echo 0; echo 0; echo 0; echo 0; return; } ;;
-#    *) ;;
-#    esac
+    # For OSes using named pipes, $1 will be deleted after the first read and
+    # thus ENOENT error will be returned for every following commands.
+    case "$1" in
+    *sh-np*)    echo 0; echo 0; echo 0; echo 0; return;;
+    *) ;;
+    esac

     wc -l < $1
     wc -l < $1
@@ -88,6 +90,10 @@ echo extern
 FN=$TMPDIR/bashtest-$$
 cat >$FN << \EOF
 wc -l < $1
+case "$1" in
+*sh-np*)    echo 0; echo 0; echo 0; echo 0; return;;
+*) ;;
+esac
 wc -l < $1
 wc -l < $1
 true | wc -l < $1
-- 
2.17.1

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Procsub.tests on OSes using named pipes "CHIGOT, CLEMENT" <clement.chigot@atos.net> - 2020-02-20 14:32 +0000

csiph-web