OCIO crash/abort using Filmic Medium Contrast #85671

Closed
opened 2021-02-15 22:44:07 +01:00 by Scott Ramsay · 18 comments

System Information
Operating system: Linux-5.10.15-arch1-1-x86_64-with-glibc2.33 64 Bits
Graphics card: GeForce RTX 2070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.39

Blender Version
Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-02-15 19:30, hash: c53022768b
Worked: (newest version of Blender that worked as expected)

Short description of error
Attempting to select Filmic's "Medium Contrast" setting while using Eevee or Cycles crashes blender.
It only crashes when building with 'WITH_ASSERT_ABORT' enabled.
Apparently builder.blender.org doesn't, so it only prints this resulting error to the console:
OpenColorIO Error: LookTransform: empty destination color space name.

Exact steps for others to reproduce the error
From the default startup file:

  1. Enter Material Preview mode in the 3D viewport.
  2. In the Properties editor, go to Render Properties > Color Management > Look, select 'Medium Contrast'.
  3. Blender crashes.

gdb-backtrace_ocio-abort.txt

**System Information** Operating system: Linux-5.10.15-arch1-1-x86_64-with-glibc2.33 64 Bits Graphics card: GeForce RTX 2070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.39 **Blender Version** Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-02-15 19:30, hash: `c53022768b` Worked: (newest version of Blender that worked as expected) **Short description of error** Attempting to select Filmic's "Medium Contrast" setting while using Eevee or Cycles crashes blender. It only crashes when building with 'WITH_ASSERT_ABORT' enabled. Apparently builder.blender.org doesn't, so it only prints this resulting error to the console: `OpenColorIO Error: LookTransform: empty destination color space name.` **Exact steps for others to reproduce the error** From the default startup file: 1. Enter Material Preview mode in the 3D viewport. 2. In the Properties editor, go to Render Properties > Color Management > Look, select 'Medium Contrast'. 3. Blender crashes. [gdb-backtrace_ocio-abort.txt](https://archive.blender.org/developer/F9805630/gdb-backtrace_ocio-abort.txt)
Author

Added subscriber: @smramsay

Added subscriber: @smramsay
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

I can confirm. Due to my personal build crashing, but the buildbot not crashing, I wasn’t sure if it was something in my build causing the crashes. I decided to do a new clean build of master, which is hitting the issue of the CMake files being updated, but not the svn libraries on Windows. Edit: Turns out this was a different error. So, for fun, I am currently building said libraries which takes hours. Until that is done I can’t personally debug this further.

OpenColorIO Error: LookTransform: empty destination color space name. does show in the debug log file both in the buildbot and my personal build. When my build crashes, no stack trace file is produced.

I can confirm. Due to my personal build crashing, but the buildbot not crashing, I wasn’t sure if it was something in my build causing the crashes. I decided to do a new clean build of master, ~~which is hitting the issue of the CMake files being updated, but not the svn libraries on Windows.~~ *Edit: Turns out this was a different error.* So, for fun, I am currently building said libraries which takes hours. Until that is done I can’t personally debug this further. `OpenColorIO Error: LookTransform: empty destination color space name.` does show in the debug log file both in the buildbot and my personal build. When my build crashes, no stack trace file is produced.
Member

Added subscribers: @troy_s, @Blendify

Added subscribers: @troy_s, @Blendify
Member

Filmic has to updated for OCIO 2.0. CC @troy_s

Filmic has to updated for OCIO 2.0. CC @troy_s

I don't quite understand why it would suddenly fail under V2, and it sure doesn't give much of a hint as to why. Is it plausible this is a Blender bug via the V2 implementation?

Someone should test against the version in my GitHub.

I don't quite understand why it would suddenly fail under V2, and it sure doesn't give much of a hint as to why. Is it plausible this is a Blender bug via the V2 implementation? Someone should test against the version in my GitHub.
Member

In #85671#1112649, @troy_s wrote:
I don't quite understand why it would suddenly fail under V2, and it sure doesn't give much of a hint as to why. Is it plausible this is a Blender bug via the V2 implementation?

That seems to me to be the most likely explanation. When testing Blender’s OCIO v2 implementation using Doug Walker’s sample config, it would cause my release Blender build to crash when rendering. I got sidetracked trying to debug it as MSVC was hitting a “User breakpoint” that would open the Disassembler when rendering in my debug build. I hadn’t set any specific breakpoints, let alone any in the Assembly code.

Someone should test against the version in my GitHub.

Will do!

> In #85671#1112649, @troy_s wrote: > I don't quite understand why it would suddenly fail under V2, and it sure doesn't give much of a hint as to why. Is it plausible this is a Blender bug via the V2 implementation? That seems to me to be the most likely explanation. When testing Blender’s OCIO v2 implementation using Doug Walker’s sample config, it would cause my release Blender build to crash when rendering. I got sidetracked trying to debug it as MSVC was hitting a “User breakpoint” that would open the Disassembler when rendering in my debug build. I hadn’t set any specific breakpoints, let alone any in the Assembly code. > > Someone should test against the version in my GitHub. Will do!

Added subscriber: @whyohme

Added subscriber: @whyohme

this only happens with the "Medium Contrast" look - in datafiles/colormangement/config.ocio you can see that's the only Look with no FileTransform children. Perhaps that's no longer allowed in OCIO v2?

fwiw, selecting Look "None" works around the problem - presumably that's effectively the same transform (the result certainly looks the same).

this only happens with the "Medium Contrast" look - in datafiles/colormangement/config.ocio you can see that's the only Look with no FileTransform children. Perhaps that's no longer allowed in OCIO v2? fwiw, selecting Look "None" works around the problem - presumably that's effectively the same transform (the result certainly looks the same).

this only happens with the "Medium Contrast" look

Again, try it with the GitHub version.

> this only happens with the "Medium Contrast" look Again, try it with the GitHub version.
Member

In #85671#1113073, @troy_s wrote:

this only happens with the "Medium Contrast" look

Again, try it with the GitHub version.

No crashes using your Github master version nor your Olive version (just to be thorough), as of course there is no Medium Contrast. Base Contrast works as expected: no crashing.

> In #85671#1113073, @troy_s wrote: >> this only happens with the "Medium Contrast" look > > Again, try it with the GitHub version. No crashes using your Github master version nor your Olive version (just to be thorough), as of course there is no `Medium Contrast`. `Base Contrast` works as expected: no crashing.
Member

In #85671#1113043, @whyohme wrote:
this only happens with the "Medium Contrast" look - in datafiles/colormangement/config.ocio you can see that's the only Look with no FileTransform children. Perhaps that's no longer allowed in OCIO v2?

fwiw, selecting Look "None" works around the problem - presumably that's effectively the same transform (the result certainly looks the same).

None is literally "there is no Look transform" as far as I understand it.
I do know that the meaning/use of strictparsing changed from v1 to v2, because the documentation notes that it did, but doesn't say how exactly as far as I can see. Will look again.

My thought is that in v1, Medium Contrast not pointing to a file meant that it was just ignored as a No-Op. Now Medium Contrast causes an error since there is no file specified.

> In #85671#1113043, @whyohme wrote: > this only happens with the "Medium Contrast" look - in datafiles/colormangement/config.ocio you can see that's the only Look with no FileTransform children. Perhaps that's no longer allowed in OCIO v2? > > fwiw, selecting Look "None" works around the problem - presumably that's effectively the same transform (the result certainly looks the same). `None` is literally "there is no Look transform" as far as I understand it. ~~I do know that the meaning/use of `strictparsing` changed from v1 to v2, because the documentation notes that it did, but doesn't say how exactly as far as I can see. Will look again.~~ My thought is that in v1, `Medium Contrast` not pointing to a file meant that it was just ignored as a No-Op. Now `Medium Contrast` causes an error since there is no file specified.
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author

Copy/pasting FileTransform lines from other looks to fill in Medium Contrast does stop the crash.
Similarly, deleting the lines in others makes those looks crash too.

Code-wise, an OCIO function is returning an empty string which is then passed on.
(Turns out that vague error is actually dead on.)
Manually setting the string when it is empty, also avoids the crash.

diff --git a/intern/opencolorio/ocio_impl.cc b/intern/opencolorio/ocio_impl.cc
index 69a8d8b17af..2e7f5ef71dc 100644
--- a/intern/opencolorio/ocio_impl.cc
+++ b/intern/opencolorio/ocio_impl.cc
@@ -686,10 +686,14 @@ OCIO_ConstProcessorRcPtr *OCIOImpl::createDisplayProcessor(OCIO_ConstConfigRcPtr
   if (use_look) {
     const char *look_output = LookTransform::GetLooksResultColorSpace(
         config, config->getCurrentContext(), look);
+    printf("Look: %s, Destination: %s\n", look, look_output);
+    if (strlen(look_output) == 0) {
+      look_output = "Filmic Log";
+    }
 
     LookTransformRcPtr lt = LookTransform::Create();
     lt->setSrc(input);
-    lt->setDst(look_output);
+    lt->setDst(look_output); /*Setting this to empty string.*/
     lt->setLooks(look);
     group->appendTransform(lt);

Whether it's an error in the config, or in OCIO's parsing, or in not checking the returned result, or even something else is beyond me.

Copy/pasting FileTransform lines from other looks to fill in Medium Contrast does stop the crash. Similarly, deleting the lines in others makes those looks crash too. Code-wise, an OCIO function is returning an empty string which is then passed on. (Turns out that vague error is actually dead on.) Manually setting the string when it is empty, also avoids the crash. ``` diff --git a/intern/opencolorio/ocio_impl.cc b/intern/opencolorio/ocio_impl.cc index 69a8d8b17af..2e7f5ef71dc 100644 --- a/intern/opencolorio/ocio_impl.cc +++ b/intern/opencolorio/ocio_impl.cc @@ -686,10 +686,14 @@ OCIO_ConstProcessorRcPtr *OCIOImpl::createDisplayProcessor(OCIO_ConstConfigRcPtr if (use_look) { const char *look_output = LookTransform::GetLooksResultColorSpace( config, config->getCurrentContext(), look); + printf("Look: %s, Destination: %s\n", look, look_output); + if (strlen(look_output) == 0) { + look_output = "Filmic Log"; + } LookTransformRcPtr lt = LookTransform::Create(); lt->setSrc(input); - lt->setDst(look_output); + lt->setDst(look_output); /*Setting this to empty string.*/ lt->setLooks(look); group->appendTransform(lt); ``` Whether it's an error in the config, or in OCIO's parsing, or in not checking the returned result, or even something else is beyond me.
Evan Wilson changed title from OCIO abort using Filmic Medium Contrast to OCIO crash/abort using Filmic Medium Contrast 2021-02-16 20:30:28 +01:00
Member

Added subscriber: @brecht

Added subscriber: @brecht
Member

In #85671#1113591, @smramsay wrote:
Copy/pasting FileTransform lines from other looks to fill in Medium Contrast does stop the crash.

 1 file changed, 2 insertions(+)

diff --git a/release/datafiles/colormanagement/config.ocio b/release/datafiles/colormanagement/config.ocio
index 8da4b13df00..8be61139de0 100644
    - a/release/datafiles/colormanagement/config.ocio
+++ b/release/datafiles/colormanagement/config.ocio
@@ -257,6 +257,8 @@ looks:

process_space: Filmic Log
transform: !
children:

+            - !<FileTransform> {src: filmic_to_0-70_1-03.spi1d, interpolation: linear}
+            - !<FileTransform> {src: filmic_to_0-70_1-03.spi1d, interpolation: linear, direction: inverse}		
 
   - !<Look>

name: Medium Low Contrast

Here is the config file with the above changes.
config.ocio

Posting it here as replacing the current config with this one can work as a temporary workaround for the crashing at least, even if it isn't the correct full solution.

The correct solution should also deal with the empty string, as an empty string shouldn't lead to a crash IMO.

Similarly, deleting the lines in others makes those looks crash too.

Code-wise, an OCIO function is returning an empty string which is then passed on.
(Turns out that vague error is actually dead on.)
Manually setting the string when it is empty, also avoids the crash.

diff --git a/intern/opencolorio/ocio_impl.cc b/intern/opencolorio/ocio_impl.cc
index 69a8d8b17af..2e7f5ef71dc 100644
--- a/intern/opencolorio/ocio_impl.cc
+++ b/intern/opencolorio/ocio_impl.cc
@@ -686,10 +686,14 @@ OCIO_ConstProcessorRcPtr *OCIOImpl::createDisplayProcessor(OCIO_ConstConfigRcPtr
   if (use_look) {
     const char *look_output = LookTransform::GetLooksResultColorSpace(
         config, config->getCurrentContext(), look);
+    printf("Look: %s, Destination: %s\n", look, look_output);
+    if (strlen(look_output) == 0) {
+      look_output = "Filmic Log";
+    }
 
     LookTransformRcPtr lt = LookTransform::Create();
     lt->setSrc(input);
-    lt->setDst(look_output);
+    lt->setDst(look_output); /*Setting this to empty string.*/
     lt->setLooks(look);
     group->appendTransform(lt);

Whether it's an error in the config, or in OCIO's parsing, or in not checking the returned result, or even something else is beyond me.

@brecht any thoughts on handling the empty string?

> In #85671#1113591, @smramsay wrote: > Copy/pasting FileTransform lines from other looks to fill in Medium Contrast does stop the crash. ``` release/datafiles/colormanagement/config.ocio | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release/datafiles/colormanagement/config.ocio b/release/datafiles/colormanagement/config.ocio index 8da4b13df00..8be61139de0 100644 - a/release/datafiles/colormanagement/config.ocio +++ b/release/datafiles/colormanagement/config.ocio @@ -257,6 +257,8 @@ looks: ``` process_space: Filmic Log transform: !<GroupTransform> children: ``` + - !<FileTransform> {src: filmic_to_0-70_1-03.spi1d, interpolation: linear} + - !<FileTransform> {src: filmic_to_0-70_1-03.spi1d, interpolation: linear, direction: inverse} - !<Look> ``` name: Medium Low Contrast ``` ``` Here is the config file with the above changes. [config.ocio](https://archive.blender.org/developer/F9809700/config.ocio) Posting it here as replacing the current config with this one can work as a temporary workaround for the crashing at least, even if it isn't the correct full solution. The correct solution should also deal with the empty string, as an empty string shouldn't lead to a crash IMO. > Similarly, deleting the lines in others makes those looks crash too. > > Code-wise, an OCIO function is returning an empty string which is then passed on. > (Turns out that vague error is actually dead on.) > Manually setting the string when it is empty, also avoids the crash. > > ``` > diff --git a/intern/opencolorio/ocio_impl.cc b/intern/opencolorio/ocio_impl.cc > index 69a8d8b17af..2e7f5ef71dc 100644 > --- a/intern/opencolorio/ocio_impl.cc > +++ b/intern/opencolorio/ocio_impl.cc > @@ -686,10 +686,14 @@ OCIO_ConstProcessorRcPtr *OCIOImpl::createDisplayProcessor(OCIO_ConstConfigRcPtr > if (use_look) { > const char *look_output = LookTransform::GetLooksResultColorSpace( > config, config->getCurrentContext(), look); > + printf("Look: %s, Destination: %s\n", look, look_output); > + if (strlen(look_output) == 0) { > + look_output = "Filmic Log"; > + } > > LookTransformRcPtr lt = LookTransform::Create(); > lt->setSrc(input); > - lt->setDst(look_output); > + lt->setDst(look_output); /*Setting this to empty string.*/ > lt->setLooks(look); > group->appendTransform(lt); > ``` > > Whether it's an error in the config, or in OCIO's parsing, or in not checking the returned result, or even something else is beyond me. @brecht any thoughts on handling the empty string?

This issue was referenced by c9c4802c1c

This issue was referenced by c9c4802c1c26d1125d9bb41ff9187b61e167cc42

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Brecht Van Lommel self-assigned this 2021-02-16 23:29:32 +01:00
Thomas Dinges added this to the 2.93 LTS milestone 2023-02-07 18:46:33 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#85671
No description provided.