8000 Android CI improvements by schopin-mozilla · Pull Request #206 · rust-minidump/minidump-writer · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ jobs:
cargo run --target x86_64-linux-android --bin test -- nop
# Build and run tests
cargo test --target x86_64-linux-android
cargo clippy --all-features --all-targets --target x86_64-linux-android -- -D warnings

deny-check:
runs-on: ubuntu-24.04
Expand Down
25 changes: 12 additions & 13 deletions src/linux/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,18 @@ pub fn late_process_mappings(
.ok()
.and_then(|x| elf_header::Header::parse(&x).ok());

if let Some(ehdr) = ehdr_opt {
if ehdr.e_type == elf_header::ET_DYN {
// Compute the effective load bias for this mapped library, and update
// the mapping to hold that rather than |start_addr|, at the same time
// adjusting |size| to account for the change in |start_addr|. Where
// the library does not contain Android packed relocations,
// GetEffectiveLoadBias() returns |start_addr| and the mapping entry
// is not changed.
let load_bias =
get_effective_load_bias(process_inspector, &ehdr, map.start_address);
map.size += map.start_address - load_bias;
map.start_address = load_bias;
}
if let Some(ehdr) = ehdr_opt
&& ehdr.e_type == elf_header::ET_DYN
{
// Compute the effective load bias for this mapped library, and update
// the mapping to hold that rather than |start_addr|, at the same time
// adjusting |size| to account for the change in |start_addr|. Where
// the library does not contain Android packed relocations,
// GetEffectiveLoadBias() returns |start_addr| and the mapping entry
// is not changed.
let load_bias = get_effective_load_bias(process_inspector, &ehdr, map.start_address);
map.size += map.start_address - load_bias;
map.start_address = load_bias;
}
}
Ok(())
Expand Down
8 changes: 7 additions & 1 deletion src/linux/minidump_writer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ pub mod thread_names_stream;

/// The default timeout after a `SIGSTOP` after which minidump writing proceeds
/// regardless of the process state
pub const STOP_TIMEOUT: Duration = Duration::from_millis(100);
pub const STOP_TIMEOUT: Duration = if cfg!(target_os = "android") {
// For whatever reason, Android can be terribly slow for stopping processes
// This often leads to our tests failing intermittently
Duration::from_secs(5)
} else {
Duration::from_millis(100)
};

#[cfg(target_pointer_width = "32")]
pub const AT_SYSINFO_EHDR: u32 = 33;
Expand Down
11 changes: 5 additions & 6 deletions src/linux/process_inspection/process_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ impl<'a> ProcessReader<'a> {
// For now, only check the SO_NAME of Android APKS, because libraries may be mapped
// directly from within an APK. See bug 1982902.
#[cfg(target_os = "android")]
if name.ends_with(".apk") {
if let Ok(so_name) = crate::module_reader::read_soname_from_module(&mmem) {
if so_name == name {
return Some(mmem);
}
}
if name.ends_with(".apk")
&& let Ok(so_name) = crate::module_reader::read_soname_from_module(&mmem)
&& so_name == name
{
return Some(mmem);
}

None
Expand Down
Loading
0