From owner-freebsd-bugs@FreeBSD.ORG Tue May 5 02:13:33 2015 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BED57B81 for ; Tue, 5 May 2015 02:13:33 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9B8F16F0 for ; Tue, 5 May 2015 02:13:33 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t452DXO2019227 for ; Tue, 5 May 2015 02:13:33 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 199943] document guarantee provided by dl_iterate_phdr(3) callback order Date: Tue, 05 May 2015 02:13:33 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: emaste@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- 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: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 02:13:33 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199943 Bug ID: 199943 Summary: document guarantee provided by dl_iterate_phdr(3) callback order Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: freebsd-bugs@FreeBSD.org Reporter: emaste@freebsd.org A number of posts found on e.g. http://stackoverflow.com/ and elsewhere ask about the order of objects returned by dl_iterate_phdr. Those questions are typically targeted at Linux, but the question is equally applicable to FreeBSD. The question usually arises from a desire to know which is the main executable. In practice the executable is passed to the first callback invocation, but there is currently no guarantee that this will not change. We should choose one of: 1) Document this and add a test so that it remains the case 2) Caution that the order of objects is not guaranteed, and consumers should not rely on a particular order Equivalent issue for Linux (but probably not in the correct bug tracker): https://bugzilla.kernel.org/show_bug.cgi?id=94141 -- You are receiving this mail because: You are the assignee for the bug.