-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
60725: tracing: harden against use-after-Finish r=knz a=tbg `net/trace`'s `Trace` is notoriously panicky when used after a call to `.Finish()`. We don't like such calls and try to avoid them, but they are hard to conclusively disprove. Besides, the opposite - never calling `.Finish()` is even worse, so in general we'd like to err on the side of use-after-free and want that to be safe. This commit does that: we move `Span` to `spanInner` and `*Span` becomes a simple wrapper that turns most operations into no-ops once the first call to `.Finish` has been initiated. While I was there, I also removed `IsBlackHole()` which wasn't really useful any more. This fixes the following crash: #58489 (comment) which was surfaced by a recent switch in that test to enable tracing throughout (precisely to find these crashes!). Release note (bug fix): fixed a bug that could result in crashes during tracing when using the `trace.debug.enable` cluster setting. Co-authored-by: Tobias Grieger <[email protected]>
- Loading branch information
Showing
13 changed files
with
292 additions
and
153 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.