Skip to content

Commit

Permalink
test: source_links with no embedded sources (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Mar 31, 2023
1 parent 706d879 commit 9d34afe
Show file tree
Hide file tree
Showing 14 changed files with 160 additions and 42 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ __pycache__

# mkdocs
site

# New test snapshots
*.snap.new
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- Fully migrate `CacheKey` usage and remove legacy markers. ([#1043](https://github.com/getsentry/symbolicator/pull/1043))
- Add support for in-memory caching. ([#1028](https://github.com/getsentry/symbolicator/pull/1028))
- Add --log-level argument to `symbolicli`. ([#1074](https://github.com/getsentry/symbolicator/pull/1074))
- Resolve source context from embedded source links (mainly in Portable PDBs) ([#1103](https://github.com/getsentry/symbolicator/pull/1103))
- Resolve source context from embedded source links (mainly in Portable PDBs) ([#1103](https://github.com/getsentry/symbolicator/pull/1103), [#1108](https://github.com/getsentry/symbolicator/pull/1108))

### Fixes

Expand Down
48 changes: 24 additions & 24 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 = "12.1.1"
symbolic-common = "12.1.2"
2 changes: 1 addition & 1 deletion crates/symbolicator-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ serde_json = "1.0.81"
serde_yaml = "0.9.14"
sha2 = "0.10.6"
sourcemap = "6.2.1"
symbolic = { version = "12.1.1", features = ["cfi", "common-serde", "debuginfo", "demangle", "sourcemapcache", "symcache", "il2cpp", "ppdb"] }
symbolic = { version = "12.1.2", features = ["cfi", "common-serde", "debuginfo", "demangle", "sourcemapcache", "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
@@ -1,20 +1,20 @@
---
source: crates/symbolicator-service/tests/integration/symbolication.rs
assertion_line: 201
assertion_line: 278
expression: response.unwrap()
---
stacktraces:
- frames:
- status: symbolicated
original_index: 0
addr_mode: "rel:0"
instruction_addr: "0x1"
function_id: "0x7"
instruction_addr: "0x2f"
function_id: "0x5"
lang: csharp
filename: ThrowHelper.cs
abs_path: /_/src/libraries/Common/src/System/ThrowHelper.cs
lineno: 24
source_link: "https://github.com/raw/dotnet/runtime/d099f075e45d2aa6007a22b71b45a08758559f80/src/libraries/Common/src/System/ThrowHelper.cs"
filename: Program.cs
abs_path: "C:\\dev\\dotnet\\samples\\Sentry.Samples.Console.Basic\\Program.cs"
lineno: 13
source_link: "https://github.com/raw/getsentry/sentry-dotnet/b31b62192e6934ea04396456461f430e143cf4f9/samples/Sentry.Samples.Console.Basic/Program.cs"
modules:
- debug_status: found
features:
Expand All @@ -24,16 +24,16 @@ modules:
has_sources: true
arch: unknown
type: pe_dotnet
debug_id: 37e9e8a6-1a8e-404e-b93c-6902e277ff55-a09672e1
debug_id: 0c380a12-8221-4069-8565-bee6b3ac196e-a596286e
debug_file: source-links.pdb
image_addr: "0x0"
candidates:
- source: local
location: "http://localhost:<port>/symbols/source-links.pdb/37E9E8A61A8E404EB93C6902E277FF55a09672e1/source-links.src.zip"
location: "http://localhost:<port>/symbols/source-links.pdb/0C380A12822140698565BEE6B3AC196Ea596286e/source-links.src.zip"
download:
status: notfound
- source: local
location: "http://localhost:<port>/symbols/source-links.pdb/37E9E8A61A8E404EB93C6902E277FF55ffffffff/source-links.pdb"
location: "http://localhost:<port>/symbols/source-links.pdb/0C380A12822140698565BEE6B3AC196Effffffff/source-links.pdb"
download:
status: ok
features:
Expand All @@ -44,7 +44,7 @@ modules:
debug:
status: ok
- source: local
location: "http://localhost:<port>/symbols/source-links.pdb/37E9E8A61A8E404EB93C6902E277FF55ffffffff/source-links.src.zip"
location: "http://localhost:<port>/symbols/source-links.pdb/0C380A12822140698565BEE6B3AC196Effffffff/source-links.src.zip"
download:
status: notfound

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
source: crates/symbolicator-service/tests/integration/symbolication.rs
assertion_line: 253
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\\dotnet\\samples\\Sentry.Samples.Console.Basic\\Program.cs"
lineno: 13
pre_context:
- " // When debug is enabled, the Sentry client will emit detailed debugging information to the console."
- " o.Debug = true;"
- "});"
- ""
- // The following unhandled exception will be captured and sent to Sentry.
context_line: "throw new Exception(\"test\");"
source_link: "https://github.com/raw/getsentry/sentry-dotnet/b31b62192e6934ea04396456461f430e143cf4f9/samples/Sentry.Samples.Console.Basic/Program.cs"
in_app: true
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: 0c380a12-8221-4069-8565-bee6b3ac196e-a596286e
debug_file: source-links.pdb
image_addr: "0x0"
candidates:
- source: local
location: "http://localhost:<port>/symbols/source-links.pdb/0C380A12822140698565BEE6B3AC196Ea596286e/source-links.src.zip"
download:
status: notfound
- source: local
location: "http://localhost:<port>/symbols/source-links.pdb/0C380A12822140698565BEE6B3AC196Effffffff/source-links.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/source-links.pdb/0C380A12822140698565BEE6B3AC196Effffffff/source-links.src.zip"
download:
status: notfound

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

assert_snapshot!(response.unwrap());
}

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

let request = make_symbolication_request(
vec![source],
r#"[{
"type":"pe_dotnet",
"debug_file":"source-links.pdb",
"debug_id":"0c380a12-8221-4069-8565-bee6b3ac196e-a596286e"
}]"#,
r#"[{
"frames":[{
"instruction_addr": "0x2f",
"function_id": "0x5",
"addr_mode":"rel:0",
"in_app":true
}]
}]"#,
);
let response = symbolication.symbolicate(request).await;

assert_snapshot!(response.unwrap());
}

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

let request = make_symbolication_request(
vec![source],
r#"[{
"type":"pe_dotnet",
"debug_file":"source-links.pdb",
"debug_id":"0c380a12-8221-4069-8565-bee6b3ac196e-a596286e"
}]"#,
r#"[{
"frames":[{
"instruction_addr": "0x2f",
"function_id": "0x5",
"addr_mode":"rel:0"
}]
}]"#,
);
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 = "12.1.1"
symbolic = "12.1.2"
url = { version = "2.2.0", features = ["serde"] }

[dev-dependencies]
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.30.0", features = ["anyhow", "debug-images", "tracing",
serde = { version = "1.0.137", features = ["derive", "rc"] }
serde_json = "1.0.81"
structopt = "0.3.21"
symbolic = "12.1.1"
symbolic = "12.1.2"
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 = "12.1.1"
symbolic = "12.1.2"
symbolicator-service = { path = "../symbolicator-service" }
symbolicator-sources = { 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 = "12.1.1", features = ["debuginfo-serde"] }
symbolic = { version = "12.1.2", 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.
6 changes: 6 additions & 0 deletions tests/fixtures/symbols/source-links.pdb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Source link test PDBs

There are two variants of a PDB here, testing two different scenarios.

* `37E9E8A61A8E404EB93C6902E277FF55` contains sources and source links
* `0C380A12822140698565BEE6B3AC196E` only contains source links

0 comments on commit 9d34afe

Please sign in to comment.