Skip to content

Commit

Permalink
feat: Support PortablePDB embedded sources (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind authored Jan 30, 2023
1 parent 99f0f49 commit 5763972
Show file tree
Hide file tree
Showing 13 changed files with 123 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Added a field `adjust_instruction_addr: Option<bool>` to `RawFrame` to signal whether the
frame's instruction address needs to be adjusted for symbolication. ([#948](https://github.com/getsentry/symbolicator/pull/948))
- Added offline mode and caching to `symbolicli`. ([#967](https://github.com/getsentry/symbolicator/pull/967),[#968](https://github.com/getsentry/symbolicator/pull/968))
- Support PortablePDB embedded sources. ([#996](https://github.com/getsentry/symbolicator/pull/996))

### Internal

Expand Down
33 changes: 17 additions & 16 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/process-event/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ reqwest = { version = "0.11.0", features = ["blocking", "json", "multipart", "tr
serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.81"
structopt = "0.3.21"
symbolic-common = "10.0.0"
symbolic-common = "11.0.0"
2 changes: 1 addition & 1 deletion crates/symbolicator-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ sentry = { version = "0.29.1", features = ["tracing"] }
serde = { version = "1.0.137", features = ["derive", "rc"] }
serde_json = "1.0.81"
serde_yaml = "0.9.14"
symbolic = { version = "10.2.1", features = ["cfi", "common-serde", "debuginfo", "demangle", "symcache", "il2cpp", "ppdb"] }
symbolic = { version = "11.0.0", features = ["cfi", "common-serde", "debuginfo", "demangle", "symcache", "il2cpp", "ppdb"] }
symbolicator-sources = { path = "../symbolicator-sources" }
tempfile = "3.2.0"
thiserror = "1.0.31"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
source: crates/symbolicator-service/tests/integration/symbolication.rs
assertion_line: 296
expression: response.unwrap()
---
stacktraces:
- frames:
- status: symbolicated
original_index: 0
addr_mode: "rel:0"
instruction_addr: "0x2f"
function_id: "0x5"
lang: csharp
filename: Program.cs
abs_path: "C:\\dev\\sentry-dotnet\\samples\\Sentry.Samples.Console.Basic\\Program.cs"
lineno: 13
pre_context:
- " o.Debug = true;"
- "});"
- ""
- // The following unhandled exception will be captured and sent to Sentry.
context_line: "throw new Exception(\"test\");"
modules:
- debug_status: found
features:
has_debug_info: true
has_unwind_info: false
has_symbols: false
has_sources: true
arch: unknown
type: pe_dotnet
debug_id: b6919861-510c-4887-9994-943f64f70c37-870b9ef9
debug_file: portable-embedded.pdb
image_addr: "0x0"
candidates:
- source: local
location: "http://localhost:<port>/symbols/portable-embedded.pdb/B6919861510C48879994943F64F70C37870b9ef9/portable-embedded.src.zip"
download:
status: notfound
- source: local
location: "http://localhost:<port>/symbols/portable-embedded.pdb/B6919861510C48879994943F64F70C37ffffffff/portable-embedded.pdb"
download:
status: ok
features:
has_debug_info: true
has_unwind_info: false
has_symbols: false
has_sources: true
debug:
status: ok
- source: local
location: "http://localhost:<port>/symbols/portable-embedded.pdb/B6919861510C48879994943F64F70C37ffffffff/portable-embedded.src.zip"
download:
status: notfound

Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ modules:
location: "http://localhost:<port>/symbols/bd/a18fd85d4a4eb893022d6bfad846b1.src.zip"
download:
status: notfound
- source: local
location: "http://localhost:<port>/symbols/demo.wasm/BDA18FD85D4A4EB893022D6BFAD846B10/demo.wasm"
download:
status: notfound

39 changes: 39 additions & 0 deletions crates/symbolicator-service/tests/integration/symbolication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,42 @@ async fn test_dotnet_integration() {

assert_snapshot!(response.unwrap());
}

#[tokio::test]
async fn test_dotnet_embedded_sources() {
let (symbolication, _cache_dir) = setup_service(|_| ());
let (_srv, source) = test::symbol_server();

let modules: Vec<RawObjectInfo> = serde_json::from_str(
r#"[{
"type":"pe_dotnet",
"debug_file":"portable-embedded.pdb",
"debug_id":"b6919861-510c-4887-9994-943f64f70c37-870b9ef9"
}]"#,
)
.unwrap();

let stacktraces = serde_json::from_str(
r#"[{
"frames":[{
"instruction_addr": 47,
"function_id": 5,
"addr_mode":"rel:0"
}]
}]"#,
)
.unwrap();

let request = SymbolicateStacktraces {
modules: modules.into_iter().map(From::from).collect(),
stacktraces,
signal: None,
origin: StacktraceOrigin::Symbolicate,
sources: Arc::new([source]),
scope: Default::default(),
};

let response = symbolication.symbolicate(request).await;

assert_snapshot!(response.unwrap());
}
2 changes: 1 addition & 1 deletion crates/symbolicator-sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ aws-types = { version = "0.52.0", features = ["hardcoded-credentials"] }
glob = "0.3.0"
lazy_static = "1.4.0"
serde = { version = "1.0.137", features = ["derive", "rc"] }
symbolic = "10.0.0"
symbolic = "11.0.0"
url = { version = "2.2.0", features = ["serde"] }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/symbolicator-sources/src/filetype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl FileType {
/// Source providing file types.
#[inline]
pub fn sources() -> &'static [Self] {
&[FileType::SourceBundle]
&[FileType::SourceBundle, FileType::PortablePdb]
}

/// Given an object type, returns filetypes in the order they should be tried.
Expand Down
2 changes: 1 addition & 1 deletion crates/symbolicator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sentry = { version = "0.29.1", features = ["anyhow", "debug-images", "tracing",
serde = { version = "1.0.137", features = ["derive", "rc"] }
serde_json = "1.0.81"
structopt = "0.3.21"
symbolic = "10.0.0"
symbolic = "11.0.0"
symbolicator-crash = { path = "../symbolicator-crash", optional = true }
symbolicator-service = { path = "../symbolicator-service" }
symbolicator-sources = { path = "../symbolicator-sources" }
Expand Down
2 changes: 1 addition & 1 deletion crates/symbolicli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ reqwest = { version = "0.11.12", features = ["json"] }
serde = { version = "1.0.137", features = ["derive", "rc"] }
serde_json = "1.0.81"
serde_yaml = "0.9.14"
symbolic = "10.1.2"
symbolic = "11.0.0"
symbolicator-service = { version = "0.6.0", path = "../symbolicator-service" }
symbolicator-sources = { version = "0.6.0", path = "../symbolicator-sources" }
tempfile = "3.3.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/symsorter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ regex = "1.5.5"
serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.81"
structopt = "0.3.21"
symbolic = { version = "10.0.0", features = ["debuginfo-serde"] }
symbolic = { version = "11.0.0", features = ["debuginfo-serde"] }
walkdir = "2.3.1"
# NOTE: zip:0.6 by default depends on a version of zstd which conflicts with our other dependencies
zip = { version = "0.6.2", default-features = false, features = ["deflate", "bzip2"] }
Expand Down
Binary file not shown.

0 comments on commit 5763972

Please sign in to comment.