From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 849DB385E01D; Thu, 21 Dec 2023 00:49:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 849DB385E01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1703119780; bh=G6ov0GkR8HVNeT+qCdsddE4ePmW7pEAL5ZnQmlm/3ZI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZOPOyndntixKimBJaSZdhsf+aXZXVq8nClQ4jh0oR46qZFzp5HHfWJEKJqDTa/KKJ U+iRFiB10vWdWyS+7piZoA8eEresr44219A/F9YV/yat8zLIld7aux0wrsZY/3y5bv /Svc9KbfufQIaKhGIOADmyUayZMvGd1ZjdKlxwi0= From: "mark at klomp dot org" To: elfutils-devel@sourceware.org Subject: [Bug general/30975] elfutils incorrectly reports core files with non-contiguous segments Date: Thu, 21 Dec 2023 00:49:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: general X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: amerey at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30975 Mark Wielaard changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|ASSIGNED |RESOLVED --- Comment #8 from Mark Wielaard --- Fixed by this commit: commit 2f38fa57942f95a9ada35e6802df864747c81cce Author: Aaron Merey Date: Tue Nov 21 08:56:44 2023 -0500 libdwfl: Correctly handle corefile non-contiguous segments It is possible for segments of different shared libaries to be interlea= ved in memory such that the segments of one library are located in between non-contiguous segments of another library. For example, this can be seen with firefox on RHEL 7.9 where multiple shared libraries could be mapped in between ld-2.17.so segments: [...] 7f0972082000-7f09720a4000 00000000 139264 /usr/lib64/ld-2.17= .so 7f09720a4000-7f09720a5000 00000000 4096 /memfd:mozilla-ipc (deleted) 7f09720a5000-7f09720a7000 00000000 8192 /memfd:mozilla-ipc (deleted) 7f09720a7000-7f09720a9000 00000000 8192 /memfd:mozilla-ipc (deleted) 7f0972134000-7f0972136000 00000000 8192=20=20=20=20=20=20=20 /usr/lib64/firefox/libmozwayland.so 7f0972136000-7f0972137000 00002000 4096=20=20=20=20=20=20=20 /usr/lib64/firefox/libmozwayland.so 7f0972137000-7f0972138000 00003000 4096=20=20=20=20=20=20=20 /usr/lib64/firefox/libmozwayland.so 7f0972138000-7f0972139000 00003000 4096=20=20=20=20=20=20=20 /usr/lib64/firefox/libmozwayland.so 7f097213a000-7f0972147000 00000000 53248=20=20=20=20=20=20 /usr/lib64/firefox/libmozsqlite3.so 7f0972147000-7f097221e000 0000d000 880640=20=20=20=20=20 /usr/lib64/firefox/libmozsqlite3.so 7f097221e000-7f0972248000 000e4000 172032=20=20=20=20=20 /usr/lib64/firefox/libmozsqlite3.so 7f0972248000-7f0972249000 0010e000 4096=20=20=20=20=20=20=20 /usr/lib64/firefox/libmozsqlite3.so 7f0972249000-7f097224c000 0010e000 12288=20=20=20=20=20=20 /usr/lib64/firefox/libmozsqlite3.so 7f097224c000-7f0972250000 00111000 16384=20=20=20=20=20=20 /usr/lib64/firefox/libmozsqlite3.so 7f0972250000-7f0972253000 00000000 12288=20=20=20=20=20=20 /usr/lib64/firefox/liblgpllibs.so [...] 7f09722a3000-7f09722a4000 00021000 4096 /usr/lib64/ld-2.17= .so 7f09722a4000-7f09722a5000 00022000 4096 /usr/lib64/ld-2.17= .so dwfl_segment_report_module did not account for the possibility of interleaving non-contiguous segments, resulting in premature closure of modules as well as failing to report modules. Fix this by removing segment skipping in dwfl_segment_report_module. When dwfl_segment_report_module reported a module, it would return the index of the segment immediately following the end address of the current module. Since there's a chance that other modules might fall within this address range, dwfl_segment_report_module instead returns the index of the next segment. This patch also fixes premature module closure that can occur in dwfl_segment_report_module when interleaving non-contiguous segments are found. Previously modules with start and end addresses that overlap with the current segment would have their build-ids compared with the current segment's build-id. If there was a mismatch, that module would be closed. Avoid closing modules in this case when mismatching build-i= ds correspond to distinct modules. https://sourceware.org/bugzilla/show_bug.cgi?id=3D30975 Signed-off-by: Aaron Merey --=20 You are receiving this mail because: You are on the CC list for the bug.=