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

Add checks for loops being created on nodes #2029

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fnRaihanKibria
Copy link

Addressing issue #1932

The cause of the crash is a buffer overrun in ShaderGraph::topologicalSort() in the line _nodeOrder[count++] = node;. This is caused by a loop edge being present on the 'color_mix' node of the graph object this was called on, which made the sort algorithm malfunction.

Unfortunately I was unable to determine in the time I have available why this loop is created. I didn't want to add a change that hides the underlying problem, which still needs to be fixed. Instead, this PR adds some checks to two locations in the code that throw exceptions when a case of a loop being created is detected, to aid in fixing the real issue and maybe help diagnosing other problems in the future. With this PR the graph editor does not crash any more, instead an error message "Upstream node 'color_mix' has itself as downstream node, creating a loop" is printed to console.

Copy link

linux-foundation-easycla bot commented Sep 27, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: fnRaihanKibria (e58370d)

@jstone-lucasfilm
Copy link
Member

This looks like a great first step, thanks @fnRaihanKibria! I'm CC'ing @niklasharrysson for his expertise with this code, and we can discuss next steps.

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

Successfully merging this pull request may close these issues.

2 participants