From patchwork Tue Mar 9 12:55:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Dasmohapatra X-Patchwork-Id: 42400 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 79393382E06B; Tue, 9 Mar 2021 12:56:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 79393382E06B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615294565; bh=fTmVeLRkiREDBhyKvZ27IW2/G2LPt+XKZl4OT1+mw2w=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=nmwS8oey0wpe4MRFzG26S6zkennADNr6q2yb0yKSTxpwUSFevLB//Tq89t7d7uf5K 8Bo5k0A2HS3f/PSRvQY2Ked55fQwGht+OIzBdD+l0Vl3eHiIDrobkMYSloTXlmp4FH pLurRKtjbeKne9ErWB4G+jlw+ogichud1bdD0Ri0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by sourceware.org (Postfix) with ESMTPS id 2867F386F455 for ; Tue, 9 Mar 2021 12:56:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2867F386F455 Received: from noise.cbg.collabora.co.uk (unknown [IPv6:2001:4d48:ad5c:ef00:8e70:5aff:fe59:c29c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vivek) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 09CE31F45545 for ; Tue, 9 Mar 2021 12:55:58 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [RFC][PATCH v9 7/7] Restore separate libc loading for the TLS/namespace storage test Date: Tue, 9 Mar 2021 12:55:45 +0000 Message-Id: <20210309125545.6204-8-vivek@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210309125545.6204-1-vivek@collabora.com> References: <20210309125545.6204-1-vivek@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: =?utf-8?q?Vivek_Das=C2=A0Mohapatra_via_Libc-alpha?= From: Vivek Dasmohapatra Reply-To: =?utf-8?q?Vivek_Das=C2=A0Mohapatra?= Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" tst-tls-ie-dlmopen checks to see that new namespaces consume TLS memory as expected: This does not happen when new namespaces share the same libc instance (since TLS is allocated only when a new libc instance insitialises its threading infrastructure). Adding RTLD_ISOLATE to the dlmopen flags in the test restores the old behaviour which allows the test to check what it actually needs to. --- elf/tst-tls-ie-dlmopen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elf/tst-tls-ie-dlmopen.c b/elf/tst-tls-ie-dlmopen.c index a579d72d2d..e67017db2d 100644 --- a/elf/tst-tls-ie-dlmopen.c +++ b/elf/tst-tls-ie-dlmopen.c @@ -53,7 +53,7 @@ static void * load_and_access (Lmid_t lmid, const char *mod, const char *func) { /* Load module with TLS. */ - void *p = xdlmopen (lmid, mod, RTLD_NOW); + void *p = xdlmopen (lmid, mod, RTLD_NOW|RTLD_ISOLATE); /* Access the TLS variable to ensure it is allocated. */ void (*f) (void) = (void (*) (void))xdlsym (p, func); f (); @@ -95,7 +95,7 @@ do_test (void) than 1024 bytes are available (exact number depends on TLS optimizations and the libc TLS use). */ printf ("The next dlmopen should fail...\n"); - void *p = dlmopen (LM_ID_BASE, "tst-tls-ie-mod4.so", RTLD_NOW); + void *p = dlmopen (LM_ID_BASE, "tst-tls-ie-mod4.so", RTLD_NOW|RTLD_ISOLATE); if (p != NULL) FAIL_EXIT1 ("error: expected dlmopen to fail because there is " "not enough surplus static TLS.\n");