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

MAYA-113559 prevent crash when accessing a stale attribute from Python #1675

Merged
merged 2 commits into from
Sep 7, 2021

Conversation

pierrebai-adsk
Copy link
Collaborator

User (and ours) Python scripts can keep variable holding references to invalid USD attributes. Detect when an invalid USD attribute is accessed and prevent getting and setting its value rather than using invalid pointers and crash.

This was triggered in our own UI code when receiving notifications of attribute value change when two scenes with prim with identical UFE paths were manipulated in successsion in a Python script.

A typical example was a Python script that created a new Maya scene, a new USD stage, and a cone within that stage and setting a value on a property. Re-running the script within the same Maya session would crash.

User (and ours) Python scripts can keep variable holding references to invalid USD attributes. Detect when an invalid USD attribute is accessed and prevent getting and setting its value rather than using invalid pointers and crash.

This was triggered in our own UI code when receiving notifications of attribute value change when two scenes with prim with identical UFE paths were manipulated in successsion in a Python script.

A typical example was a Python script that created a new Maya scene, a new USD stage, and a cone within that stage and setting a value on a property. Re-running the script within the same Maya session would crash.
Copy link
Collaborator

@ppt-adsk ppt-adsk left a comment

Choose a reason for hiding this comment

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

Good catch!

lib/mayaUsd/ufe/UsdAttribute.cpp Outdated Show resolved Hide resolved
@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Sep 1, 2021
@kxl-adsk kxl-adsk merged commit ff41eb9 into dev Sep 7, 2021
@kxl-adsk kxl-adsk deleted the t_bailp/MAYA-113559/prevent-stae-attr-access-crash branch September 7, 2021 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants