Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when accessing a null PcpNodeRef object through python #2942

Open
marktucker opened this issue Feb 9, 2024 · 1 comment
Open

Crash when accessing a null PcpNodeRef object through python #2942

marktucker opened this issue Feb 9, 2024 · 1 comment

Comments

@marktucker
Copy link
Contributor

Description of Issue

There is no protection against null pointers in the Pcp.NodeRef implementation, making it easy to cause a crash with python code. Even worse, there is not any way to detect a null pointer in the python code, so there is no way to avoid the crash even if you are aware of the potential danger.

Steps to Reproduce

  1. Run the following code in a python shell with USD libraries available:
from pxr import Usd, UsdGeom
s = Usd.Stage.CreateInMemory()
p = UsdGeom.Xform.Define(s, "/foo").GetPrim()
n = p.GetAttributes()[0].GetResolveInfo().GetNode()
  1. At this point, n refers to a null PcpNodeRef. But bool(n) returns True and n.layerStack will crash the process.

System Information (OS, Hardware)

Windows, Linux

Package Versions

23.08+, but I believe this has always been the case.

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-9288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants