Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Bump rust-minidump #681

Merged
merged 6 commits into from
Feb 21, 2022
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
13 changes: 9 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/symbolicator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ serde = { version = "1.0.119", features = ["derive", "rc"] }
serde_json = "1.0.61"
serde_yaml = "0.8.15"
structopt = "0.3.21"
symbolic = { git = "https://github.com/getsentry/symbolic", branch = "fix/demangle-fixes", version = "8.5.0", features = ["common-serde", "debuginfo", "demangle", "minidump-serde", "symcache"] }
symbolic = { git = "https://github.com/getsentry/symbolic", branch = "fix/demangle-fixes", features = ["common-serde", "debuginfo", "demangle", "minidump-serde", "symcache"] }
# Uncomment the line below for local development
# symbolic = { path = "../../../symbolic/symbolic", features = ["common-serde", "debuginfo", "demangle", "minidump-serde", "symcache"] }
tempfile = "3.2.0"
Expand Down
27 changes: 9 additions & 18 deletions crates/symbolicator/src/services/symbolication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ fn object_info_from_minidump_module_breakpad(ty: ObjectType, module: &CodeModule
ty,
code_id: Some(code_id),
code_file: Some(module.code_file()),
debug_id: Some(module.debug_identifier()), // TODO: This should use module.id().map(_)
debug_id: module.id().map(|id| id.to_string()),
debug_file: Some(module.debug_file()),
image_addr: HexValue(module.base_address()),
image_size: match module.size() {
Expand All @@ -571,22 +571,17 @@ fn object_info_from_minidump_module_rust_minidump(
ty: ObjectType,
module: &MinidumpModule,
) -> RawObjectInfo {
let mut code_id = module.code_identifier().into_owned();

// The processor reports an empty string as code id for MachO files
// TODO(ja): Fix MinidumpModule::code_identifier for MachO
if ty == ObjectType::Macho {
code_id = module.debug_identifier().unwrap_or_default().into_owned();
code_id.truncate(32); // MachO code_id is the debug_id without `0` age.
}
let code_id = module.code_identifier().to_string();

RawObjectInfo {
ty,
// TODO: shouldn't this be None if code_id is empty?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling this TODO out since I added this in, maybe I just missed something? maybe Some("") is meaningful here?

code_id: Some(code_id),
code_file: Some(module.code_file().into_owned()),
// TODO(ja): Old TODO: This should use module.id().map(_)
// TODO(ja): This is optional now, wasn't before, check why
debug_id: module.debug_identifier().map(|c| c.into_owned()),
debug_id: module
.debug_identifier()
.map(|id| id.breakpad().to_string()),
debug_file: module.debug_file().map(|c| c.into_owned()),
image_addr: HexValue(module.base_address()),
image_size: match module.size() {
Expand Down Expand Up @@ -1512,10 +1507,7 @@ impl SymbolProvider for TempSymbolProvider {
_frame: &mut dyn minidump_processor::FrameSymbolizer,
) -> Result<(), minidump_processor::FillSymbolError> {
// TODO(ja): Deduplicate this. Probably should use a different map key, ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a sneaking suspicion that maybe we can delete this now, but maybe it'd be good to confirm this with @jan-auer to be safe.

let debug_id = module
.debug_identifier()
.and_then(|id| DebugId::from_str(&id).ok())
.unwrap_or_default();
let debug_id = module.debug_identifier().unwrap_or_default();

// Symbolicator's CFI caches never store symbolication information. However, we could hook
// up symbolic here to fill frame info right away. This requires a larger refactor of
Expand All @@ -1534,7 +1526,7 @@ impl SymbolProvider for TempSymbolProvider {
walker: &mut dyn minidump_processor::FrameWalker,
) -> Option<()> {
// TODO(ja): Deduplicate this. Probably should use a different map key, ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same deal here

let debug_id = DebugId::from_str(&module.debug_identifier()?).ok()?;
let debug_id = module.debug_identifier().unwrap_or_default();
match self.files.get(&debug_id) {
Some(file) => file.walk_frame(module, walker),
None => {
Expand Down Expand Up @@ -1741,8 +1733,7 @@ fn stackwalk_with_rust_minidump(
(
// TODO(ja): Check how this can be empty and how we shim.
// Probably needs explicit conversion from raw
DebugId::from_str(&module.debug_identifier().unwrap_or_default())
.unwrap_or_default(),
module.debug_identifier().unwrap_or_default(),
object_info_from_minidump_module_rust_minidump(object_type, module),
)
})
Expand Down