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

feat(protocol): Add protocol support for WASM #852

Merged
merged 6 commits into from
Nov 27, 2020
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**Features**:

- Relay is now able to ingest pre-aggregated sessions, which will make it possible to efficiently handle applications that produce thousands of sessions per second. ([#815](https://github.com/getsentry/relay/pull/815))
- Add protocol support for WASM. ([#852](https://github.com/getsentry/relay/pull/852))
- Add dynamic sampling for transactions. ([#835](https://github.com/getsentry/relay/pull/835))

**Bug Fixes**:
Expand Down
4 changes: 2 additions & 2 deletions relay-general/src/protocol/debugmeta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,11 @@ pub struct NativeDebugImage {
/// Starting memory address of the image (required).
///
/// Memory address, at which the image is mounted in the virtual address space of the process. Should be a string in hex representation prefixed with `"0x"`.
#[metastructure(required = "true")]
Copy link
Member

Choose a reason for hiding this comment

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

Does this work with the sentry processor as is? I think we may expect non-null values at some places in native/processing.py or native/symbolicator.py.

Copy link
Member

Choose a reason for hiding this comment

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

Looked into this, and it will work. There are two places in AppleCrashReport rendering where we would throw None ValueErrors.

pub image_addr: Annotated<Addr>,

/// Size of the image in bytes (required).
///
/// The size of the image in virtual memory. If missing, Sentry will assume that the image spans up to the next image, which might lead to invalid stack traces.
#[metastructure(required = "true")]
pub image_size: Annotated<u64>,

/// Loading address in virtual memory.
Expand Down Expand Up @@ -436,6 +434,8 @@ pub enum DebugImage {
Pe(Box<NativeDebugImage>),
/// A reference to a proguard debug file.
Proguard(Box<ProguardDebugImage>),
/// WASM debug image.
Wasm(Box<NativeDebugImage>),
/// A debug image that is unknown to this protocol specification.
#[metastructure(fallback_variant)]
Other(Object<Value>),
Expand Down
5 changes: 5 additions & 0 deletions relay-general/src/protocol/stacktrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ pub struct Frame {
/// then symbolication can take place.
pub instruction_addr: Annotated<Addr>,

/// Defines the addressing mode for addresses.
pub addr_mode: Annotated<String>,
Copy link
Member

Choose a reason for hiding this comment

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

We should consider validating the format here, but I think it's fine to merge as string.


/// (C/C++/Native) Start address of the frame's function.
///
/// We use the instruction address for symbolication, but this can be used to calculate
Expand Down Expand Up @@ -361,6 +364,7 @@ fn test_frame_roundtrip() {
},
"image_addr": "0x400",
"instruction_addr": "0x404",
"addr_mode": "abs",
"symbol_addr": "0x404",
"trust": "69",
"lang": "rust",
Expand Down Expand Up @@ -395,6 +399,7 @@ fn test_frame_roundtrip() {
}),
image_addr: Annotated::new(Addr(0x400)),
instruction_addr: Annotated::new(Addr(0x404)),
addr_mode: Annotated::new("abs".into()),
symbol_addr: Annotated::new(Addr(0x404)),
trust: Annotated::new("69".into()),
lang: Annotated::new("rust".into()),
Expand Down
17 changes: 14 additions & 3 deletions relay-general/tests/snapshots/test_fixtures__event_schema.snap
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,9 @@ expression: event_json_schema()
{
"$ref": "#/definitions/ProguardDebugImage"
},
{
"$ref": "#/definitions/NativeDebugImage"
},
{
"type": "object",
"additionalProperties": true
Expand Down Expand Up @@ -1308,6 +1311,14 @@ expression: event_json_schema()
}
]
},
"addr_mode": {
"description": " Defines the addressing mode for addresses.",
"default": null,
"type": [
"string",
"null"
]
},
"colno": {
"description": " Column number within the source file, starting at 1.",
"default": null,
Expand Down Expand Up @@ -1924,9 +1935,7 @@ expression: event_json_schema()
"type": "object",
"required": [
"code_file",
"debug_id",
"image_addr",
"image_size"
"debug_id"
],
"properties": {
"arch": {
Expand Down Expand Up @@ -1985,6 +1994,7 @@ expression: event_json_schema()
},
"image_addr": {
"description": " Starting memory address of the image (required).\n\n Memory address, at which the image is mounted in the virtual address space of the process. Should be a string in hex representation prefixed with `\"0x\"`.",
"default": null,
"anyOf": [
{
"$ref": "#/definitions/Addr"
Expand All @@ -1996,6 +2006,7 @@ expression: event_json_schema()
},
"image_size": {
"description": " Size of the image in bytes (required).\n\n The size of the image in virtual memory. If missing, Sentry will assume that the image spans up to the next image, which might lead to invalid stack traces.",
"default": null,
"type": [
"integer",
"null"
Expand Down