Bug 13767

Summary: OpenColorIO with yaml-cpp>0.3 makes Krita-git-master crash
Product: Mageia Reporter: Timothée Giet <animtim>
Component: RPM PackagesAssignee: Rémi Verschelde <rverschelde>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: dimula73, fundawang
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
URL: http://paste.kde.org/pebqsmfga
Whiteboard:
Source RPM: opencolorio-1.0.9-3.mga5.src.rpm CVE:
Status comment:

Description Timothée Giet 2014-07-19 10:18:27 CEST
Description of problem:

Trying to use Krita from git-master branch, it crashes with the attached backtrace. It works if I replace all yaml-cpp and opencolorio related packages with those from Mageia4 (using yaml-cpp 0.3..). I reported the crash to the Krita developper in charge of OCIO support and he asked to report this issue upstream to Mageia or OCIO..

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.


Reproducible: 

Steps to Reproduce:
David Walser 2014-07-19 12:16:43 CEST

CC: (none) => fundawang
Assignee: bugsquad => remi

Comment 1 Rémi Verschelde 2014-07-20 19:36:43 CEST
Thanks for the report Timothée. I will look into it and see if the latest revision of OpenColorIO fixes the issue. If not, I'll report it upstream to OpenColorIO.
Comment 2 Rémi Verschelde 2014-07-20 20:03:49 CEST
At first, I can't seem to reproduce a crash using Krita 2.8.5 (from core/release) with OpenColorIO 1.0.9+ and yaml-cpp 0.5.1.

Does Krita from the master branch crash on startup, or when doing something particular?
Comment 3 Timothée Giet 2014-07-21 00:11:20 CEST
Yes 2.8.5 package is latest released version, which had only very limited OCIO support, and so didn't show this issue.
In current git master branch (which will be 2.9 ..), OCIO support have been extended a lot, with new LUT docker and color selector.

It crashes on creating the canvas window, that is after pressing the "create" button for new document or opening a new one from the initial launch window.
Comment 4 Rémi Verschelde 2014-08-06 20:15:37 CEST
Could you see if you can reproduce the issue with these OCIO RPMs?
http://remi.verschelde.fr/files/packages/mga5/

They are based upon the master branch of OCIO's github repo.
Comment 5 Timothée Giet 2014-08-06 21:16:47 CEST
So I tried those packages, rebuilt Krita and I still have same crash when launching the canvas view: "krita(695) LutDockerDock::resetOcioConfiguration: OpenColorIO Error: Error: Loading the OCIO profile failed. yaml-cpp: error at line 0, column 0: invalid node; this may result from using a map iterator as a sequence iterator, or vice-versa Cannot create the LUT docker "

From what Dmitry Kazakov told me, it is a big change in yaml-cpp between 0.3 and 0.5, and he said he don't intend to support yaml-cpp 0.5 for now..

I still workaround the issue by using the yaml-cpp and opencolorio packages from Mageia4, but that will be an issue when krita 2.9 is released, we won't be able to package it using yaml-cpp 0.5.

Any idea how we could find a good solution?
Timothée Giet 2014-08-06 21:21:38 CEST

Summary: OpenColorIO with yaml-cpp>0.5 patch makes Krita-git-master crash => OpenColorIO with yaml-cpp>0.3 makes Krita-git-master crash

Comment 6 Rémi Verschelde 2014-08-07 01:30:19 CEST
A solution could be to package again yaml-cpp 0.3 as "yaml-cpp0.3" and to drop the OpenColorIO patch that adds yaml-cpp 0.5+ support.

Most likely the next release of OpenColorIO will need yaml-cpp >= 0.5, so the "best" solution would be for Krita to be adapted to work with yaml-cpp 0.5+, but I guess Dmitry Kazakov has his reason not to do so.
Comment 7 Dmitry Kazakov 2014-08-07 10:12:52 CEST
Hi, Remi!

From what I saw in backtraces, the patched OCIO was crashing while trying to load the default NOOP profile, which is hardcoded in Config.cpp and is stored in INTERNAL_RAW_PROFILE constant. Such execution path is invoked every time when it cannot find a decent config, e.g. when fetching from an env. variable, which is not defined.

Given that OCIO crashes when trying to load its internal hardcoded config I concluded that the patch, which ported it to yaml-0.5 has a bug, so I recommended Timothee to report the bug here.

CC: (none) => dimula73

Comment 8 Rémi Verschelde 2014-08-07 10:27:00 CEST
Hi Dmitry! Thanks for your feedback.

The patch that I used for Mageia's OCIO package [1] was cherry-picked from OCIO's github repository [2]. Note that the commit description refers to yaml-cpp 5.0.1, but it is in fact 0.5.1.

The only difference is that I removed the bundled yaml-cpp 0.5.1 source tarball from the github patch (both because I don't want it since it should use the system yaml-cpp, and because obviously binaries can't be added as a patch ;) ).

So maybe an issue should be opened at OCIO's github repo?

Timothée's tests in comment 5 also rule out the possibility that the aforementioned bug was fixed in a later commit in OCIO's master branch, since the bug is still present with RPMs of OCIO's master branch.

[1] http://svnweb.mageia.org/packages/cauldron/opencolorio/current/SOURCES/opencolorio-1.0.9-git-Add-support-for-yaml-cpp-0.5.1.patch?view=markup
[2] https://github.com/imageworks/OpenColorIO/commit/63c6bde2acac363c8c5e7fd3d744e17ea99e20ab
Comment 9 Timothée Giet 2014-08-07 11:09:01 CEST
Bug forwarded to OCIO:
https://github.com/imageworks/OpenColorIO/issues/369
Comment 10 Timothée Giet 2014-09-04 02:20:17 CEST
Someone at OCIO made a patch to fix this bug.
The patch is still on pull request, but maybe you can add it to current 1.0.9 spec.
https://github.com/imageworks/OpenColorIO/pull/373
Comment 11 Rémi Verschelde 2014-09-04 07:16:38 CEST
Thanks Timothée, I'll have a look at this in the week-end :-)
Comment 12 Rémi Verschelde 2014-09-08 14:20:49 CEST
I pushed opencolorio-1.0.9-6.mga5 with the fix from upstream. Can you confirm that it solves the issue?
Comment 13 Timothée Giet 2014-09-08 22:07:51 CEST
Yes, it looks like it solves this issue, thanks!
Comment 14 Rémi Verschelde 2014-09-08 22:13:17 CEST
Nice :-) It seems it also fixed an issue with Blender built with OpenColorIO support.

Status: NEW => RESOLVED
Resolution: (none) => FIXED