From patchwork Wed Sep 4 18:50:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 97100 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 62685384F01B for ; Wed, 4 Sep 2024 18:51:06 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 0BCB33858424 for ; Wed, 4 Sep 2024 18:50:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0BCB33858424 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0BCB33858424 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725475833; cv=none; b=n9aOhUo+k45qULg/qR8dXh7najvIPI3m+U8UTHmtUmFSvVCyRsBX2ypTkOm0kdS1TB1CDmAgADfjgYvaY0cdhMKhbErQ4ooCX7MsRrBUtsJMmTtuMf0eWS7jJgkpmCgswp1jsPNs6e7GHkNpel84J4BtGsYRdYPeQbixhv/Zd4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725475833; c=relaxed/simple; bh=GLjf5WNUa2sIel0FD0CqmjvAWUliXWG5oJOBiZjZgVI=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=IKNlrs1jMtNwdtGn244mNbmgtCK+rsUjd94UlbHEgzDaVcqgv96dfg8DIxslY1h0AqvfFEx6AE8DUfdnn/5GWk29uCarOlGCMMx8gnUmIfgnGrcG3xPVvAQmmw4l6RGMHaB2H1ArTrh0YZr7i8zWLv5q3GU19/cajJqezx3gAEY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725475830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qzEXZPgzeijLn4gGHhl7U4D0BAktf2x/2CACvoFt1KQ=; b=YiPnJslyr2xyc089M6r+VgciBR4I6joOBVaZ90k0rNLXPjqnF3UxLOLLnROh5rtlA9eBOl Ak2XITmlzn+g5U/SI4CxZlspUvkgqw4cZooP59iKpgTNqzXnSI3lH6ShcvIdbm6BACOOUU YxwvYO0VSVwMSvxI735H9VCv/qwmNFs= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-35-E6jaJPqlOsqepmxEiX-ETA-1; Wed, 04 Sep 2024 14:50:29 -0400 X-MC-Unique: E6jaJPqlOsqepmxEiX-ETA-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 712DF1953940 for ; Wed, 4 Sep 2024 18:50:28 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.35]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 81DF21955F44 for ; Wed, 4 Sep 2024 18:50:27 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 1/4] elf: Update DSO list, write audit log to elf/tst-audit23.out In-Reply-To: Message-ID: References: X-From-Line: ab406d5b54ac0f5f2faee60aabd35863e43b0ef6 Mon Sep 17 00:00:00 2001 Date: Wed, 04 Sep 2024 20:50:25 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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 After commit 1d5024f4f052c12e404d42d3b5bfe9c3e9fd27c4 ("support: Build with exceptions and asynchronous unwind tables [BZ #30587]"), libgcc_s is expected to show up in the DSO list on 32-bit Arm. Do not update max_objs because vdso is not tracked (and which is the reason why the test currently passes even with libgcc_s present). Also write the log output from the auditor to standard output, for easier test debugging. Reviewed-by: Adhemerval Zanella --- elf/tst-audit23.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/elf/tst-audit23.c b/elf/tst-audit23.c index d2640fe8b2..895dab08ea 100644 --- a/elf/tst-audit23.c +++ b/elf/tst-audit23.c @@ -85,13 +85,28 @@ do_test (int argc, char *argv[]) = support_capture_subprogram (spargv[0], spargv, NULL); support_capture_subprocess_check (&result, "tst-audit22", 0, sc_allow_stderr); + { + FILE *fp = fmemopen (result.err.buffer, result.err.length, "r"); + TEST_VERIFY (fp != NULL); + unsigned int line = 0; + char *buffer = NULL; + size_t buffer_length = 0; + puts ("info: *** audit log start ***"); + while (xgetline (&buffer, &buffer_length, fp)) + printf ("%6u\t%s", ++line, buffer); + puts ("info: *** audit log end ***"); + free (buffer); + xfclose (fp); + } + /* The expected la_objopen/la_objclose: 1. executable 2. loader 3. libc.so - 4. tst-audit23mod.so - 5. libc.so (LM_ID_NEWLM). - 6. vdso (optional and ignored). */ + 4. libgcc_s.so (one some architectures, for libsupport) + 5. tst-audit23mod.so + 6. libc.so (LM_ID_NEWLM). + vdso (optional and ignored). */ enum { max_objs = 6 }; struct la_obj_t { @@ -115,8 +130,10 @@ do_test (int argc, char *argv[]) TEST_VERIFY (out != NULL); char *buffer = NULL; size_t buffer_length = 0; + unsigned int line = 0; while (xgetline (&buffer, &buffer_length, out)) { + ++line; if (startswith (buffer, "la_activity: ")) { uintptr_t cookie; @@ -174,8 +191,8 @@ do_test (int argc, char *argv[]) if (is_vdso (lname)) continue; if (nobjs == max_objs) - FAIL_EXIT1 ("non expected la_objopen: %s %"PRIxPTR" %ld", - lname, laddr, lmid); + FAIL_EXIT1 ("(line %u) non expected la_objopen: %s %"PRIxPTR" %ld", + line, lname, laddr, lmid); objs[nobjs].lname = lname; objs[nobjs].laddr = laddr; objs[nobjs].lmid = lmid;