From patchwork Thu Oct 28 21:23:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 46764 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F27623857821 for ; Thu, 28 Oct 2021 21:23:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F27623857821 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1635456208; bh=0xUi1dHH28G4BGOhhutB08MtieOBp4BIK3DHbGwucZY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=L09U/gFbx+F/BZYocHyT3lVT1P+yyaxluDemnntwszQLgqlcO87CRhWRJPXEp1k2x /NevnqZ5rw2vwW3YEfEwTCYzSdZHqHaDdXnW7nRzCHNrZRlf/64MluDWB5xx+DWq1k 9hpaML1O2J0H/pvNhGVh2v4kbaRiRbAwGKYjHoWA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 22D883858416 for ; Thu, 28 Oct 2021 21:23:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 22D883858416 Received: by mail-pl1-x630.google.com with SMTP id n18so5370187plc.2 for ; Thu, 28 Oct 2021 14:23:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0xUi1dHH28G4BGOhhutB08MtieOBp4BIK3DHbGwucZY=; b=NAlSZ5mHqYfvm9oxM1zdJQYbWsdii38JxbKRugTPxZsaav2+4mCPIIHEFNkq9399Gv 0Ks/hwcPNx078Hq24P2ytMENaGBLZoiJX/Jqw9MR8R2pB9Hi3vCOdWuh+Z821ZBd32g+ ygsao3ScGonWDgC0DeXfl9ZpPG6WFpC3+CqtMitpWSK1jQtN/B287bXcKgTxtC8jjSsI tJK9kK9UHwkpL2UomY7WzzTxO1JUpbe3yOyphjOeUbZ1C1dFpEydY3hN8VsCdq7xCEBQ yUmcvvuveqcIJ8yhl6vRVo4yEQUR/AQsDWQz6GHVaBKJEVWh+z5rY6bLD0dX+1waLVTV CWSw== X-Gm-Message-State: AOAM530jCcz1kUuqdFYOtFlX0P1UrKNvhvJ3qiDOrDnpu9W/wMrl5ayV 87aPUWXHr6FhyPVwFLv0lxAjN8GEnqg= X-Google-Smtp-Source: ABdhPJy3j726lQq6ht/gmybg9GVa80m2IUWfi3Ax7hBWfo1TPNH3+QCouSL66QVNEUH6HARRiVTDwQ== X-Received: by 2002:a17:90a:930d:: with SMTP id p13mr7194797pjo.171.1635456184983; Thu, 28 Oct 2021 14:23:04 -0700 (PDT) Received: from localhost ([2409:10:24a0:4700:e8ad:216a:2a9d:6d0c]) by smtp.gmail.com with ESMTPSA id p9sm4283840pfn.7.2021.10.28.14.23.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 14:23:04 -0700 (PDT) To: GLIBC patches Subject: [PATCH] tst-tzset: output reason when creating 4GiB file fails Date: Fri, 29 Oct 2021 06:23:00 +0900 Message-Id: <20211028212300.2311323-1-shorne@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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-Patchwork-Original-From: Stafford Horne via Libc-alpha From: Stafford Horne Reply-To: Stafford Horne Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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. --- timezone/tst-tzset.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/timezone/tst-tzset.c b/timezone/tst-tzset.c index d6da2932bb..e6aef6bf51 100644 --- a/timezone/tst-tzset.c +++ b/timezone/tst-tzset.c @@ -103,6 +103,13 @@ static void test_tz_file (off64_t size) { char *path = create_tz_file (size); + if (path == NULL) + { + printf ("creating timezone file of size: %lld MiB failed.\n", + size / (1024 * 1024)); + exit (1); + } + if (setenv ("TZ", path, 1) < 0) { printf ("setenv failed: %m\n");