From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 5CC611F4B4 for ; Wed, 6 Jan 2021 06:30:53 +0000 (UTC) Received: from localhost ([::1]:48344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kx2LM-0008Mc-3o for normalperson@yhbt.net; Wed, 06 Jan 2021 01:30:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kx2LF-0008MC-4h for bug-gnulib@gnu.org; Wed, 06 Jan 2021 01:30:45 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.161]:26258) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kx2L9-000400-W2 for bug-gnulib@gnu.org; Wed, 06 Jan 2021 01:30:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1609914637; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:From:Subject:Sender; bh=GddW7OFv1IKneOA3Rf11decdhAFiOqE358609F8cuvY=; b=s2UdImr5/lX8k7DixdZvi63/j4Hsclm0pSsUpjJoVH3UsGok2B5A7AMslyXaw97PEY nGPXs0M6O/ErbKNdNOy6et0TNOK/HHfT7GLR/zAzI8EWkppdtgqw1dmgFGOa3gvmia7M T78cWrTEPS/C20uMChy3KpkJ/Pz0nNYYM5iTw/2mpNdjQnrp+X/FPWbN7vEFTdMJRpF3 Vcx/7Bxr6UeO9GY/XsgcIrOFkxEZebzEEyAPUOKaxA1QVRhiUzIm1eUDJTDjI01E5zkz cbiEdju5SaPJbsDqi8woKjw0SDiQpzWTVePTM1+Y/seV8EPPOCKX/Kj50twDNzX3rNep a8uw== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOHqf3yZdW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 47.10.7 DYNA|AUTH) with ESMTPSA id e012d5x066Uaogi (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Wed, 6 Jan 2021 07:30:36 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: pipe-filter-gi: Fix test failure on AIX 7.2 Date: Wed, 06 Jan 2021 07:30:35 +0100 Message-ID: <3378083.Zs5zEFBGtD@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.161; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" On AIX 7.2, I see a test failure: FAIL: test-pipe-filter-gi1.sh ============================= test-pipe-filter-gi1: write to tr subprocess failed: Resource temporarily unavailable FAIL test-pipe-filter-gi1.sh (exit status: 1) What happens is: While writing to a pipe, through a file descriptor in non-blocking mode, after select() reported that the file descriptor is writeable, write() of a block of 29 KB of data fails with errno = EAGAIN. This is persistent; it does not go away by retrying even hundreds of times. Other OSes would have done a partial write and returned a positive return code. (Especially as 1. the file descriptor refers to a pipe, not a regular file, and 2. it is in non-blocking mode.) AIX, however, forces the program to do the throttling by itself: Limiting the write to 4 KB works around the issue. 2021-01-05 Bruno Haible pipe-filter-gi: Fix test failure on AIX 7.2. * lib/pipe-filter-aux.h (SSIZE_MAX) [AIX]: Set to 4096. diff --git a/lib/pipe-filter-aux.h b/lib/pipe-filter-aux.h index 294a27e..2977260 100644 --- a/lib/pipe-filter-aux.h +++ b/lib/pipe-filter-aux.h @@ -26,6 +26,15 @@ _GL_INLINE_HEADER_BEGIN #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif +#ifdef _AIX +/* On AIX, despite having select() and despite having put the file descriptor + in non-blocking mode, it can happen that select() reports that fd[1] is + writable but writing a large amount of data to fd[1] then fails with errno + EAGAIN. Seen with test-pipe-filter-gi1 on AIX 7.2, with data sizes of + 29 KB. So, limit the size of data passed to the write() call to 4 KB. */ +# undef SSIZE_MAX +# define SSIZE_MAX 4096 +#endif /* We use a child process, and communicate through a bidirectional pipe. To avoid deadlocks, let the child process decide when it wants to read