Repository navigation
[jni] Store and display stack trace of release point for debugging - #2851
Merged
Merged
Conversation
PR Health
License Headers
|
| Files |
|---|
| pkgs/jni/test/debug_release_test.dart |
All source files should start with a license header.
Unrelated files missing license headers
| Files |
|---|
| pkgs/hooks_runner/test_data/download_assets/hook/build.dart |
| pkgs/objective_c/example/command_line/lib/main.dart |
| pkgs/objective_c/lib/src/ns_input_stream.dart |
This check can be disabled by tagging the PR with skip-license-check.
API leaks ✔️
The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
| Package | Leaked API symbol | Leaking sources |
|---|
This check can be disabled by tagging the PR with skip-leaking-check.
Breaking changes ⚠️
| Package | Change | Current Version | New Version | Needed Version | Looking good? |
|---|---|---|---|---|---|
| jni | Breaking | 0.15.2 | 0.15.3-wip | 0.16.0 Got "0.15.3-wip" expected >= "0.16.0" (breaking changes) |
This check can be disabled by tagging the PR with skip-breaking-check.
Changelog Entry ✔️
| Package | Changed Files |
|---|
Changes to files need to be accounted for in their respective changelogs.
This check can be disabled by tagging the PR with skip-changelog-check.
liamappelbe
approved these changes
Dec 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is useful for debugging use-after-release and double-release bugs.
We store all of the points where the objects is registered to be released by an arena, and also the point when it was finally released. When it comes to throwing either
UseAfterReleaseErrororDoubleReleaseError, we can show the user where they previously released or registered to release the object. We only do this inside assertions and also everything is behind a boolean flagJni.captureStackTraceOnReleasewhich isfalseby default.We store the stack trace string using in a
char**in C because we want to access it from any isolate. A finalizable handle is created to handle garbage collection.Also make
releasedBy(arena)less strict: meaning it will only release if the object has not been released before and will not throw a double release error.Closes #2246.