Steps:
- Turn on OCIO
- Observe crash.
Steps:
The crash replaced itself with another.
Strange, because this doesn't happen for me now... At least not on the desktop. I'll try on my laptop instead.
Still have an ocio crash of sorts, but why...?
offending line at /home/krita/kde/src/krita/plugins/dockers/lut/ocio_display_filter.cpp:255
255 glFuncs3->glGenTextures(1, &m_lut3dTexID);
There's three possible paths to a crash for me:
@Nim suggested I'd backtrace the 3rd as well, and indeed segfault happens on a different spot:
KisOpenGLImageTextures::createImageTextureTiles (this=0xb4e8750) at /home/krita/kde/src/krita/libs/ui/opengl/kis_opengl_image_textures.cpp:188 188 const int pixelSize = m_tilesDestinationColorSpace->pixelSize();
Apparantly this laptop can't give OpenGL 3.2 functions according to qt, despite having access to 3.3 functions...
Changing
QOpenGLFunctions_3_2_Core *glFuncs3 = QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>();
to
QOpenGLFunctions_2_1 *glFuncs3 = QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_2_1>();
And of course the relevant include fixes the problem for me, but no idea how to do this elegantly...
I have a canvas and OpenGL on. Then I switch off OpenGL and exit the program. The program crashes with segfault in KisOpenGLImageTextures::destroyImageTextureTiles(). The crash happens when it calls delete tile, the deleted tile is the first on the list and it's value is not NULL.
My problem is still happens, perhaps not related but who knows? This is what I found:
After I disabled OpenGL, the KisTextureTiles on the m_textureTiles list remains in the memory until exiting the program, then the destructor of KisOpenGLImageTextures tries to delete them. This is when the crash happens.
When this happens, I think the QOpenGLFunctions table in the tile destructor (to call the glDeleteTextures) is already invalid. It also means the m_glFuncs in the KisOpenGLImageTextures is invalid as well.
But when this happens, actually there is a current, valid QOpenGLContext, but it has a different QOpenGLFunctions table (on a different memory address).
I tried to change both of these to use the table from the current QOpenGLContext (in the ~KisTextureTile() and ~KisOpenGLImageTextures() calls) and it seems working, at least there is no crash. But perhaps using a different table for creating and deleting is a dangerous idea. I think the program should purge all OpenGL related things right when the user disables OpenGL, while the original table is still valid.
But I'm afraid this is too much for me to solve.
It looks like the the tiles are leaking through the animation cache pointer stored in timeline docker