Bug 114271 - Assertion failure when clicking on comment border in Calc
Summary: Assertion failure when clicking on comment border in Calc
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.4.0
Keywords: haveBacktrace
: 114787 (view as bug list)
Depends on:
Blocks: Calc-Comments Crash-Assert
  Show dependency treegraph
 
Reported: 2017-12-06 06:30 UTC by Aron Budea
Modified: 2021-02-15 17:42 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
GDB trace (20.80 KB, text/plain)
2017-12-06 06:30 UTC, Aron Budea
Details
bt with debug symbols (7.02 KB, text/plain)
2019-03-07 19:08 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-12-06 06:30:32 UTC
Created attachment 138233 [details]
GDB trace

With a debug build, add a comment in Calc, and click on the border.

=> Crash with assertion failure. See attached trace.

svx/source/svdraw/svdedxv.cxx:1021: virtual bool SdrObjEditView::SdrBeginTextEdit(SdrObject*, SdrPageView*, vcl::Window*, bool, SdrOutliner*, OutlinerView*, bool, bool, bool): Assertion `!IsTextEdit()' failed.

Observed with LO 6.1 master build (5daa364922ba75442e2aa834095e9bef16d141d9) / Ubuntu 17.04.
Comment 1 Julien Nabet 2017-12-06 21:19:46 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 2 Aron Budea 2018-01-01 00:56:28 UTC
*** Bug 114787 has been marked as a duplicate of this bug. ***
Comment 3 QA Administrators 2019-01-02 03:34:21 UTC Comment hidden (obsolete)
Comment 4 Aron Budea 2019-01-02 04:04:02 UTC
Still repro with 6.3.0.0.alpha0+ (d23ab724929b0be026de78b64c27321fb447f9da) / Ubuntu 18.04.
Comment 5 Julien Nabet 2019-03-07 19:08:05 UTC
Created attachment 149806 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today + enable-dbgutil, I could reproduce this.
Comment 6 Julien Nabet 2019-03-07 19:38:58 UTC
I noticed this too:
warn:legacy.osl:9301:9301:sfx2/source/control/shell.cxx:211: SfxShell::SetUndoManager: exchanging one non-NULL manager with another non-NULL manager? Suspicious!
Comment 7 Julien Nabet 2019-03-07 20:24:12 UTC
Eike: with this patch, I don't reproduce the assert:
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index f1a4afcd91c4..f1ec728abad0 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -194,7 +194,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
 
                 //!?? the default values are not correct when result is without outliner ???!?
                 auto pOTemp = pO.get();
-                if ( pView->SdrBeginTextEdit(pObj, pPV, pWindow, true, pO.release()) )
+                if ( !pView->IsTextEdit() && pView->SdrBeginTextEdit(pObj, pPV, pWindow, true, pO.release()) )
                 {
                     // subscribe EditEngine-UndoManager
                     rViewShell.SetDrawTextUndo( &pOTemp->GetUndoManager() );

However, I wonder if it just hides the problem.

Indeed UndoManager error may give hints about the root cause.

I tried to follow the problem of exchanging 2 non null managers so I put some traces to display the thread and undomanager pointer, I finally retrieved these:

1) in EditNote() at:
GetViewData().GetDispatcher().Execute( SID_DRAW_NOTEEDIT, SfxCallMode::SYNCHRON | SfxCallMode::RECORD ); (line 508)

#0  0x00007ffff55455b6 in SfxShell::SetUndoManager(SfxUndoManager*) (this=0x555558d19b40, pNewUndoMgr=0x555557e8b4c0) at /home/julien/lo/libreoffice/sfx2/source/control/shell.cxx:210
#1  0x00007fffde40b30a in ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData*) (this=0x555558d19b40, pData=0x555557e32088) at /home/julien/lo/libreoffice/sc/source/ui/drawfunc/drtxtob.cxx:112
#2  0x00007fffde902735 in ScTabViewShell::SetCurSubShell(ObjectSelectionType, bool) (this=0x555557e31fc0, eOST=OST_DrawText, bForce=false) at /home/julien/lo/libreoffice/sc/source/ui/view/tabvwsh4.cxx:816
#3  0x00007fffde901f5f in ScTabViewShell::SetDrawTextShell(bool) (this=0x555557e31fc0, bActive=true) at /home/julien/lo/libreoffice/sc/source/ui/view/tabvwsh4.cxx:656
#4  0x00007fffde8f86b9 in ScTabViewShell::ExecDraw(SfxRequest&) (this=0x555557e31fc0, rReq=...) at /home/julien/lo/libreoffice/sc/source/ui/view/tabvwsh2.cxx:189
#5  0x00007fffde8f6e9d in SfxStubScTabViewShellExecDraw(SfxShell*, SfxRequest&) (pShell=0x555557e31fc0, rReq=...) at /home/julien/lo/libreoffice/workdir/SdiTarget/sc/sdi/scslots.hxx:1434
#6  0x00007ffff54fb508 in SfxShell::CallExec(void (*)(SfxShell*, SfxRequest&), SfxRequest&) (this=0x555557e31fc0, pFunc=0x7fffde8f6e6f <SfxStubScTabViewShellExecDraw(SfxShell*, SfxRequest&)>, rReq=...)
    at /home/julien/lo/libreoffice/include/sfx2/shell.hxx:207
#7  0x00007ffff54f23a5 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) (this=0x555557e280a0, rShell=..., rSlot=..., rReq=..., bRecord=true)
    at /home/julien/lo/libreoffice/sfx2/source/control/dispatch.cxx:356
#8  0x00007ffff54f4de1 in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode)
    (this=0x555557e280a0, rShell=..., rSlot=..., rReq=..., eCallMode=(SfxCallMode::SYNCHRON | SfxCallMode::RECORD)) at /home/julien/lo/libreoffice/sfx2/source/control/dispatch.cxx:856
#9  0x00007ffff54f54c1 in SfxDispatcher::Execute(unsigned short, SfxCallMode, SfxPoolItem const**, unsigned short, SfxPoolItem const**)
    (this=0x555557e280a0, nSlot=26081, eCall=(SfxCallMode::SYNCHRON | SfxCallMode::RECORD), pArgs=0x0, nModi=0, pInternalArgs=0x0) at /home/julien/lo/libreoffice/sfx2/source/control/dispatch.cxx:962
#10 0x00007fffde984f1a in ScViewFunc::EditNote() (this=0x555557e32078) at /home/julien/lo/libreoffice/sc/source/ui/view/viewfun6.cxx:508

2) In the same method at line 514
#0  0x00007ffff55455b6 in SfxShell::SetUndoManager(SfxUndoManager*) (this=0x555558d19b40, pNewUndoMgr=0x555559139760) at /home/julien/lo/libreoffice/sfx2/source/control/shell.cxx:210
#1  0x00007fffde903539 in ScTabViewShell::SetDrawTextUndo(SfxUndoManager*) (this=0x555557e31fc0, pNewUndoMgr=0x555559139760) at /home/julien/lo/libreoffice/sc/source/ui/view/tabvwsh4.cxx:1016
#2  0x00007fffde430d8b in FuText::SetInEditMode(SdrObject*, Point const*, bool, KeyEvent const*) (this=0x555558c71f60, pObj=0x555558f5fd00, pMousePixel=0x0, bCursorToEnd=false, pInitialKey=0x0)
    at /home/julien/lo/libreoffice/sc/source/ui/drawfunc/futext.cxx:588
#3  0x00007fffde984f8b in ScViewFunc::EditNote() (this=0x555557e32078) at /home/julien/lo/libreoffice/sc/source/ui/view/viewfun6.cxx:514

First retrieves pViewData->GetSfxDocShell()->GetUndoManager()
Second one retrieves pOTemp->GetUndoManager()

Any thoughts?
Comment 8 Aron Budea 2021-02-13 07:16:15 UTC
Not seeing this in a current master build, LO 7.2.0.0.alpha0+ (8478c954814623441d62838743737063fec8e6c0) / Ubuntu.
Comment 9 Eike Rathke 2021-02-15 12:38:50 UTC
(In reply to Aron Budea from comment #8)
> Not seeing this in a current master build, LO 7.2.0.0.alpha0+
> (8478c954814623441d62838743737063fec8e6c0) / Ubuntu.
Assertions only happen in debug builds. Did you try a debug build?
Comment 10 Aron Budea 2021-02-15 13:25:15 UTC
(In reply to Eike Rathke from comment #9)
> Assertions only happen in debug builds. Did you try a debug build?
Yes. The only thing I couldn't check is whether I'm taking the right steps, because I don't have the original build anymore.

I'm seeing the following in the console:

warn:svx:777121:777121:svx/source/svdraw/svdedxv.cxx:1067: SdrBeginTextEdit called when IsTextEdit() is already true.
warn:legacy.osl:777121:777121:sc/source/ui/Accessibility/AccessibleDocument.cxx:994: here is a selected shape which is not in the childlist
warn:legacy.osl:777121:777121:sc/source/ui/Accessibility/AccessibleDocument.cxx:994: here is a selected shape which is not in the childlist
warn:legacy.osl:777121:777121:sfx2/source/control/shell.cxx:208: SfxShell::SetUndoManager: exchanging one non-NULL manager with another non-NULL manager? Suspicious!

Seems this was changed for bug 127941, and the fix (removing the assert) is the following commit:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=1dbaff61609d7643311b968bef69be4276b109e7
author		Jan Holesovsky <kendy@collabora.com>	2019-10-04 00:09:15 +0200
committer	Tor Lillqvist <tml@collabora.com>	2019-10-04 10:45:52 +0200

tdf#127941: Don't be _that_ eager to assert(!IsTextEdit());
Comment 11 Eike Rathke 2021-02-15 17:42:51 UTC
Thanks Aron!