Skip to content

Separately handle null data_ptr storages when creating unique ID#167405

Closed
ngimel wants to merge 1 commit intomainfrom
codex/investigate-segfaults-in-get_tensor_storage_id
Closed

Separately handle null data_ptr storages when creating unique ID#167405
ngimel wants to merge 1 commit intomainfrom
codex/investigate-segfaults-in-get_tensor_storage_id

Conversation

@ngimel
Copy link
Collaborator

@ngimel ngimel commented Nov 8, 2025

Summary

Previously fake/functionalized tensors that have null storage_ptr could segfault when checking for .expired() on weak storage ref, so handle nullptr storages separately, without checking their weakrefs.

Diagnosis and PR created by codex

Codex Task

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 8, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 9653671 with merge base 29d6bb7 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@meta-codesync
Copy link

meta-codesync bot commented Nov 8, 2025

@ngimel has imported this pull request. If you are a Meta employee, you can view this in D86582849.

@Skylion007 Skylion007 added the topic: not user facing topic category label Nov 8, 2025
@ngimel ngimel changed the title Use insert_or_assign for storage ID cache refresh Separately handle null data_ptr storages when creating unique ID Nov 9, 2025
@ngimel
Copy link
Collaborator Author

ngimel commented Nov 9, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 9, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Silv3S pushed a commit to Silv3S/pytorch that referenced this pull request Nov 18, 2025
…orch#167405)

## Summary
Previously fake/functionalized tensors that have `null` storage_ptr could segfault when checking for `.expired()` on weak storage ref, so handle `nullptr` storages separately, without checking their weakrefs.

Diagnosis and PR created by codex
------
[Codex Task](https://chatgpt.com/codex/tasks/task_e_690ea8790054832f90eaffb37ee0d8c8)
Pull Request resolved: pytorch#167405
Approved by: https://github.com/Skylion007
ngimel added a commit that referenced this pull request Nov 20, 2025
@github-actions github-actions bot deleted the codex/investigate-segfaults-in-get_tensor_storage_id branch December 10, 2025 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request codex Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants