Bug 107730 - CRASH when opening simple document containing shapes with OpenGL enabled
Summary: CRASH when opening simple document containing shapes with OpenGL enabled
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.0.0 target:5.4.2
Keywords:
Depends on:
Blocks: VCL-OpenGL
  Show dependency treegraph
 
Reported: 2017-05-09 17:59 UTC by Telesto
Modified: 2018-01-26 13:36 UTC (History)
6 users (show)

See Also:
Crash report or crash signature: ["mergedlo.dll"]


Attachments
Example file (91.07 KB, application/vnd.oasis.opendocument.graphics)
2017-05-09 17:59 UTC, Telesto
Details
WindDbg 64 StackTrace (43.59 KB, text/plain)
2017-05-09 19:55 UTC, V Stuart Foote
Details
WinDbg 32 StackTrace with better symbols (47.39 KB, text/plain)
2017-05-09 21:17 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2017-05-09 17:59:35 UTC
Description:
CRASH when opening simple document containing multiple shapes with OpenGL enabled

Steps to Reproduce:
1. Open the attached file with OpenGL enabled

Actual Results:  
Crash:
Gebeurtenisnaam van probleem:	BEX
  Naam van de toepassing:	soffice.bin
  Versie van toepassing:	5.4.0.0
  Tijdstempel van toepassing:	591131b2
  Naam van foutmodule:	StackHash_5861
  Versie van foutmodule:	0.0.0.0
  Tijdstempel van foutmodule:	00000000
  Uitzonderingsmarge:	PCH_3F_FROM_ntdll+0x00041318
  Uitzonderingscode:	c0000005
  Uitzonderingsgegevens:	00000008

Expected Results:
No crash


Reproducible: Always

User Profile Reset: No

Additional Info:
Found in
Version: 5.4.0.0.alpha1+
Build ID: 9d320ec4d818f86e58a15fd46248026502b1cc94
CPU threads: 4; OS: Windows 6.2; UI render: GL; 
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2017-05-09_01:27:12
Locale: en-US (nl_NL); Calc: single

but not in
Versie: 5.3.3.1 
Build ID: 46360c72c4823cefeaa85af537fba22bd568da7e
CPU Threads: 4; Versie besturingssysteem:Windows 6.2; UI Render: GL; Layout-Engine: nieuw; 
Locale: nl-NL (nl_NL); Calc: CL

DriverVersion: 13.251.0.0
DriverDate: 12-6-2013
DeviceID: PCI\VEN_1002&DEV_683D&SUBSYS_25561458&REV_00
AdapterVendorID: 0x1002
AdapterDeviceID: 0x683d
AdapterSubsysID: 0x25561458
DeviceKey: System\CurrentControlSet\Control\Video\{E47C2C57-9564-4982-9151-5BC6501332B9}\0000
DeviceString: AMD Radeon HD 7700 Series


User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Comment 1 Telesto 2017-05-09 17:59:55 UTC
Created attachment 133200 [details]
Example file
Comment 2 V Stuart Foote 2017-05-09 18:22:47 UTC
Confirmed on Windows 8.1 Ent 64-bit en-US with
Version: 5.4.0.0.alpha1+ (x64)
Build ID: d33e262a244f351febc9dbe605b05f76cb834eeb
CPU threads: 8; OS: Windows 6.29; UI render: GL; 
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2017-05-08_01:51:26
Locale: en-US (en_US); Calc: CL

Crash report: http://crashreport.libreoffice.org/stats/crash_details/2f118c42-21fd-45bf-aa86-a050927711e7

Drawing opens without issue into
Version: 5.3.3.2 (x64)
Build ID: 3d9a8b4b4e538a85e0782bd6c2d430bafe583448
CPU Threads: 8; OS Version: Windows 6.29; UI Render: default; Layout Engine: new; 
Locale: en-US (en_US); Calc: group
Comment 3 V Stuart Foote 2017-05-09 19:55:49 UTC
Created attachment 133201 [details]
WindDbg 64 StackTrace

On Windows 8.1 Ent 64-bit en-US with
Version: 5.4.0.0.alpha1+ (x64)
Build ID: d33e262a244f351febc9dbe605b05f76cb834eeb
CPU threads: 8; OS: Windows 6.29; UI render: default; 
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2017-05-08_01:51:26
Locale: en-US (en_US); Calc: CL

LibreOfficeDev 5.4 - Fatal error "timeout waiting for threadpool tasks" but guess that could be while attached to WinDbg
Comment 4 V Stuart Foote 2017-05-09 21:17:08 UTC
Created attachment 133203 [details]
WinDbg 32 StackTrace with better symbols

Crashes on 32-bit Windows builds as well...

Version: 5.4.0.0.alpha1+
Build ID: 9d320ec4d818f86e58a15fd46248026502b1cc94
CPU threads: 8; OS: Windows 6.29; UI render: GL; 
TinderBox: Win-x86@39, Branch:master, Time: 2017-05-09_00:07:01
Locale: en-US (en_US); Calc: CL

WinDbg StackTrace with better TB39 symbols attached. !analyze -v says it is an epoxy issue with wgl and vcllo WinOpenGLContext
Comment 5 Michael Meeks 2017-09-05 07:45:34 UTC
# 10  Id: 1140.1570 Suspend: 1 Teb: 7f48c000 Unfrozen "thread-pool"
ChildEBP RetAddr  
WARNING: Frame IP not in any known module. Following frames may be wrong.
1f22ec3c 5565a640 0x0
1f22ec44 58810b18 epoxy!epoxy_wglGetCurrentContext_dispatch_table_thunk(void)+0x10 [c:\cygwin\home\tinderbox\master\workdir\unpackedtarball\epoxy\src\wgl_generated_dispatch.c @ 1482]
1f22ec68 58810cf8 vcllo!WinOpenGLContext::isCurrent(void)+0x58 [c:\cygwin\home\tinderbox\master\vcl\opengl\win\gdiimpl.cxx @ 81]
1f22ed40 587f7d1f vcllo!WinOpenGLContext::makeCurrent(void)+0x38 [c:\cygwin\home\tinderbox\master\vcl\opengl\win\gdiimpl.cxx @ 92]

odd; any ideas Caolan / Tomaz ?
Comment 6 Caolán McNamara 2017-09-05 09:36:20 UTC
The wgl dispatch table thing on windows is sort of demand loaded IIRC and doesn't exist until at the first wglMakeCurrent (or something like that) is called. There's a "g_bAnyCurrent" variable on that line 81 to short circuit the case that the dispatch table hasn't been created so nothing could be current. I guess its thread specific or something and this thread hasn't had wglMakeCurrent called but a previous one has and so g_bAnyCurrent is true. Maybe a std::thread_local could be used to test this theory
Comment 7 Caolán McNamara 2017-09-05 09:41:07 UTC
with whatever buildfixes are required perhaps https://gerrit.libreoffice.org/#/c/41927/ would do something useful here
Comment 8 Commit Notification 2017-09-05 12:12:44 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4cc634327a752d633ea341252d8f4845157f887b

Resolves: tdf#107730 ensure per-thread epoxy_handle_external_wglMakeCurrent

It will be available in 6.0.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 9 Commit Notification 2017-09-15 19:19:46 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=45cfa386e312bf70c84fb971a9f7d541353b4809&h=libreoffice-5-4

Resolves: tdf#107730 ensure per-thread epoxy_handle_external_wglMakeCurrent

It will be available in 5.4.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 10 V Stuart Foote 2017-09-15 22:57:41 UTC
(In reply to Commit Notification from comment #8)
> 
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=4cc634327a752d633ea341252d8f4845157f887b
> 
> Resolves: tdf#107730 ensure per-thread epoxy_handle_external_wglMakeCurrent
> 

Sorry missed this. Attachment 133200 [details] opens cleanly now with the commit present. On Windows 10 Ent 64-bit en-US with
Version: 6.0.0.0.alpha0+
Build ID: dccd1633a111ba124f9868a4a51579c95200d745
CPU threads: 8; OS: Windows 6.19; UI render: GL; 
TinderBox: Win-x86@39, Branch:master, Time: 2017-09-06_06:44:26
Locale: en-US (en_US); Calc: CL