This repository was archived by the owner on Jul 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 643
Add stacktrace dump and better error messages on EXC_BAD_ACCESS panics #2904
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c249f49
Merge remote-tracking branch 'upstream/master'
lggomez 7501734
Merge remote-tracking branch 'origin/master'
lggomez fe2cb47
Merge remote-tracking branch 'upstream/master'
lggomez 9359e1c
Merge branch 'master' of https://github.com/Microsoft/vscode-go
lggomez 295cb87
Merge branch 'master' of ssh://github.com/microsoft/vscode-go
lggomezml 24e363e
Add stacktrace dump and better error messages on EXC_BAD_ACCESS panics
lggomez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
goroutineIdhere will always be 0 as this code path is not inside the callback provided to the delve call a few lines above.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhendrixMSFT @ramya-rao-a I think I solved the issue of state returning always (?) zero. The gist of the debugger state is that there seems to be no currentGoroutine in this scenario so we have to default to the currentThread goroutineId:
This is the apicall response:
{ "Running": false, "currentThread": { "id": 5142829, "pc": 17138024, "file": "/Users/lgomez/DEV/go/test_1903/main.go", "line": 5, "function": { "name": "main.oops", "value": 17138000, "type": 0, "goType": 0, "optimized": false }, "goroutineID": 1, "ReturnValues": null }, "Threads": [ { "id": 5142829, "pc": 17138024, "file": "/Users/lgomez/DEV/go/test_1903/main.go", "line": 5, "function": { "name": "main.oops", "value": 17138000, "type": 0, "goType": 0, "optimized": false }, "goroutineID": 1, "ReturnValues": null }, { "id": 5142873, "pc": 140734907268914, "file": "", "line": 0, "goroutineID": 0, "ReturnValues": null }, { "id": 5142874, "pc": 140734907267178, "file": "", "line": 0, "goroutineID": 0, "ReturnValues": null }, { "id": 5142875, "pc": 140734907267178, "file": "", "line": 0, "goroutineID": 0, "ReturnValues": null }, { "id": 5142876, "pc": 140734907267178, "file": "", "line": 0, "goroutineID": 0, "ReturnValues": null } ], "NextInProgress": false, "exited": false, "exitStatus": 0, "When": "" }And this is the handled panic with the updated behavior:

This is on mac, I´ll try this at home later to see if the response is different on linux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not getting the currentGoroutine on linux either, i'm trying other goroutine examples and i'm even reproducing #2563 while at it so I'm willing to say this is our best bet for now. We're supposed to be getting this field but we can follow up on that issue since it is better suited for its root cause