Guard Tracing.end handler against missing Tracing.start in jsinspector-modern#56496
Closed
fkgozali wants to merge 1 commit intofacebook:mainfrom
Closed
Guard Tracing.end handler against missing Tracing.start in jsinspector-modern#56496fkgozali wants to merge 1 commit intofacebook:mainfrom
fkgozali wants to merge 1 commit intofacebook:mainfrom
Conversation
…r-modern Summary: Add a guard in the `Tracing.end` CDP handler to check `sessionState_.hasPendingTraceRecording` before calling `stopTracing()`. This prevents a null-pointer crash (SIGSEGV) in `HostTargetTraceRecording::stop()` when `Tracing.end` is sent after `Tracing.start` was rejected (e.g. due to multiple registered host targets in the global inspector singleton). The guard matches the existing pattern in `TracingAgent::~TracingAgent()` (line 29). When tracing was never started, it now returns an `InvalidRequest` error instead of crashing. Changelog: [Internal] Differential Revision: D101557975
|
@fkgozali has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101557975. |
|
This pull request has been merged in 786ebf0. |
Collaborator
|
This pull request was successfully merged by @fkgozali in 786ebf0 When will my fix make it into a release? | How to file a pick request? |
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.
Summary:
Add a guard in the
Tracing.endCDP handler to checksessionState_.hasPendingTraceRecordingbefore callingstopTracing(). This prevents a null-pointer crash (SIGSEGV) inHostTargetTraceRecording::stop()whenTracing.endis sent afterTracing.startwas rejected (e.g. due to multiple registered host targets in the global inspector singleton).The guard matches the existing pattern in
TracingAgent::~TracingAgent()(line 29). When tracing was never started, it now returns anInvalidRequesterror instead of crashing.Changelog: [Internal]
Differential Revision: D101557975