Bug Hunting Session
Bug 93867 - using GL threads across threads incorrectly ...
Summary: using GL threads across threads incorrectly ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.0.2
Keywords:
: 89550 (view as bug list)
Depends on:
Blocks: VCL-OpenGL
  Show dependency treegraph
 
Reported: 2015-09-02 20:35 UTC by Michael Meeks
Modified: 2015-09-03 12:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2015-09-02 20:35:37 UTC
The unit tests threw up this nice one:

info:vcl.opengl:1052:3204:vcl/source/opengl/OpenGLHelper.cxx:701: Attaching texture 14 to framebuffer 1- no GL context
info:vcl.opengl:1052:3204:vcl/source/opengl/OpenGLHelper.cxx:701: ~OpenGLTexture 14- no GL context
info:vcl.opengl:1052:3204:vcl/source/opengl/OpenGLHelper.cxx:701: ::drawRect- no GL context
info:vcl.opengl:1052:3204:vcl/source/opengl/OpenGLHelper.cxx:701: OpenGLTexture 14 1x1 allocate- no GL context
info:vcl.opengl:1052:3204:vcl/source/opengl/OpenGLHelper.cxx:701: Attaching texture 14 to framebuffer 1- no GL context
info:vcl.opengl:1052:3204:vcl/source/opengl/OpenGLHelper.cxx:701: ~OpenGLTexture 13- no GL context
info:vcl.opengl:1052:3204:vcl/source/opengl/OpenGLHelper.cxx:701: ~OpenGLTexture 14- no GL context
info:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:701: ::drawRect
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLContext.cxx:1353: OpenGLContext::makeCurrent(): wglMakeCurrent failed: 170
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:430: GL Error #1282(invalid operation) in File C:/sources/master/vcl/opengl/gdiimpl.cxx at line: 176
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:430: GL Error #1282(invalid operation) in File C:/sources/master/vcl/opengl/gdiimpl.cxx at line: 176
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:430: GL Error #1282(invalid operation) in File C:/sources/master/vcl/opengl/gdiimpl.cxx at line: 176
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:430: GL Error #1282(invalid operation) in File C:/sources/master/vcl/opengl/gdiimpl.cxx at line: 176
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:430: GL Error #1282(invalid operation) in File C:/sources/master/vcl/opengl/gdiimpl.cxx at line: 176
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:430: GL Error #1282(invalid operation) in File C:/sources/master/vcl/opengl/gdiimpl.cxx at line: 176
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:430: GL Error #1282(invalid operation) in File C:/sources/master/vcl/opengl/gdiimpl.cxx at line: 176
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:430: GL Error #1282(invalid operation) in File C:/sources/master/vcl/opengl/gdiimpl.cxx at line: 176
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:437: Breaking potentially recursive glGetError loop

The key lines are:

info:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:701: ::drawRect
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLContext.cxx:1353: OpenGLContext::makeCurrent(): wglMakeCurrent failed: 170
warn:vcl.opengl:1052:4396:vcl/source/opengl/OpenGLHelper.cxx:430: GL Error #1282(invalid operation) in File C:/sources/master/vcl/opengl/gdiimpl.cxx at line: 176

Which shows we have switched thread happily - without (apparently) releasing the GL context properly - which is bad (TM).

This happens in CppuniTest_sc_filters_test - amusingly. In theory we have code for releasing the context here so ...
Comment 1 Commit Notification 2015-09-02 21:38:38 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=16b0e217c1f67948374ff050496e5d4ffb8ceb90

tdf#93867 - clear current GL context before thread switch.

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 2 Michael Meeks 2015-09-02 21:40:22 UTC
Pushed to master; patch for -5-0 here; review much appreciated:
    https://gerrit.libreoffice.org/18282

:-)
Comment 3 Commit Notification 2015-09-02 21:49:48 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=acbf98d6f1af77510bd0fbe0a47fba97080c1bbc&h=libreoffice-5-0

tdf#93867 - clear current GL context before thread switch.

It will be available in 5.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Michael Meeks 2015-09-02 22:14:43 UTC
pushed to both branches =) thanks Markus.
Comment 5 Miklos Vajna 2015-09-03 12:51:49 UTC
*** Bug 89550 has been marked as a duplicate of this bug. ***