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

UsdStage::CreateNew with bad path causes stack overflow #364

Closed
jcowles opened this issue Jan 14, 2018 · 1 comment
Closed

UsdStage::CreateNew with bad path causes stack overflow #364

jcowles opened this issue Jan 14, 2018 · 1 comment

Comments

@jcowles
Copy link

jcowles commented Jan 14, 2018

Description of Issue

Calling CreateNew with a non-existing path causes a stack overflow, at least on Windows.

Steps to Reproduce

In a python terminal:

from pxr import Usd
Usd.Stage.CreateNew(r"C:\This\Doesnt\Exist.usd")

This will cause Python to segfault. Running the same function call in C# results in an exception indicating that there was a stack overflow.

System Information (OS, Hardware)

Windows

Package Versions

USD v0.8.2

Build Flags

python build_scripts\build_usd.py
--build-monolithic
--no-tests
--no-docs
--no-ptex
--no-embree
--alembic
--no-hdf5
build_monolithic_py

@jtran56
Copy link

jtran56 commented Jan 16, 2018

Filed as internal issue #155863.

AdamFelt pushed a commit to autodesk-forks/USD that referenced this issue Apr 16, 2024
…ue on Mac" (PixarAnimationStudios#364)

### Description of Change(s)
The intention of the submit ab0520a was to make the ComputeViewport the same in OpenGL and Metal. 

Originally, in Metal, ComputeViewport will just output the dataWIndow as the viewport. And in HgiMetalGraphicsCmds::SetViewport, it uses "viewportHeight - viewportMinY" as the final minY. So we can know:
finalMinY = viewportHeight - viewportMinY = windowHeight - windowMinY.

In the submit of ab0520a, it uses the OpenGL calculation in ComputeViewport for both OpenGL and Metal. So ComputeViewport will use "frameBufferHeight - windowMinY - windowHeight" as the minY of viewport. And in HgiMetalGraphicsCmds::SetViewport, it uses "viewportHeight + viewportMin" as the final minY. So now :
finalMinY = viewportHeight + viewportMinY = windowHeight + frameBufferHeight - windwMinY - windowHeight = framebufferHeight - windowMinY.

Indeed after this change, the finalMinY is different from the original finalMinY. If framebufferHeight is the same as the windowHeight, there is no problem. If they are different, the rendering result will be indirect.

So here we just revert the change.

### Fixes Issue(s)
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

3 participants