Skip to content

Fix nullptr dereference segfault in QNN runtime when op_package_options is null#20759

Merged
psiddh merged 2 commits into
pytorch:mainfrom
RanjithRagavan:fix-qnn-nullptr
Jul 8, 2026
Merged

Fix nullptr dereference segfault in QNN runtime when op_package_options is null#20759
psiddh merged 2 commits into
pytorch:mainfrom
RanjithRagavan:fix-qnn-nullptr

Conversation

@RanjithRagavan

@RanjithRagavan RanjithRagavan commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a nullptr dereference segmentation fault in Qualcomm QNN backend's runtime when 'op_package_options' is not present in the serialized metadata (which is common for standard models). It adds null-safety checks before dereferencing options in QnnManager.cpp and QnnBackendCommon.cpp. Fixes #20619.

cc @cbilgin @psiddh

@pytorch-bot

pytorch-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20759

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 2 Unrelated Failures

As of commit f4068e0 with merge base b1ef9a5 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following job failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@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 Jul 7, 2026
@RanjithRagavan

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "release notes: none"

@pytorch-bot pytorch-bot Bot added the release notes: none Do not include this in the release notes label Jul 7, 2026

@shewu-quic shewu-quic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your fix

@psiddh psiddh merged commit fa703b4 into pytorch:main Jul 8, 2026
185 of 190 checks passed
@nil-is-all nil-is-all added the module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/ label Jul 8, 2026
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. module: qnn Issues related to Qualcomm's QNN delegate and code under backends/qualcomm/ release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run llm on qualcomm device failed!

4 participants