Bug 114736 - Crash with CJK characters in status bar (OpenGL)
Summary: Crash with CJK characters in status bar (OpenGL)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
6.0.0.0.beta1
Hardware: All All
: highest critical
Assignee: Not Assigned
URL:
Whiteboard: target:6.1.0 target:6.0.5
Keywords: bibisected, bisected, haveBacktrace, regression
: 115428 (view as bug list)
Depends on:
Blocks: CJK VCL-OpenGL
  Show dependency treegraph
 
Reported: 2017-12-28 15:15 UTC by Aron Budea
Modified: 2018-06-20 11:05 UTC (History)
7 users (show)

See Also:
Crash report or crash signature: ["MultiSalLayout::AdjustLayout(ImplLayoutArgs &)"]


Attachments
Bibisect log (3.53 KB, text/plain)
2017-12-28 16:19 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-12-28 15:15:53 UTC
Open attachment 138711 [details] from bug 114732.

=> Crash.

Crash report from the 6.0 betas isn't very informative:
http://crashreport.libreoffice.org/stats/crash_details/dad3aeb0-8580-4370-9248-ebf2084aaa62

Crashes in 6.0.0.1, 6.0beta2 & 6.0beta1 / Windows 7.
No crash in 5.4.4.2 & 5.4.0.3.
=> regression

Might be Windows-specific, confirmation needed.
Comment 1 Aron Budea 2017-12-28 15:17:25 UTC
Crash only occurs with OpenGL enabled.
Comment 2 Xisco Faulí 2017-12-28 15:27:09 UTC
Indeed, I can't reproduce it in

Version: 6.1.0.0.alpha0+
Build ID: 864ab0502a4d3506413451e8c545144c6c15d777
CPU threads: 1; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-12-28_00:54:35
Locale: es-ES (es_ES); Calc: group threaded
Comment 3 Telesto 2017-12-28 15:38:48 UTC
Repro with OpenGL enabled
Version: 6.1.0.0.alpha0+
Build ID: a9b202a6b7000e7af34f2a639ca207122a3968bf
CPU threads: 4; OS: Windows 6.3; UI render: GL; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-12-26_23:10:23
Locale: nl-NL (nl_NL); Calc: CL
Comment 4 Telesto 2017-12-28 16:19:13 UTC
Created attachment 138712 [details]
Bibisect log

I attempted a bibisect (a few times), but it seems to be a moving target. And the end-result isn't convincing either...
Comment 5 Aron Budea 2017-12-28 16:45:27 UTC
Took a backtrace with VS.
Here pGlyphs[0] is nullpointer:

int nActiveCharPos = pGlyphs[0]->mnCharPos;	
https://opengrok.libreoffice.org/xref/core/vcl/source/gdi/sallayout.cxx#1210

>	vcllo.dll!MultiSalLayout::AdjustLayout(ImplLayoutArgs & rArgs) Line 1210	C++
 	vcllo.dll!OutputDevice::DrawText(const Point & rStartPt, const rtl::OUString & rStr, long nIndex, long nLen, std::vector<tools::Rectangle,std::allocator<tools::Rectangle> > * pVector, rtl::OUString * pDisplayText, SalLayout * pLayoutCache) Line 891	C++
 	vcllo.dll!StatusBar::ImplDrawItem(OutputDevice & rRenderContext, bool bOffScreen, unsigned short nPos) Line 406	C++
 	vcllo.dll!StatusBar::Paint(OutputDevice & rRenderContext, const tools::Rectangle & rRect) Line 732	C++
 	vcllo.dll!PaintHelper::DoPaint(const vcl::Region * pRegion) Line 303	C++
 	vcllo.dll!vcl::Window::ImplCallPaint(const vcl::Region * pRegion, ImplPaintFlags nPaintFlags) Line 607	C++
 	vcllo.dll!PaintHelper::~PaintHelper() Line 541	C++
 	vcllo.dll!vcl::Window::ImplCallPaint(const vcl::Region * pRegion, ImplPaintFlags nPaintFlags) Line 612	C++
 	vcllo.dll!PaintHelper::~PaintHelper() Line 541	C++
 	vcllo.dll!vcl::Window::ImplCallPaint(const vcl::Region * pRegion, ImplPaintFlags nPaintFlags) Line 612	C++
 	vcllo.dll!vcl::Window::ImplCallOverlapPaint() Line 632	C++
 	vcllo.dll!vcl::Window::ImplHandlePaintHdl(Timer * __formal) Line 653	C++
 	vcllo.dll!vcl::Window::LinkStubImplHandlePaintHdl(void * instance, Timer * data) Line 634	C++
 	vcllo.dll!Link<Timer *,void>::Call(Timer * data) Line 84	C++
 	vcllo.dll!Timer::Invoke() Line 77	C++
 	vcllo.dll!Scheduler::ProcessTaskScheduling() Line 448	C++
 	vcllo.dll!Scheduler::CallbackTaskScheduling() Line 271	C++
 	vcllo.dll!SalTimer::CallCallback() Line 56	C++
 	vcllo.dll!WinSalTimer::ImplHandleElapsedTimer() Line 158	C++
 	vcllo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 518	C++
 	vcllo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 564	C++
 	vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 469	C++
 	vcllo.dll!Application::Yield() Line 534	C++
 	vcllo.dll!Application::Execute() Line 449	C++
 	sofficeapp.dll!desktop::Desktop::Main() Line 1605	C++
 	vcllo.dll!ImplSVMain() Line 194	C++
 	vcllo.dll!SVMain() Line 233	C++
 	sofficeapp.dll!soffice_main() Line 163	C++
 	soffice.bin!sal_main() Line 48	C
 	soffice.bin!main(int argc, char * * argv) Line 47	C
 	soffice.bin!WinMain(void * _hinst, void * _dummy, char * _cmdline, int _nshow) Line 47	C
Comment 6 Aron Budea 2017-12-28 17:36:39 UTC
I found a very plausible commit using repo bibisect-win32-6.0, and reloading the file a couple of times at each step. The crash occurs in status bar drawing code, and the commit also deals with that, and since it's about caching, that could explain its elusivity.

Adding Cc: to Tamas Bunth, please take a look.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=f0821f9a347c7752a3c741c3451a2f1630173720
author		Tamas Bunth <tamas.bunth@collabora.co.uk>	2017-06-08 19:56:28 +0200
committer	Tamás Bunth <btomi96@gmail.com>	2017-06-09 16:29:40 +0200

"Cache text layout of statusbar items"
Comment 7 Aron Budea 2017-12-28 19:39:19 UTC
Seems to be the duplicate of bug 112990 (based on comment 5 and bug 112990 comment 20), but this ticket is probably easier to work with.
Comment 8 Aron Budea 2017-12-28 19:42:26 UTC
*** Bug 112990 has been marked as a duplicate of this bug. ***
Comment 9 Martin Srebotnjak 2017-12-29 00:12:03 UTC
Do not close ticket  Bug 112990 because that is a bug that does not happen only with presentations. As you can read in that bug report - LO crashes all the time, just upon opening or creating *any* kind of document.
So do reopen that bug report and unmark it as a duplicate of this one.
Maybe this should be marked as a duplicate of that one - it is a subset of the issues at hand.
Please check things before you take action.
Comment 10 Xisco Faulí 2017-12-29 08:38:12 UTC
*** Bug 112990 has been marked as a duplicate of this bug. ***
Comment 11 Rainer Bielefeld Retired 2018-01-07 18:23:15 UTC
Still REPRODUCIBLE with Version: 6.1.0.0.alpha0+ (x64)
Build ID: c926a1e34672afaa5b7de0e3b08b1537e88fbb6f CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2017-12-24_01:10:03
Locale: de-DE (de_DE); Calc: CL, my default user profile, Tango theme
Comment 12 Aron Budea 2018-01-17 02:08:34 UTC
This issue isn't related to the presentation, but to CJK glyph layouting, in the "buggy" presentation the master slide name is in Chinese, that's why it crashes. Basically all apps crash with CJK UI language + OpenGL upon start.

Martin, when you encountered the similar crash in OSX, is it possible you've had CJK characters in the status bar at that point?
Comment 13 Martin Srebotnjak 2018-01-17 21:38:51 UTC
Aron, sorry, but this has nothing to do with my bug report in 112990.

Someone just closed that as a duplicate of this but I never saw or used CJK in UI.

Great.
Comment 14 Tamas Bunth 2018-01-26 10:18:21 UTC
I couldn't reproduce it with openGL:

Version: 6.1.0.0.alpha0+
Build ID: 61e048808873c4edea983de0ab54366cd41e2082
CPU threads: 4; OS: Linux 4.13; UI render: GL; VCL: gtk3;
Locale: hu-HU (hu_HU.UTF-8); Calc: group threaded

I couldn't reproduce it with default render either.
Comment 15 Aron Budea 2018-01-26 13:22:40 UTC
Thanks for taking a look, Tamas! It might be that the bug doesn't occur in Linux, I've only tried in Windows, and the OSX repro also seems to be somewhat different (bug 112990).

A crash report in 6.0.0.2 with symbols:
https://crashreport.libreoffice.org/stats/crash_details/81314640-d5bc-4bab-8ec5-61e0258b0e11

Bug is still there in 6.0.0.3 as well (unsurprisingly).
Comment 17 Commit Notification 2018-01-28 14:59:24 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9b5730f92967b6a8f4fce349bcd951f388b940df

tdf#114736 no need to call AdjustLayout here

It will be available in 6.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 18 Aron Budea 2018-01-31 21:35:26 UTC
Crash is gone in LO 6.1 daily build (2018-01-30_03:11:54, 3deac9691011711a3b9e50d19499c588af074d7f). Thanks for the fix, Tamás!

There is a leftover display issue, bug 115353 has been opened on that.
Comment 19 Xisco Faulí 2018-02-05 09:21:13 UTC
Hi Tamás Bunth, Aron Budea,
Could you please backport this change to LibreOffice 6.0.1 ?
Comment 20 Julien Nabet 2018-02-05 09:49:55 UTC
Just for the record, there's a patch in review for 6.0 here:
https://gerrit.libreoffice.org/#/c/49033/
Comment 21 Xisco Faulí 2018-02-05 10:28:14 UTC
*** Bug 115428 has been marked as a duplicate of this bug. ***
Comment 22 Telesto 2018-03-04 12:22:48 UTC
(In reply to Julien Nabet from comment #20)
> Just for the record, there's a patch in review for 6.0 here:
> https://gerrit.libreoffice.org/#/c/49033/

Abandoned...
Comment 23 Commit Notification 2018-06-19 13:21:56 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=221234c0203d5b3caf6907bff110fc1a9b71a5ad&h=libreoffice-6-0

tdf#114736 no need to call AdjustLayout here

It will be available in 6.0.6.

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 24 Commit Notification 2018-06-19 21:40:24 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "libreoffice-6-0-5":

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

tdf#114736 no need to call AdjustLayout here

It will be available in 6.0.5.

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.