Skip to content

Guard Tracing.end handler against missing Tracing.start in jsinspector-modern#56496

Closed
fkgozali wants to merge 1 commit intofacebook:mainfrom
fkgozali:export-D101557975
Closed

Guard Tracing.end handler against missing Tracing.start in jsinspector-modern#56496
fkgozali wants to merge 1 commit intofacebook:mainfrom
fkgozali:export-D101557975

Conversation

@fkgozali
Copy link
Copy Markdown
Contributor

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

…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
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 19, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 19, 2026

@fkgozali has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101557975.

@meta-codesync meta-codesync Bot closed this in 786ebf0 Apr 20, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label Apr 20, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 20, 2026

This pull request has been merged in 786ebf0.

@react-native-bot
Copy link
Copy Markdown
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants