From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id B81E8384BC11 for ; Fri, 9 Jul 2021 13:10:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B81E8384BC11 Received: by mail-pf1-x434.google.com with SMTP id q10so8637950pfj.12 for ; Fri, 09 Jul 2021 06:10:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=67F15YCLapG+EPeYeH5oxEc7DCIKtT2dt4X8u9Fsls4=; b=evLg9DUoWiDs4g1e4V4AeIW8pesilabhyVtqpCBUPRVgjPeGabuJJyoiacZdEWFGgR vf1MaIt3e2qJXzDJOCfx/8viyz8e/OcHTQY9YcJCKFdoO2B8LwCBVmoUV0eNpnj16enb BMeeurpJprpuDBnz1/cpMVFk0C4tjMN60nZqiee2QSl8TbcPJFvkRRHEnkFLYU94t0CB 3+J18YHOgJ3z3Xyhl4LQEanbqwVZYC54q7XSqmf5a2f8hkR6UNoviQ/vD8BZyYws4xUI ayO8jN0b4NZQfpk4VKnMsPcAq2AR5PVbYhJh/fFD4+yQHCnaT9KF1f7XDUmqWRefSSWP cdAg== X-Gm-Message-State: AOAM533XAiWvNgULuNYAff+JvKg1+KxwBRu+dXZOLZu6eaVbsWf6vUWc moLv4YNvjCSQ4G0nmi44zfWuXpYUU0Yvxg== X-Google-Smtp-Source: ABdhPJyTvfosbBB+gfOK7ajCpmXcPRcfoXQRF/jU7qr34dovtg1MZPomCkMivCBGXa9tnXxDaFymBQ== X-Received: by 2002:a65:610c:: with SMTP id z12mr38405646pgu.453.1625836215626; Fri, 09 Jul 2021 06:10:15 -0700 (PDT) Received: from [192.168.1.108] ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id m34sm7300347pgb.85.2021.07.09.06.10.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Jul 2021 06:10:14 -0700 (PDT) Subject: Re: posix/tst-spawn5 failes under make -j To: Florian Weimer , libc-alpha@sourceware.org References: <87czrrizw0.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella Message-ID: <983c2a7f-b4f0-07b0-ba65-3f96e5bd8165@linaro.org> Date: Fri, 9 Jul 2021 10:10:12 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87czrrizw0.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2021 13:10:27 -0000 On 09/07/2021 06:45, Florian Weimer wrote: > This patch adds some additional diagonstics: > > diff --git a/posix/tst-spawn5.c b/posix/tst-spawn5.c > index 277b848794..5ba7c7fadb 100644 > --- a/posix/tst-spawn5.c > +++ b/posix/tst-spawn5.c > @@ -116,7 +116,11 @@ handle_restart (int argc, char *argv[]) > fds[i].found = found = true; > > if (!found) > - FAIL_EXIT1 ("unexpected open file descriptor: %ld", fd); > + { > + char *path = xasprintf ("/proc/self/fd/%s", e->d_name); > + char *resolved = xreadlink (path); > + FAIL_EXIT1 ("unexpected open file descriptor %ld: %s", fd, resolved); > + } > } > closedir (dirp); > > It's the pipe from the make job server: > > error: tst-spawn5.c:122: unexpected open file descriptor 3: pipe:[9958839] > > I think the test needs to be changed so that lowfd is passed across the > restart, and checking only considers descriptors >= lowfd. The restart process already receive a list of the expected opened files, for instance on my environment it will re-executed with: handle_restart: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 handle_restart: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 handle_restart: 3 handle_restart: handle_restart: 3 4 I am trying to reproduce the issue without much success, even with make -j or make posix/tests -j. Maybe we can limit the search to the argument range: diff --git a/posix/tst-spawn5.c b/posix/tst-spawn5.c index e04a6a8088..a9a3aa5d8d 100644 --- a/posix/tst-spawn5.c +++ b/posix/tst-spawn5.c @@ -68,6 +68,8 @@ handle_restart (int argc, char *argv[]) int fd; _Bool found; } *fds = xmalloc (sizeof (struct fd_t) * nfds); + int maxfd = 0; + int minfd = INT_MAX; for (int i = 0; i < nfds; i++) { char *endptr; @@ -77,6 +79,11 @@ handle_restart (int argc, char *argv[]) fds[i].fd = fd; fds[i].found = false; + + if (fd < minfd) + minfd = fd; + if (fd > maxfd) + maxfd = fd; } DIR *dirp = opendir (FD_TO_FILENAME_PREFIX); @@ -109,6 +116,8 @@ handle_restart (int argc, char *argv[]) || fd == STDOUT_FILENO || fd == STDERR_FILENO) continue; + if (fd < minfd || fd > maxfd) + continue; bool found = false; for (int i = 0; i < nfds; i++)