From patchwork Tue Apr 9 01:49:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 88210 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 D37A1385B50A for ; Tue, 9 Apr 2024 01:50:25 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 3747A3858410 for ; Tue, 9 Apr 2024 01:50:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3747A3858410 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3747A3858410 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::634 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712627403; cv=none; b=l7K39QZ70KTsiS+f7GSsUI4dCtIW9/esQ+z0mHob+DFi20/x8xlBJNgc+1O1BVvqVNRIvV6BCCPI5o2wLtBDfB2RLY5HDuWGekjZzUJcx81DNn7F2i/tche7QnVn47YvHLxmBVPsSrEbMm0kwmnYZ9KLCOT5hw3m5xBp9Iqb2YQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712627403; c=relaxed/simple; bh=dmD1qJcb5AiOebBLGuq9ziPorw7HWUVg8TbbnU7RoP0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nu1Z2FVdncImA9yXLOUHnfqfXvNPyF5G7/07vgbXwq/Q+pAY0OWEyl3bwOmzk61VQEm/h00b1rq6yumjsz5t1/aVzihzrgm+o4Vij/sFwa53819WKU9pmyDv/xl4AkgjQri78XgJLCieai74zXqbPr/FFpQlA2/P0uNwR97vyBA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1e3e56c9d2cso19733845ad.1 for ; Mon, 08 Apr 2024 18:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712627398; x=1713232198; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=BukZiIKokzX//hcy0ryNVt7/ByvcKdXu8jRSFPJjiZk=; b=YomzdUBuAW5TO/dSLvGJUN1473vffjc1ke3BB2OalwjNiw/+GnDJKAtKYRR9pQ6kSy hR12CrHs1Ed6WP4aVN9H0z92aGvozjLrP0+lBZxy6Evaxjd59WVXyZquglhZA3zAEx20 sJg6BC4L8IH0NdP58+qAUBWxrQTIxhazA5B/iekgknqjWoXn2k2O14SSmtMWHbx40L9b r4R7TcQWK7n95QEuAvfsIQkpnvASI28pEDvCEFxR7KG6EfWmDL+IiLTRJcz/F9ayzxWn XyRr9c96rgKG++wIcxdc3AMCGuUiIENFRT4ClmkWzKTyvylrOmxZhi+IN/pNfcs3LhgE QRUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712627398; x=1713232198; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BukZiIKokzX//hcy0ryNVt7/ByvcKdXu8jRSFPJjiZk=; b=pEkgdRtdELMcosRw/nREFGmMV8p66CX2ciZf45lMLSD79WVMXeLjzHJ2gXExUx3+6c QyKcmED8eIp4be4NSRFRCnZ8RhJocieITWak1TtrwVn4B5tsuRGVDd6AH6lLL3/AIMlk wAFd4R0EK60+zOyGVyjbpzBkt1ToTeU+VRhPzMReNiIjshC35OkBkxwDL08MedrW0/xP CN+8ZUPdYvZChBsohbn2IDPC+R/7nfXgnRPnFGECUBxXV3ZfDQkm6n4lFo1dhCOatVDa XP6m+gUbKTMYk2wH4jtejUQHWlQkvyE4oEUtkDF3H7DbNL+vFLX532Nv74RWjp88N3Rt A9Gg== X-Gm-Message-State: AOJu0YzUBzL8MLI6DTuz2MZrNev0VkXI/a+AG2SZ4BXvQq1FHUEF6vG2 gy04T9bW95fXfs0Bwdt7pH0O0AccQrx1NHu9zd40D39i8XgQDYcjq9D6nN8b X-Google-Smtp-Source: AGHT+IFEt+8FXfFSfLI6Hr2A9QBrkyodcpsSSoF3xdC+kFipTz1jxECF+NC0gz1LRR19Fgw8OAluGg== X-Received: by 2002:a17:902:e882:b0:1e3:e1d5:c680 with SMTP id w2-20020a170902e88200b001e3e1d5c680mr9279894plg.63.1712627397984; Mon, 08 Apr 2024 18:49:57 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.56.169.48]) by smtp.gmail.com with ESMTPSA id y17-20020a170903011100b001e49428f313sm294515plc.261.2024.04.08.18.49.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 18:49:57 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 4C9DB7400AC for ; Mon, 8 Apr 2024 18:49:56 -0700 (PDT) From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH v2] nptl: Add tst-pthread-key1-static for BZ #21777 Date: Mon, 8 Apr 2024 18:49:56 -0700 Message-ID: <20240409014956.1068847-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3020.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Add a static pthread static tests to verify that BZ #21777 is fixed. Reviewed-by: Florian Weimer --- nptl/Makefile | 2 ++ nptl/tst-pthread-key1-static.c | 37 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 nptl/tst-pthread-key1-static.c diff --git a/nptl/Makefile b/nptl/Makefile index bf09603e7b..b3f8af2e1c 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -315,6 +315,7 @@ tests = \ tst-pthread-defaultattr-free \ tst-pthread-gdb-attach \ tst-pthread-gdb-attach-static \ + tst-pthread-key1-static \ tst-pthread-timedlock-lockloop \ tst-pthread_exit-nothreads \ tst-pthread_exit-nothreads-static \ @@ -536,6 +537,7 @@ tests-static += \ tst-mutex8-static \ tst-mutexpi8-static \ tst-pthread-gdb-attach-static \ + tst-pthread-key1-static \ tst-pthread_exit-nothreads-static \ tst-sem11-static \ tst-sem12-static tst-cond11-static \ diff --git a/nptl/tst-pthread-key1-static.c b/nptl/tst-pthread-key1-static.c new file mode 100644 index 0000000000..1d02996c86 --- /dev/null +++ b/nptl/tst-pthread-key1-static.c @@ -0,0 +1,37 @@ +/* Verify that static pthread executable works. + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +pthread_key_t k; + +static int +do_test (void) +{ + int rc; + + rc = pthread_key_create (&k, NULL); + TEST_VERIFY (rc == 0); + rc = pthread_setspecific(k, NULL); + TEST_VERIFY (rc == 0); + + return 0; +} + +#include