From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id E1D2F3858D28 for ; Wed, 3 Nov 2021 17:35:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1D2F3858D28 Received: by mail-qt1-x831.google.com with SMTP id v22so1608930qtk.9 for ; Wed, 03 Nov 2021 10:35:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=Ho0ojxwKCmF0QWP/Q9if3uQ3diyQnlcNdHns5lQH/qc=; b=4FQJm2Mbmp5oaYq3uP28N96USwPKa+0fPllViuVlngPKuN8o3cxHi6kreq/GsoCyIh ppru1Ma/rJosea7e15CtuTUyjPy8IstA9tkiFeysXmseKdu2K972+T1AS6O+kgzzSxMN CuZdD1+/kIuB/j/deIuPHgyxd3DOjO0ab91C6zRiWOMtJRDonsLkamUEQ1zGe7YFsr16 Te4s3wjJvzI3fHvuAnwp6Imdqj71H3CkAx9v0/agWN/bYlY8QBdMhBTjoxIya8ORt94O 84932vIn9aEzajqmpL+GpmsYCboy+bT/mHoXerJHhAbVAUuS7Lk4Pn8BYH02JZqaL4lh mOUQ== X-Gm-Message-State: AOAM531IjPhxJwAEdQjj9lS/n8Ed4bWoZ2sLR9fDsSd2tBpP0JtFgW3c ypHXaq8SY8LXt6N9a7Z01JkUQw== X-Google-Smtp-Source: ABdhPJzKnrQ1Olh5W2USqSgHJaBb97uukzQmw8IFZRJrgyydLq/LDPxx4NEkmdoD8WR/4FEF13UYQw== X-Received: by 2002:a05:622a:1647:: with SMTP id y7mr47717284qtj.370.1635960954384; Wed, 03 Nov 2021 10:35:54 -0700 (PDT) Received: from ?IPV6:2804:431:c7cb:b64f:c336:789a:89cc:169? ([2804:431:c7cb:b64f:c336:789a:89cc:169]) by smtp.gmail.com with ESMTPSA id g8sm2153451qtk.75.2021.11.03.10.35.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Nov 2021 10:35:54 -0700 (PDT) Message-ID: Date: Wed, 3 Nov 2021 14:35:51 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH v2] tst-tzset: output reason when creating 4GiB file fails Content-Language: en-US To: Stafford Horne , GLIBC patches References: <20211102233159.4094554-1-shorne@gmail.com> From: Adhemerval Zanella In-Reply-To: <20211102233159.4094554-1-shorne@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-14.9 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: Wed, 03 Nov 2021 17:35:56 -0000 On 02/11/2021 20:31, Stafford Horne wrote: > Currently, if the temporary file creation fails the create_tz_file > function returns NULL. The NULL pointer is then passed to setenv which > causes a SIGSEGV. Rather than failing with a SIGSEGV print a warning > and exit. > > Cc: Adhemerval Zanella LGTM, thanks. Reviewed-by: Adhemerval Zanella > --- > Changes since v1: > - Use PRId64 printf formatting, suggested by Adhemerval > > timezone/tst-tzset.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/timezone/tst-tzset.c b/timezone/tst-tzset.c > index d6da2932bb..3dad42e041 100644 > --- a/timezone/tst-tzset.c > +++ b/timezone/tst-tzset.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > > static int do_test (void); > #define TEST_FUNCTION do_test () > @@ -103,6 +104,13 @@ static void > test_tz_file (off64_t size) > { > char *path = create_tz_file (size); > + if (path == NULL) > + { > + printf ("creating timezone file of size: %" PRId64 "MiB failed.\n", > + size / (1024 * 1024)); > + exit (1); > + } > + > if (setenv ("TZ", path, 1) < 0) > { > printf ("setenv failed: %m\n"); >