From nobody Wed Nov 9 22:18:11 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N6zr76MWkz4dLsj for ; Wed, 9 Nov 2022 22:18:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N6zr35tpSz4bj7 for ; Wed, 9 Nov 2022 22:18:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668032291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GfLzDLFOoQ8QGUCSdquFg7+K/0iwCPkj0rdKDUsizsA=; b=kaR5f/mr9+y+8Jo0ZtL8lseLtgN/y2e8vQQYrOCgJ5iiySTUAdR8wqezwTTYzmIYLx2wmg Fn1o+L06MacF+V3sVauwpP4yPEVVCjY7ULVRSMC7aD6XYL8BCtcpi96BRGpN0XIjc1mQsx r8OU1OPBah7DNFTFevCPAbfUVf7zBbhN2QRMKNaICqpKt8PWF0uqvZnHpdSbiSVnjrU4zJ AivWF4bE+tJ19qE8MMznhwAbscmASNYeam6vXozs/1dmTJUi/Jl+E9x0jtSDFLxS3C6UhV KG04wD3qZsWdOPXbyUhKKTRUUeY15JFfkcpCgvk2LN6eN/uWCB/VufvBQ7nuXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668032291; a=rsa-sha256; cv=none; b=ogZOTbZHFJH9R20lWa/RdeNE+TCCTCOhj1Awajny0p0S4AhC+qoDYg10Vxwalo2DLi2LXI 0meaBQvSNIk9MW2pbixmT2lr616bc2POWYFuz+wtXksVAKay3gotRmv6gSDMub1CDEeFgK MRM/xLnwU3MvMfLQwdmFo2hrc+WUY5H0bUvtOsaCwXU9rIisIO94oabnQYkgsjIFcAPhQo HhhFNq/hV+iwxx0ViW9wJm4PjC8oNOiY7gRCWe+2AwYGyjZ5/Dj39Xam8lrEo+fBeuolx9 LByA/Veuke1ganOc3L7T9t6xnu+puNnJOx8VMdi19Dw/7ptkHPxuGUGAHJsmGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N6zr34TWkzdNx for ; Wed, 9 Nov 2022 22:18:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2A9MIBhk086154 for ; Wed, 9 Nov 2022 22:18:11 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2A9MIBOB086153 for bugs@FreeBSD.org; Wed, 9 Nov 2022 22:18:11 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 267671] [libc] Remove unnecessary printf to stderr in stdlib/cxa_thread_atexit_impl.c Date: Wed, 09 Nov 2022 22:18:11 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: erik@tenku.dk X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267671 Bug ID: 267671 Summary: [libc] Remove unnecessary printf to stderr in stdlib/cxa_thread_atexit_impl.c Product: Base System Version: 13.1-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: erik@tenku.dk This is a request to remove the printf statement in stdlib/cxa_thread_atexit_impl.c in the function walk_cb_call. The function signature is currently " static void walk_cb_call(struct cxa_thread_dtor *dtor) { struct dl_phdr_info phdr_info; if (_rtld_addr_phdr(dtor->dso, &phdr_info) && __elf_phdr_match_addr(&phdr_info, dtor->func)) dtor->func(dtor->obj); else fprintf(stderr, "__cxa_thread_call_dtors: dtr %p from " "unloaded dso, skipping\n", (void *)(dtor->func)); } " and I suggest to modify it to read " static void walk_cb_call(struct cxa_thread_dtor *dtor) { struct dl_phdr_info phdr_info; if (_rtld_addr_phdr(dtor->dso, &phdr_info) && __elf_phdr_match_addr(&phdr_info, dtor->func)) dtor->func(dtor->obj); } " Currently, walk_cb_call does all the necessary checks (as far as I can tell= ) in its if-statement, calling the destructor of a given dso only if the dso has= not already been unloaded. If the dso appears multiple times as the list of dsos is iterated over in t= he function cxa_thread_walk (in the same source file), the error message will = be printed multiple times to the user. A specific dso might very well appear multiple times in the list of dsos, i= f it is linked into several other dsos on which a given program relies. The error message could perhaps be considered informative while debugging, = but it does not add any functionality and it potentially gives any end-user a w= rong impression of the integrity of a program that has this behaviour. As such, I suggest to remove the print statement from the source code. --=20 You are receiving this mail because: You are the assignee for the bug.=