From 7844b7a30f6fd7d79b00517c3a7bf7a6903535f8 Mon Sep 17 00:00:00 2001 From: Ivan Babrou Date: Fri, 30 Dec 2022 17:21:27 -0800 Subject: [PATCH] Decompress section data prior to use This doesn't matter for `.eh_frame`, but it does matter to dwarf data, which is often compressed. Accessing uncompressed data will result in a silent failure in `framehop`: * https://github.com/mstange/framehop/blob/v0.7.2/src/unwinder.rs#L575 --- samply/src/linux_shared/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samply/src/linux_shared/mod.rs b/samply/src/linux_shared/mod.rs index 10d1a34bb..90c5868af 100644 --- a/samply/src/linux_shared/mod.rs +++ b/samply/src/linux_shared/mod.rs @@ -992,7 +992,7 @@ where }; fn section_data<'a>(section: &impl ObjectSection<'a>) -> Option> { - section.data().ok().map(|data| data.to_owned()) + section.uncompressed_data().ok().map(|data| data.to_vec()) } let file = match object::File::parse(&mmap[..]) {