Bug 74854 - Writer crash by zooming marked table
Summary: Writer crash by zooming marked table
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard: target:4.3.0 target:4.2.3
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-02-11 19:35 UTC by Dennis
Modified: 2014-03-07 21:51 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
step before scrolling wheel mouse (49.29 KB, image/jpg)
2014-02-11 19:35 UTC, Dennis
Details
Crash report Mac OSX (70.42 KB, text/plain)
2014-02-13 20:43 UTC, Jorendc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis 2014-02-11 19:35:56 UTC
Created attachment 93882 [details]
step before scrolling wheel mouse

If I create a table with text, select it and zoom in/out, LibO Writer crash!

way to confirm:
- open a new Writer Document
- create a table (CTRL+F12)
- write any text in the cell top left and another cell
  (I think the text must be different)
- mark all (CTRL+A)
- zoom in/out (CTRL+Mouse wheel)


My OS: MS Win7 Pro x64
Comment 1 Jorendc 2014-02-13 20:42:15 UTC
Nice catch!

I can reproduce this, tested using Mac OSX 10.9 with LibreOffice Version: 4.3.0.0.alpha0+ Build ID: a315454f349469923490e4116806ee19263849b8
Comment 2 Jorendc 2014-02-13 20:43:21 UTC
Created attachment 94022 [details]
Crash report Mac OSX
Comment 3 harryparry2011 2014-02-13 21:14:55 UTC
Win 7 x64

Confirmed under LO 4.2.0.4 (Build-ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71)
Comment 4 Michael Stahl (CIB) 2014-02-14 10:21:30 UTC
bibisect has this commit in the range:

commit 4b6445dba6bb5b2aed3edb4878ecb327446286e9
Author:     Miklos Vajna <vmiklos@collabora.co.uk>
AuthorDate: Mon Sep 16 16:25:15 2013 +0200

    fdo#37606 SwWrtShell: fix select all when doc starts with table and cursor ...
    
    ... is outside that table
Comment 5 Björn Michaelsen 2014-03-06 15:50:48 UTC
adding bug that was fixed by the suspicious commit to see also.
Comment 6 Björn Michaelsen 2014-03-06 23:20:43 UTC
Relevant parts of the backtrace (on 54932e7e182962c4084dcbc094650eec13960029):
#0  0x00002aaac3877f3d in SwCrsrShell::UpdateCrsr (this=0x1518ac0, eFlags=6, 
    bIdleEnd=0 '\000')
    at /run/bjoern/lo-daily/libreoffice/sw/source/core/crsr/crsrsh.cxx:1504
#1  0x00002aaac387b652 in SwCrsrShell::ShowCrsr (this=0x1518ac0)
    at /run/bjoern/lo-daily/libreoffice/sw/source/core/crsr/crsrsh.cxx:2111
#2  0x00002aaac427f4da in SwView::SetZoom (this=0x1508ed0, 
    eZoomType=SVX_ZOOM_PERCENT, nFactor=110, bViewOnly=0 '\000')
    at /run/bjoern/lo-daily/libreoffice/sw/source/ui/uiview/viewmdi.cxx:69
#3  0x00002aaac4287852 in SwView::HandleWheelCommands (this=0x1508ed0, 
    rCEvt=...)
    at /run/bjoern/lo-daily/libreoffice/sw/source/ui/uiview/viewport.cxx:1206
#4  0x00002aaac4178856 in SwEditWin::Command (this=0x1509e80, rCEvt=...)
    at /run/bjoern/lo-daily/libreoffice/sw/source/ui/docvw/edtwin.cxx:5152
#5  0x00002aaaaf55af7d in ImplCallWheelCommand(Window*, Point const&, CommandWheelData const*) ()
   from /run/bjoern/lo-daily/libreoffice/instdir/program/libvcllo.so
#6  0x00002aaaaf55b299 in ImplHandleWheelEvent(Window*, SalWheelMouseEvent const&, bool) () from /run/bjoern/lo-daily/libreoffice/instdir/program/libvcllo.so
Comment 7 Commit Notification 2014-03-07 09:21:26 UTC
Bjoern Michaelsen committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74854: better loose selection than crashing



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 8 Björn Michaelsen 2014-03-07 09:40:56 UTC
So this:
- only happens, if there is only one table in the document
- does not happen, if there is an paragraph (even empty) at the start of the document
- does not happen, if there is an paragraph (even empty) after the table

There is an assertion flying in the 'mark all'-step (only) when this is happening:

 warn:legacy.osl:18109:1:sw/source/core/frmedt/tblsel.cxx:1773: MakeSelUnions with pStart or pEnd not in CellFrm

and indeed pEnd is not a CellFrm. Likely fixing that is the way to go for fixing this with properly keeping the selection.
Comment 9 Björn Michaelsen 2014-03-07 10:15:56 UTC
(In reply to comment #8)
> - does not happen, if there is an paragraph (even empty) after the table
Whops, thats wrong: it happens too if there is a paragraph after the table.

The root cause seems to be that the selection:
- starts in a table
- ends outside that table

That isnt happening:
- if there is a paragraph before the table, as then the UI allows a selection starting there only to end outside the table, and 'all' starts and ends outside the table.
- the UI only allows selections starting in a table to end in a table.
Comment 10 Commit Notification 2014-03-07 11:24:30 UTC
Bjoern Michaelsen committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0f6431dd4d9b91e3819abee35ebc946c800f53fd&h=libreoffice-4-2

fdo#74854: better loose selection than crashing


It will be available in LibreOffice 4.2.3.

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 11 Björn Michaelsen 2014-03-07 12:05:06 UTC
Closing this one (not a regression anymore), remaining buggy behaviour at fdo#75844.