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-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 955441F8C6 for ; Thu, 8 Jul 2021 23:23:56 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 84F573858018 for ; Thu, 8 Jul 2021 23:23:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84F573858018 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1625786635; bh=+Lv/a2Jid+XBzXu/r0KpiE0EpxZS0BFSO9X5yDXB/M4=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=y0iAgrpyIpo2a6Nh4Ys4cBiy0l4HJTpOO78hrd58uP5FzG5EyYOaEJ1ISPa3M/HPY OwlJJvHtvrclXectzCbzujNk+G2ZMdp9gH3FhRsQ2g6YyEIrZr1F59qBqg6TkCGHkx vD55jKcWBRYAvu067vrsCmagygYHtgtNIUu6dahA= Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 609B73AAA0AE for ; Thu, 8 Jul 2021 23:23:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 609B73AAA0AE Received: by mail-pl1-x632.google.com with SMTP id a14so4049081pls.4 for ; Thu, 08 Jul 2021 16:23:23 -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:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+Lv/a2Jid+XBzXu/r0KpiE0EpxZS0BFSO9X5yDXB/M4=; b=brpxDx2YcpLx3LyM8mWmnPdJlMCo7RGr/acj2MDI8/iBAmYOJgnHoNZ32+kjRJzt/+ aZTD92lIvltUwnvmOWA4BjbzYTtSvTPnC/CfPGEKMrFVNFmsWZoKanVtfj5egOi+UxRY o++/hXkltX52ZwKaobglSJHxwnwAk24PIYeSoZ/Nb8uPNumejpdGCdPRjemkJAex3w2+ mdHev1WtRW38AAJCfdr73uHbrFLljweNF6QqVuG+rxx7NMmF6V6AXt+cyNRiMIW4iB9d Kc05PVD8Yq+TfvFHHQEzikidpxKUEEnHoLwN92iLk2D9I9nFz2k7e/my+ifIdE0cQd8R QPpQ== X-Gm-Message-State: AOAM532vMvL6w5pqBo1YxQiuZV1dp7+yl2I3rf9WYUX9/uaVnn6b0KMJ WzVjJc/nJ/r9PxMx+RlivxmqdHIfrGxqzA== X-Google-Smtp-Source: ABdhPJwI1DouQyO44rq3oLZ0LM4Kjh9ABtx7VKjcE01bM3EppgIOcG2ZB+X9I3IgpKai9fxymeX9FA== X-Received: by 2002:a17:90b:e05:: with SMTP id ge5mr7438723pjb.93.1625786602300; Thu, 08 Jul 2021 16:23:22 -0700 (PDT) Received: from [192.168.1.108] ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id gd19sm5082152pjb.38.2021.07.08.16.23.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jul 2021 16:23:21 -0700 (PDT) Subject: Re: [PATCH v7 4/4] posix: Add posix_spawn_file_actions_addclosefrom_np To: "H.J. Lu" References: <20210706145839.1658623-1-adhemerval.zanella@linaro.org> <20210706145839.1658623-5-adhemerval.zanella@linaro.org> <87pmvsswkx.fsf@oldenburg.str.redhat.com> <3fcf5bc3-30b8-25a3-896b-7ca11c4c4bf8@linaro.org> Message-ID: Date: Thu, 8 Jul 2021 20:23:18 -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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , From: Adhemerval Zanella via Libc-alpha Reply-To: Adhemerval Zanella Cc: Florian Weimer , Adhemerval Zanella via Libc-alpha Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 08/07/2021 18:54, H.J. Lu wrote: > On Thu, Jul 8, 2021 at 9:12 AM Adhemerval Zanella via Libc-alpha > wrote: >> >> >> >> On 08/07/2021 11:34, Florian Weimer wrote: >>> Some of the new files use: >>> >>>> + . */ >>> >>> That should be: https:// >> >> Ack. >> >>> >>>> +/* Called on process re-execution. The arguments are the expected opened >>>> + file descriptors. */ >>>> +_Noreturn static void >>>> +handle_restart (int argc, char *argv[]) >>>> +{ >>>> + size_t nfds = argc > 1 ? argc - 1 : 0; >>>> + struct fd_t >>>> + { >>>> + int fd; >>>> + _Bool found; >>>> + } *fds = xmalloc (sizeof (struct fd_t) * nfds); >>>> + for (int i = 0; i < nfds; i++) >>>> + { >>>> + char *endptr; >>>> + long unsigned int fd = strtoul (argv[i+1], &endptr, 10); >>>> + if (*endptr != '\0' || fd > INT_MAX) >>>> + FAIL_EXIT1 ("readdir: invalid file descriptor value: %s", argv[i]); >>> >>> Should be: >>> >>> FAIL_EXIT1 ("argv[%d]: invalid file descriptor value: %s", i, argv[i]); >> >> Ack. >> >>> >>>> @@ -344,7 +346,9 @@ __spawnix (pid_t * pid, const char *file, >>>> /* We need at least a few pages in case the compiler's stack checking is >>>> enabled. In some configs, it is known to use at least 24KiB. We use >>>> 32KiB to be "safe" from anything the compiler might do. Besides, the >>>> - extra pages won't actually be allocated unless they get used. */ >>>> + extra pages won't actually be allocated unless they get used. >>>> + It also acts the slack for spawn_closefrom (including MIPS64 getdents64 >>>> + where it might use about 1k extra stack space. */ >>> >>> Missing closing parenthesis. >>> >>> Rest looks okay to me, thanks. No need to post a new verison, I think. >> >> Thanks, I will respin another round of tests and commit. > > On x86-64, I saw: > > FAIL: posix/tst-spawn5 > > https://sourceware.org/bugzilla/show_bug.cgi?id=28067 > > Has anyone else seen it? I reproduced it with --enable-hardcoded-path-in-tests, this is most likely something wrong I doing with the parameters to respawn the process. I will fix it.