Bug 81055 - Crash due to inadequate checks for GL version / capabilities
Summary: Crash due to inadequate checks for GL version / capabilities
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
4.3.0.2 rc
Hardware: Other All
: high major
Assignee: Tamás Zolnai
URL:
Whiteboard: target:4.4.0 target:4.3.1
Keywords:
Depends on:
Blocks: Impress-OpenGL 3D-Model mab4.3 81107
  Show dependency treegraph
 
Reported: 2014-07-08 14:38 UTC by sophie
Modified: 2016-11-07 15:36 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
linux backtrace (6.30 KB, application/zip)
2014-07-08 15:00 UTC, Yousuf Philips (jay) (retired)
Details
Windows backtrace (43.51 KB, text/plain)
2014-07-11 16:01 UTC, pierre-yves samyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sophie 2014-07-08 14:38:47 UTC
Hi, when trying to open the document provided on the feature page to illustrate the new functionality, it crashes.
To reproduce, download the file:
https://wiki.documentfoundation.org/images/e/e1/Duck_gltf_model.odp
try to open it. 
It happens also with the Monster document.
My version : 4.3.0.2
Build ID: 14ed55896fdfcb93ff437b85c4f3e1923d2b1409 Ubuntu 14.04 x64. Sophie
Comment 1 Yousuf Philips (jay) (retired) 2014-07-08 14:46:47 UTC
Crashes for me on

Version: 4.3.1.0.0+
Build ID: c482a2f87ef2a38d249c276924e071bbc714a07f
TinderBox: Linux-rpm_deb-x86@45-TDF, Branch:libreoffice-4-3, Time: 2014-07-02_02:03:48

as well as the with the second sample file < https://wiki.documentfoundation.org/images/c/cc/Monster_gltf_model.odp >. In 4.4 i get a question mark in the area.
Comment 2 Yousuf Philips (jay) (retired) 2014-07-08 15:00:21 UTC
Created attachment 102441 [details]
linux backtrace
Comment 3 ribotb 2014-07-08 15:24:21 UTC
Hi,

With a double-click on the icon of the file to open it: LO crashes with no message.

If I first launch LO and I pulled the file on the home page: LO does not crash, nothing happens except that the filenames under thumbnails disappear and reappear when I click on a the thumbnail.

If I launch LO then I try to open the file by Open File button or menu File > Open,  Recovery of documents dialog box is first displayed , with no document to recover, and with just the opportunity to OK. Then LO launches.

Version: 4.3.0.2
Build ID: 14ed55896fdfcb93ff437b85c4f3e1923d2b1409

Win 7/x86

Bernard
Comment 4 Tamás Zolnai 2014-07-09 09:58:35 UTC
Can you provide the OpenGL version too?
We are working on finding out the minimum OpenGL version with which we can render glTF models and after that we can avoid this crash.
Comment 5 sophie 2014-07-09 10:17:26 UTC
I'm not sure it's correct but here is what grep gives:
OpenGL version string: 3.0 Mesa 10.1.3
Sophie
Comment 6 Tamás Zolnai 2014-07-09 10:58:35 UTC
Thanks Sophie.
I uploaded a new version of these two documents to the release notes site which works for me with the similar OpenGL version that you have. It depends on the model too whether it can be rendered or not. However it does not solve the bug, but at least more people can try out these models.
Comment 7 Tamás Zolnai 2014-07-09 11:08:33 UTC
Links became invalid so here are the new links pointing to the documents:

Monster:
https://wiki.documentfoundation.org/images/archive/c/cc/20140709104752%21Monster_gltf_model.odp

Duck:
https://wiki.documentfoundation.org/images/archive/e/e1/20140709104603%21Duck_gltf_model.odp
Comment 8 Tamás Zolnai 2014-07-09 11:12:45 UTC
(In reply to comment #7)
> Links became invalid so here are the new links pointing to the documents.

The documents to reproduce the crash.
Comment 9 sophie 2014-07-09 11:55:52 UTC
Just to let you know that docs on the wiki are working correctly for me :) Sophie
Comment 10 Yousuf Philips (jay) (retired) 2014-07-09 11:58:50 UTC
I have OpenGL 1.4 Mesa 9.2.1 which is part of ubuntu's mesa-lts-saucy package, while most ubuntu 12.04 users will likely still be on Mesa 8.0.4.
Comment 11 Markus Mohrhard 2014-07-09 14:18:50 UTC
(In reply to comment #10)
> I have OpenGL 1.4 Mesa 9.2.1 which is part of ubuntu's mesa-lts-saucy
> package, while most ubuntu 12.04 users will likely still be on Mesa 8.0.4.

That is related to your graphic card. 12.04 already supports newer OpenGL versions. Mesa 8 supports already OpenGL 3.0 and OpenGL 1.4 is from 2002. Can you attach the output from glxinfo as this looks more like the GLX version.
Comment 12 Yousuf Philips (jay) (retired) 2014-07-09 15:04:47 UTC
$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) G33 x86/MMX/SSE2
OpenGL version string: 1.4 Mesa 9.2.0
OpenGL extensions:
Comment 13 Michael Meeks 2014-07-10 12:35:53 UTC
*** Bug 80448 has been marked as a duplicate of this bug. ***
Comment 14 pierre-yves samyn 2014-07-11 16:01:13 UTC
Hi

I reproduce crash on windows 7/64 & Version: 4.3.0.2
Build ID: 14ed55896fdfcb93ff437b85c4f3e1923d2b1409

Try to join a windbg trace...

Regards
Pierre-Yves
Comment 15 pierre-yves samyn 2014-07-11 16:01:53 UTC
Created attachment 102626 [details]
Windows backtrace
Comment 16 Michael Meeks 2014-07-14 08:17:28 UTC
The key piece of Pierre's nice trace is:

STACK_TEXT:  
WARNING: Frame IP not in any known module. Following frames may be wrong.
00d6df2c 5744eb79 00000001 0902dd04 08b6579c 0x0
00d6df44 5744ebd8 0f030020 00000200 00000200 avmediaogl!Texture::createFromData+0xd9
00d6df60 57463a50 0f030020 00000200 00000200 avmediaogl!Texture::loadTexture2DFromBuffer+0x18
00d6df94 57486b03 0902dd00 3b36ee2e 16f4cea8 avmediaogl!glTF::Scene::loadTexture+0xc0
00d6e134 57486ece 16f4d0f0 09273788 00d6e160 avmediaogl!Parser::parseMaterialProper+0x593
00d6e1c8 57489ac9 3b36ed2a 00d6e3b0 0e191540 avmediaogl!Parser::parseMaterials+0x1ce
00d6e230 5744956d 3b36ed46 00d6e3b0 0e191540 avmediaogl!Parser::parseScene+0x1a9
00d6e25c 57448c15 08b65710 09225148 3b36edf2 avmediaogl!RenderScene::loadScene+0x3d
00d6e2e8 5743ba4f 09225148 00d6e340 574385ab avmediaogl!RenderScene::initRender+0x45
00d6e2f4 574385ab 09225148 0e191538 00d6e328 avmediaogl!gltf_renderer_set_content+0xf
00d6e340 5b151456 0e191538 00d6e3b0 188a9dd5 avmediaogl!avmedia::ogl::OGLPlayer::createFrameGrabber+0xab
00d6e3c4 5bb44721 00d6e3fc 00d6e400 16dfd138 avmedialo!avmedia::MediaWindow::grabFrame+0x86
00d6e410 5ba462c0 00d6e478 188a9a78 08e8b400 svxcorelo!SdrMediaObj::getSnapshot+0xc1
00d6e498 5ba54baa 00d6e4b4 188a9a24 08e8b400 svxcorelo!sdr::contact::ViewContactOfSdrMediaObj::createViewIndependentPrimitive2DSequence+0x240
Comment 17 Tamás Zolnai 2014-07-14 12:09:20 UTC
@Pierre
Can you provide the OpenGL version too?
On Windows it's not so easy to do that as on Linux, but here is a guide:
http://blogs.esri.com/esri/supportcenter/2012/03/15/what-version-of-opengl-do-i-have-and-do-i-have-the-latest-drivers-for-my-system/
Comment 18 pierre-yves samyn 2014-07-14 15:08:07 UTC
Hi

(In reply to comment #17)
> Can you provide the OpenGL version too?
> On Windows it's not so easy to do that as on Linux, but here is a guide:
> http://blogs.esri.com/esri/supportcenter/2012/03/15/what-version-of-opengl-
> do-i-have-and-do-i-have-the-latest-drivers-for-my-system/

Thank you for the link :)

Rendereur: GeForce GT 330M/PCI/SSE2
Fournisseur: NVIDIA Corporation
Mémoire: 1024 MO
Version: 3.1 NVIDIA 189.50
Forceware 8.16.11.8950
Version GLSL: 1.30 NVIDIA via Cg compiler

I hope it helps...

Regards
Pierre-Yves
Comment 19 Yousuf Philips (jay) (retired) 2014-07-14 16:20:03 UTC
Crashed on Windows 7 on my 7 year old laptop. Here is the opengl info

Renderer: Intel 945GM
Vendor: Intel
Memory: 256 MB
Version: 1.4.0 - Build 8.14.10.1930
Shading language version: N/A
Comment 20 Tamás Zolnai 2014-07-20 07:05:32 UTC
Some fixes got into 4.3.0.3 which makes error handling more robust. So some of the crashes listed it this bug report must be fixed now.
Affected users are encouraged to test the fix and report feedback
Comment 21 Yousuf Philips (jay) (retired) 2014-07-20 08:00:13 UTC
Retested on Windows 7 with 4.3.0.3 and it crashes.
Comment 22 Commit Notification 2014-07-21 11:53:31 UTC
Zolnai Tamas committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=378b1d24a958114eb4484cb10f609f6e482772ec

fdo#81055: Crash due to inadequate checks for GL version / capabilities



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 23 Tamás Zolnai 2014-07-21 13:12:45 UTC
Tested with OpenGL 2.1 without any of the three extensions checked in the commit.

Impress crashed in:
1) Texture::createFromData() when call glGenSamplers()
-> need GL_ARB_sampler_objects
2) RenderWithFBO::createRenderObj() when call glGenRenderbuffers()
-> need GL_ARB_framebuffer_object
3) Font::setGLBufferData() when call glGenVertexArrays()
-> need GL_ARB_vertex_array_object

Now the code explicitly checks whether these extensions are supported or not.
Comment 24 Commit Notification 2014-07-21 19:23:18 UTC
Zolnai Tamas committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3c2ce3618f586d932b516c15167a79f2b882fbf5&h=libreoffice-4-3

fdo#81055: Crash due to inadequate checks for GL version / capabilities


It will be available in LibreOffice 4.3.1.

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 25 pierre-yves samyn 2014-08-02 14:12:03 UTC
Hi

No more crash on Windows 7/64 & Version: 4.4.0.0.alpha0+
Build ID: 6053491532a5d9954caaa4abf09af30850f0cb94
TinderBox: Win-x86@39, Branch:master, Time: 2014-08-01_03:37:35

(always same config as comment 18)

But the document does not display object, only big ?

Regards
Pierre-Yves
Comment 26 Yousuf Philips (jay) (retired) 2014-08-02 17:18:27 UTC
Crashes with 4.3.0.4 but all good with 4.3.1 on Windows 7.
Comment 27 Tamás Zolnai 2014-08-02 17:26:46 UTC
(In reply to comment #25)
> Hi
> 
> No more crash on Windows 7/64 & Version: 4.4.0.0.alpha0+
> Build ID: 6053491532a5d9954caaa4abf09af30850f0cb94
> TinderBox: Win-x86@39, Branch:master, Time: 2014-08-01_03:37:35
> 
> (always same config as comment 18)
> 
> But the document does not display object, only big ?

Yes, this is intentional.
The problem is that your graphic driver doesn't has the necessary capabilities to render glTF model. The fix only avoid crash in this case. Question mark means your driver is unable to render the model.
We are working on reducing the OpenGL requirements. We already done some changes in this direction which hopefully will be part of 4.3.1.1 or 4.3.1.2 release. As I see your driver these changes will allow you to render the models.
Comment 28 Yousuf Philips (jay) (retired) 2014-08-02 17:47:01 UTC
suggestion: why not save image of 3d model after it has been changed. With an image preview of the 3d model available, when a user doesnt have the GL capabilities, they will atleast see an image rather than a big question mark and when a user does have the capabilities, it wont need to be render the image and the 3d model hasnt changed when they open it.

I know microsoft does this kind of thing in ooxml on DrawingML bitmaps < http://blogs.igalia.com/jaragunde/2014/06/26/tales-of-libreoffice-interoperability-shape-effects/ > and if i'm not mistaken also of formulas and embedded OLEs.

I think this would not only benefit 3d models but also movie clips (still frame could be saved) and likely other things in the future. Primarily i think its bad that this big question mark is shown when a fallback could be provided, especially when the thumbnail in the start center shows the 3d model. :)
Comment 29 Tamás Zolnai 2014-08-02 17:57:05 UTC
(In reply to comment #28)
> suggestion: why not save image of 3d model after it has been changed. With
> an image preview of the 3d model available, when a user doesnt have the GL
> capabilities, they will atleast see an image rather than a big question mark
> and when a user does have the capabilities, it wont need to be render the
> image and the 3d model hasnt changed when they open it.
> 
> I know microsoft does this kind of thing in ooxml on DrawingML bitmaps <
> http://blogs.igalia.com/jaragunde/2014/06/26/tales-of-libreoffice-
> interoperability-shape-effects/ > and if i'm not mistaken also of formulas
> and embedded OLEs.
> 
> I think this would not only benefit 3d models but also movie clips (still
> frame could be saved) and likely other things in the future. Primarily i
> think its bad that this big question mark is shown when a fallback could be
> provided, especially when the thumbnail in the start center shows the 3d
> model. :)

Yeah, you are absolutely right. We've already got this idea in our mind. Actually a fallback image of the models already saved to odp file (see Models/Fallbacks folder inside odp). The primary aim of this fallback was to allow those applications to import something about the model which has no glTF support. Next step will be to use it as you said.
Comment 30 Yousuf Philips (jay) (retired) 2014-08-02 21:30:53 UTC
Glad to hear you guys have already thought of it and look forward to seeing it implemented. Hope that when its implemented, a fallback image will also show up for video clips. :)