Repository navigation
Skip leak detection when goroutine stacks can't be parsed - #156
Open
justinhwang wants to merge 1 commit into
Open
justinhwang wants to merge 1 commit into
justinhwang wants to merge 1 commit into
Conversation
Under runtimes such as TinyGo, runtime.Stack produces no output that goleak can parse, so stack.Current() indexed an empty slice and panicked with "index out of range". Current and All now return stack.ErrNoStacks in that case; Find propagates it, and VerifyNone/VerifyTestMain log a message and skip the check instead of crashing. The public API is unchanged: the new (Stack, error) signatures are confined to the internal/stack package and the sentinel is internal. parseStacks still panics on malformed (non-empty) traces, so a parse failure on standard Go remains a loud goleak bug rather than a silent skip. Also add a TinyGo CI job that runs a smoke program (internal/tinygocheck, built only under the tinygo build tag) so this path is exercised on every change. This addresses the concern raised in PR #72. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #156 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 265 287 +22
=========================================
+ Hits 265 287 +22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Under runtimes such as TinyGo, runtime.Stack produces no output that goleak can parse, so stack.Current() indexed an empty slice and panicked with "index out of range". Current and All now return stack.ErrNoStacks in that case; Find propagates it, and VerifyNone/VerifyTestMain log a message and skip the check instead of crashing.
The public API is unchanged: the new (Stack, error) signatures are confined to the internal/stack package and the sentinel is internal. parseStacks still panics on malformed (non-empty) traces, so a parse failure on standard Go remains a loud goleak bug rather than a silent skip.
Also add a TinyGo CI job that runs a smoke program (internal/tinygocheck, built only under the tinygo build tag) so this path is exercised on every change. This addresses the concern raised in #72.