Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Changelog

# Unreleased
## Unreleased

### Features

- Update Android targetSdk to API 36 (Android 16) ([#5016](https://github.com/getsentry/sentry-java/pull/5016))

### Internal

- Establish new native exception mechanisms to differentiate events generated by `sentry-native` from `ApplicationExitInfo`. ([#5052](https://github.com/getsentry/sentry-java/pull/5052))
- Set `write` permission for `statuses` in the changelog preview GHA workflow. ([#5053](https://github.com/getsentry/sentry-java/pull/5053))

## 8.31.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.sentry.android.core.internal.tombstone;

import androidx.annotation.NonNull;

/** Mechanism types for native crashes. */
public enum NativeExceptionMechanism {
TOMBSTONE("tombstone"),
SIGNAL_HANDLER("signalhandler"),
TOMBSTONE_MERGED("tombstone_merged");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
TOMBSTONE("tombstone"),
SIGNAL_HANDLER("signalhandler"),
TOMBSTONE_MERGED("tombstone_merged");
TOMBSTONE("Tombstone"),
SIGNAL_HANDLER("signalhandler"),
TOMBSTONE_MERGED("TombstoneMerged");

I think we're really inconsistent with naming across SDKs, but we tend to use camelCase in the Java SDK, so I'm thinking if we could change that? signalhandler probably has to stay as-is to not break existing filters, but the new ones we may change to follow camelCase

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

fixed in 1ffaa05


private final @NonNull String value;

NativeExceptionMechanism(@NonNull final String value) {
this.value = value;
}

@NonNull
public String getValue() {
return value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ private static Mechanism createMechanismFromSignalInfo(
@NonNull final TombstoneProtos.Signal signalInfo) {

final Mechanism mechanism = new Mechanism();
// this follows the current processing triggers strictly, changing any of these
// alters grouping and name (long-term we might want to have a tombstone mechanism)
mechanism.setType("signalhandler");
mechanism.setType(NativeExceptionMechanism.TOMBSTONE.getValue());
mechanism.setHandled(false);
mechanism.setSynthetic(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class TombstoneParserTest {
assertNotNull(crashedThreadId)

val mechanism = exception.mechanism
assertEquals("signalhandler", mechanism!!.type)
assertEquals("tombstone", mechanism!!.type)
assertEquals(false, mechanism.isHandled)
assertEquals(true, mechanism.synthetic)
assertEquals("SIGSEGV", mechanism.meta!!["name"])
Expand Down
Loading