Bug 117440 - Assertion fails on menu closing if the comments window was previously open
Summary: Assertion fails on menu closing if the comments window was previously open
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Maxim Monastirsky
URL:
Whiteboard: target:6.2.0
Keywords: haveBacktrace
Depends on:
Blocks: Crash-Assert
  Show dependency treegraph
 
Reported: 2018-05-05 13:37 UTC by Regina Henschel
Modified: 2018-06-08 10:45 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Document to reproduce the assertion (8.02 KB, application/vnd.oasis.opendocument.graphics)
2018-05-05 13:37 UTC, Regina Henschel
Details
Call stack (2.28 KB, text/plain)
2018-05-05 13:38 UTC, Regina Henschel
Details
bt with debug symbols (6.58 KB, text/plain)
2018-05-05 16:55 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2018-05-05 13:37:36 UTC
Created attachment 141903 [details]
Document to reproduce the assertion

Open attached document.
Click on comment marker in top-left corner.
Click into comment and mark "draw".
Menu Format > Character.
Notice, that the comment is closed.
Cancel Character format dialog.

That gives the assertion failure:
Assertion failed!
Program: ...\core\instdir\program\vcllo.dll
File: ../core/vcl/source/window/menubarwindow.cxx
Line: 526

Expression: xTempFocusId == nullptr || implGerSVData()->maWinData.mpFocusWin != this
Comment 1 Regina Henschel 2018-05-05 13:38:04 UTC
Created attachment 141904 [details]
Call stack
Comment 2 Julien Nabet 2018-05-05 16:55:20 UTC
Created attachment 141908 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated yesterday, I reproduced this BUT the assert happened when opening dialog, not during cancel since I couldn't get the dialog.

Also I reproduced this with gen rendering, I don't reproduce this with gtk3 rendering.
I can give a try to other renderings (gtk and kde4) if useful.
Comment 3 Julien Nabet 2018-05-05 17:17:35 UTC
Some gdb session:
#4  0x00007fffebcaeb62 in MenuBarWindow::ChangeHighlightItem (this=0x55555ad53ff0, n=65535, bSelectEntry=false, bAllowRestoreFocus=true, bDefaultToDocument=false)
    at /home/julien/lo/libreoffice/vcl/source/window/menubarwindow.cxx:526
526	                assert(xTempFocusId == nullptr || ImplGetSVData()->maWinData.mpFocusWin != this);
(gdb) p xTempFocusId
$1 = {_vptr.VclPtr = 0x7fffecddf6f0 <vtable for VclPtr<vcl::Window>+16>, m_rInnerRef = rtl::Reference to 0x55555b0d5300}
(gdb) p ImplGetSVData()->maWinData.mpFocusWin
$2 = {_vptr.VclPtr = 0x7fffecddf6f0 <vtable for VclPtr<vcl::Window>+16>, m_rInnerRef = rtl::Reference to 0x55555ad53ff0}
(gdb) p this
$3 = (MenuBarWindow * const) 0x55555ad53ff0

BTW, the comment is closed too with gtk3 rendering.

Maxim: noticing https://cgit.freedesktop.org/libreoffice/core/commit/?id=3ecf542af410536d64d217c71002799bbe48b9c3 which contains the assert, thought you might be interested in this one.
Comment 4 Maxim Monastirsky 2018-05-05 22:54:15 UTC
Not related to the Character dialog, as just opening and closing any menu triggers this assert.

(And btw I don't think that the Character dialog can be used or was ever working with comments in Draw.)
Comment 5 Commit Notification 2018-06-08 10:43:09 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

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

tdf#117440 Can't move focus to disposed window

It will be available in 6.2.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 6 Maxim Monastirsky 2018-06-08 10:45:20 UTC
Removed that assert, and fixed a bug which was uncovered by it.