Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2195604/?format=api
{ "id": 2195604, "url": "http://patchwork.ozlabs.org/api/patches/2195604/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20260211135944.2066869-3-fberat@redhat.com/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260211135944.2066869-3-fberat@redhat.com>", "list_archive_url": null, "date": "2026-02-11T13:59:44", "name": "[v4,2/2] feat(rtld): Allow LD_DEBUG category exclusion", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "fdae1d360631d3e3412bae8e65d2337d5281d67d", "submitter": { "id": 84672, "url": "http://patchwork.ozlabs.org/api/people/84672/?format=api", "name": "Frédéric Bérat", "email": "fberat@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20260211135944.2066869-3-fberat@redhat.com/mbox/", "series": [ { "id": 491846, "url": "http://patchwork.ozlabs.org/api/series/491846/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=491846", "date": "2026-02-11T13:59:44", "name": "Enhancing LD_DEBUG with TLS logging and category exclusion support", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/491846/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2195604/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2195604/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "libc-alpha@sourceware.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "libc-alpha@sourceware.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=Z8edEUs2;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=Z8edEUs2", "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com", "sourceware.org; spf=pass smtp.mailfrom=redhat.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.129.124" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fB0Sq3Dq6z1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 01:00:43 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 61E854B9DB48\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 11 Feb 2026 14:00:41 +0000 (GMT)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id 458974BA2E0A\n for <libc-alpha@sourceware.org>; Wed, 11 Feb 2026 13:59:59 +0000 (GMT)", "from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-575-j2KmxX2ZO8uJaa24H4I5wQ-1; Wed,\n 11 Feb 2026 08:59:56 -0500", "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 943791956068; Wed, 11 Feb 2026 13:59:55 +0000 (UTC)", "from Nymeria-redhat.redhat.com (unknown [10.44.33.163])\n by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id 925BC180066A; Wed, 11 Feb 2026 13:59:54 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 61E854B9DB48", "OpenDKIM Filter v2.11.0 sourceware.org 458974BA2E0A" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 458974BA2E0A", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 458974BA2E0A", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770818404; cv=none;\n b=JCsludGXROaLlQbemCjv+LREyhC17yYvd3bQXN4VtW2wml/dQa+DhZU+Tl263gWkzHUxcu4NH+cTgaR5EW6Kmm20LlKjMiVlxjwk5u9BnoIO4SmWYWiQeJPiYWnRzzSfM95g4ItH7SExi9YkoRZ59t6qS/6YVKe6bPZAN/yZsVE=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1770818404; c=relaxed/simple;\n bh=WLAslM2yUViaGj8tz7Zv9rCZs7thV8/UI6wvOLMlLJs=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=v5LNmtKwzkL7k/00i3AAZ3cH7SGFfkivChQSABtrji1btBN/oattwMfuG+AQWSOw9mElPOZgAgp+fA2jtoKDjPI/13BW35+mSgjgwQTFqjOfTt3HGwQExQg5J0Xlsmljr0cWGhMM+Lj8ggpNybIZzZ24t4thBS4av5XgdjQ+xGs=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1770818398;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=E8GIMrLwwXvLvcjXfUxTYloZ3KHVZuAVqwcEuCGC0nc=;\n b=Z8edEUs2V5jdlrQrkqmKI9C4js4Z5Z+xXn30E8Y5SREAd60aiKmWMQsdNbsYlMO1aze1jo\n Ge1OK2hAzUqUVMvC/5LIkNlfQJSbNKqNHT7OSchIeFf7O+K/8SInT7eO8WqdZMy/Jjbv7i\n JyQin7evxtuEkR5ssfYuBlzzArpVzyk=", "X-MC-Unique": "j2KmxX2ZO8uJaa24H4I5wQ-1", "X-Mimecast-MFC-AGG-ID": "j2KmxX2ZO8uJaa24H4I5wQ_1770818395", "From": "=?utf-8?b?RnLDqWTDqXJpYyBCw6lyYXQ=?= <fberat@redhat.com>", "To": "libc-alpha@sourceware.org, fweimer@redhat.com,\n adhemerval.zanella@linaro.org", "Subject": "[PATCH v4 2/2] feat(rtld): Allow LD_DEBUG category exclusion", "Date": "Wed, 11 Feb 2026 14:59:44 +0100", "Message-ID": "<20260211135944.2066869-3-fberat@redhat.com>", "In-Reply-To": "<20260211135944.2066869-1-fberat@redhat.com>", "References": "<20260211135944.2066869-1-fberat@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.93", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "irBWINuwjAzTCRkpi0nI7vwIohwD09v645C7MjDv9NY_1770818395", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true", "X-BeenThere": "libc-alpha@sourceware.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Libc-alpha mailing list <libc-alpha.sourceware.org>", "List-Unsubscribe": "<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>", "List-Archive": "<https://sourceware.org/pipermail/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-request@sourceware.org?subject=help>", "List-Subscribe": "<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>", "Errors-To": "libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org" }, "content": "Adds support for excluding specific categories from `LD_DEBUG` output.\n\nThe `LD_DEBUG` environment variable now accepts category names prefixed\nwith a dash (`-`) to disable their debugging output. This allows users\nto enable broad categories (e.g., `all`) while suppressing verbose or\nirrelevant information from specific sub-categories (e.g., `-tls`).\n\nThe `process_dl_debug` function in `rtld.c` has been updated to parse\nthese exclusion options and unset the corresponding bits in\n`GLRO(dl_debug_mask)`. The `LD_DEBUG=help` output has also been updated\nto document this new functionality. A new test `tst-dl-debug-exclude.sh`\nis added to verify the correct behavior of category exclusion.\n---\nv4:\n- Refactor parsing to process options sequentially in a single loop.\n- Ensure the last specified option for a category takes precedence\n (fixing ordering).\n- Update tst-dl-debug-exclude.sh to verify sequential processing and\n ordering (e.g., -tls,tls).\n- Improve script header and intent description.\n\n elf/Makefile | 11 +++++\n elf/rtld.c | 16 +++++--\n elf/tst-dl-debug-exclude.sh | 87 +++++++++++++++++++++++++++++++++++++\n 3 files changed, 110 insertions(+), 4 deletions(-)\n create mode 100644 elf/tst-dl-debug-exclude.sh", "diff": "diff --git a/elf/Makefile b/elf/Makefile\nindex 9d4dfcf4ae..f6822dc379 100644\n--- a/elf/Makefile\n+++ b/elf/Makefile\n@@ -3553,4 +3553,15 @@ $(objpfx)tst-tls-debug-recursive.out: tst-tls-debug-recursive.sh \\\n \t\t '$(rtld-prefix)' '$(run_program_env)' \\\n \t\t $(objpfx)tst-recursive-tls > $@; \\\n \t$(evaluate-test)\n+\n+tests-special += $(objpfx)tst-dl-debug-exclude.out\n+$(objpfx)tst-dl-debug-exclude.out: tst-dl-debug-exclude.sh \\\n+\t\t\t\t $(objpfx)tst-recursive-tls \\\n+\t\t\t\t $(objpfx)tst-recursive-tlsmallocmod.so \\\n+\t\t\t\t $(patsubst %,$(objpfx)tst-recursive-tlsmod%.so, \\\n+\t\t\t\t 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)\n+\t$(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' \\\n+\t\t '$(rtld-prefix)' '$(run_program_env)' \\\n+\t\t $(objpfx)tst-recursive-tls > $@; \\\n+\t$(evaluate-test)\n endif\ndiff --git a/elf/rtld.c b/elf/rtld.c\nindex 1fc32ebefa..e1c2105ba6 100644\n--- a/elf/rtld.c\n+++ b/elf/rtld.c\n@@ -2461,11 +2461,18 @@ process_dl_debug (struct dl_main_state *state, const char *dl_debug)\n \t\t && dl_debug[len] != ',' && dl_debug[len] != ':')\n \t ++len;\n \n+\t bool exclude = *dl_debug == '-';\n+\t const char *name = exclude ? dl_debug + 1 : dl_debug;\n+\t size_t name_len = exclude ? len - 1 : len;\n+\n \t for (cnt = 0; cnt < ndebopts; ++cnt)\n-\t if (debopts[cnt].len == len\n-\t\t&& memcmp (dl_debug, debopts[cnt].name, len) == 0)\n+\t if (debopts[cnt].len == name_len\n+\t\t&& memcmp (name, debopts[cnt].name, name_len) == 0)\n \t {\n-\t\tGLRO(dl_debug_mask) |= debopts[cnt].mask;\n+\t\tif (exclude)\n+\t\t GLRO(dl_debug_mask) &= ~debopts[cnt].mask;\n+\t\telse\n+\t\t GLRO(dl_debug_mask) |= debopts[cnt].mask;\n \t\tbreak;\n \t }\n \n@@ -2507,7 +2514,8 @@ Valid options for the LD_DEBUG environment variable are:\\n\\n\");\n \n _dl_printf (\"\\n\\\n To direct the debugging output into a file instead of standard output\\n\\\n-a filename can be specified using the LD_DEBUG_OUTPUT environment variable.\\n\");\n+a filename can be specified using the LD_DEBUG_OUTPUT environment variable.\\n\\\n+Categories can be excluded by prefixing them with a dash (-).\\n\");\n _exit (0);\n }\n }\ndiff --git a/elf/tst-dl-debug-exclude.sh b/elf/tst-dl-debug-exclude.sh\nnew file mode 100644\nindex 0000000000..9837ffcea8\n--- /dev/null\n+++ b/elf/tst-dl-debug-exclude.sh\n@@ -0,0 +1,87 @@\n+#!/bin/sh\n+# Test for LD_DEBUG category exclusion.\n+# Copyright (C) 2026 Free Software Foundation, Inc.\n+# This file is part of the GNU C Library.\n+#\n+# The GNU C Library is free software; you can redistribute it and/or\n+# modify it under the terms of the GNU Lesser General Public\n+# License as published by the Free Software Foundation; either\n+# version 2.1 of the License, or (at your option) any later version.\n+#\n+# The GNU C Library is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+# Lesser General Public License for more details.\n+#\n+# You should have received a copy of the GNU Lesser General Public\n+# License along with the GNU C Library; if not, see\n+# <https://www.gnu.org/licenses/>.\n+\n+# This script verifies the LD_DEBUG category exclusion functionality.\n+# It checks that:\n+# 1. Categories can be excluded using the '-' prefix.\n+# 2. Options are processed sequentially, meaning the last specified\n+# option for a category (enable or exclude) takes precedence.\n+\n+set -e\n+\n+common_objpfx=\"$1\"\n+test_wrapper_env=\"$2\"\n+rtld_prefix=\"$3\"\n+run_program_env=\"$4\"\n+test_program=\"$5\"\n+\n+debug_output=\"${common_objpfx}elf/tst-dl-debug-exclude.debug\"\n+rm -f \"${debug_output}\".*\n+\n+# Run the test program with LD_DEBUG=all,-tls.\n+# We expect general logs but no TLS logs.\n+eval \"${test_wrapper_env}\" LD_DEBUG=all,-tls LD_DEBUG_OUTPUT=\"${debug_output}\" \\\n+ \"${rtld_prefix}\" \"${test_program}\"\n+\n+fail=0\n+\n+# 1. Check that general logs are present (e.g., file loading)\n+if ! grep -q 'file=' \"${debug_output}\".*; then\n+ echo \"FAIL: 'file=' message not found (LD_DEBUG=all failed)\"\n+ fail=1\n+fi\n+\n+# 2. Check that TLS logs are NOT present\n+if grep -q 'tls: ' \"${debug_output}\".*; then\n+ echo \"FAIL: TLS message found (exclusion of -tls failed)\"\n+ fail=1\n+fi\n+\n+rm -f \"${debug_output}\".*\n+# 3. Check for LD_DEBUG=all,-tls,tls (ordering verification)\n+# We expect TLS logs to BE present\n+eval \"${test_wrapper_env}\" LD_DEBUG=all,-tls,tls LD_DEBUG_OUTPUT=\"${debug_output}\" \\\n+ \"${rtld_prefix}\" \"${test_program}\"\n+\n+if ! grep -q 'tls: ' \"${debug_output}\".*; then\n+ echo \"FAIL: TLS message not found (ordering -tls,tls failed)\"\n+ fail=1\n+fi\n+\n+rm -f \"${debug_output}\".*\n+# 4. Check for LD_DEBUG=tls,-tls\n+# We expect TLS logs to NOT be present\n+eval \"${test_wrapper_env}\" LD_DEBUG=tls,-tls LD_DEBUG_OUTPUT=\"${debug_output}\" \\\n+ \"${rtld_prefix}\" \"${test_program}\"\n+\n+if grep -q 'tls: ' \"${debug_output}\".*; then\n+ echo \"FAIL: TLS message found (ordering tls,-tls failed)\"\n+ fail=1\n+fi\n+\n+if [ $fail -ne 0 ]; then\n+ echo \"Test FAILED\"\n+ cat \"${debug_output}\".*\n+ rm -f \"${debug_output}\".*\n+ exit 1\n+fi\n+\n+echo \"Test PASSED\"\n+rm -f \"${debug_output}\".*\n+exit 0\n", "prefixes": [ "v4", "2/2" ] }