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

Segmentation fault can result in ctlrender when the number of instructions gets too large #150

Closed
scottdyer opened this issue Apr 20, 2024 · 0 comments · Fixed by #151
Closed

Comments

@scottdyer
Copy link
Contributor

The ACES v2 Output Transform code builds a table using a binary search algorithm which has a very large number of operations performed in sequence. There is a point when the number of operations exceeds the limit and an exception is thrown without much other context provided.

It seems there is an arbitrary limit on CTL instructions that the iterative search is surpassing.

Proven fix

A fix for this that I'm successfully tested and been able to use.:
@michaeldsmith helped me trace the exception down to a value in \lib\IlmCtlSimd\CtlSimdInterpreter.cpp

The specific line is
_data->maxInstCount = 10000000;

And adding a factor of 10 to it seems sufficient to no longer reach the threshold:
_data->maxInstCount = 10*10000000;

I expect others will encounter this limitation if they too try to run the v2 Output Transforms, so I suggest increasing the value of this variable to a larger number.

michaeldsmith added a commit to michaeldsmith/CTL that referenced this issue Apr 20, 2024
michaeldsmith added a commit that referenced this issue Apr 21, 2024
* add test for maxInstCount exception, improve exception message output

* increase maxInstCount to 100 million, fixes #150
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

Successfully merging a pull request may close this issue.

1 participant