From 7f05c1c20a51636f1b69e3299f721a98b3b173f2 Mon Sep 17 00:00:00 2001 From: Amy Kwan Date: Tue, 26 May 2026 10:03:46 -0400 Subject: [PATCH 1/2] [AIX] Update backtrace to account for libc changes and fix XCOFF parsing This patch synchronizes AIX backtrace support with newer libc updates and fix type correctness issues: - Bump libc to 0.2.175 to pick up latest AIX-related fixes. - Update libc::loadquery buffer argument to use *mut c_void instead of *mut c_char, matching the current libc API. - Fix XCOFF section name comparison to handle Option<&[u8]>. --- Cargo.lock | 4 ++-- src/symbolize/gimli/libs_aix.rs | 2 +- src/symbolize/gimli/xcoff.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7bfd34fd..239b74b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,9 +93,9 @@ checksum = "93563d740bc9ef04104f9ed6f86f1e3275c2cdafb95664e26584b9ca807a8ffe" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "libloading" diff --git a/src/symbolize/gimli/libs_aix.rs b/src/symbolize/gimli/libs_aix.rs index 0f385355..271b9420 100644 --- a/src/symbolize/gimli/libs_aix.rs +++ b/src/symbolize/gimli/libs_aix.rs @@ -30,7 +30,7 @@ pub(super) fn native_libraries() -> Vec { loop { if libc::loadquery( libc::L_GETINFO, - buffer.as_mut_ptr().cast::(), + buffer.as_mut_ptr().cast::(), (mem::size_of::() * buffer.len()) as u32, ) != -1 { diff --git a/src/symbolize/gimli/xcoff.rs b/src/symbolize/gimli/xcoff.rs index 226bd4d4..ee03d472 100644 --- a/src/symbolize/gimli/xcoff.rs +++ b/src/symbolize/gimli/xcoff.rs @@ -64,7 +64,7 @@ pub fn parse_xcoff(data: &[u8]) -> Option { let header = Xcoff::parse(data, &mut offset).ok()?; let _ = header.aux_header(data, &mut offset).ok()?; let sections = header.sections(data, &mut offset).ok()?; - if let Some(section) = sections.iter().find(|s| s.s_name().get(0..5) == b".text") { + if let Some(section) = sections.iter().find(|s| s.s_name().get(0..5) == Some(b".text")) { Some(Image { offset: section.s_scnptr() as usize, base: section.s_paddr() as u64, From 5758b12754512701515a54e25f96f9678b766f96 Mon Sep 17 00:00:00 2001 From: Amy Kwan Date: Thu, 4 Jun 2026 09:51:49 -0400 Subject: [PATCH 2/2] Fix rustfmt issues. --- src/symbolize/gimli/xcoff.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/symbolize/gimli/xcoff.rs b/src/symbolize/gimli/xcoff.rs index ee03d472..3b511d7d 100644 --- a/src/symbolize/gimli/xcoff.rs +++ b/src/symbolize/gimli/xcoff.rs @@ -64,7 +64,10 @@ pub fn parse_xcoff(data: &[u8]) -> Option { let header = Xcoff::parse(data, &mut offset).ok()?; let _ = header.aux_header(data, &mut offset).ok()?; let sections = header.sections(data, &mut offset).ok()?; - if let Some(section) = sections.iter().find(|s| s.s_name().get(0..5) == Some(b".text")) { + if let Some(section) = sections + .iter() + .find(|s| s.s_name().get(0..5) == Some(b".text")) + { Some(Image { offset: section.s_scnptr() as usize, base: section.s_paddr() as u64,