Issue 122111 - [sidebar] Crash on working with groups or multiple selection
[sidebar] Crash on working with groups or multiple selection
Status: RESOLVED FIXED
Product: General
Classification: Code
Component: code
4.0.0-dev
All All
: P3 major (vote)
: 4.0.0
Assigned To: Armin Le Grand
: crash
Depends on:
Blocks: [sidebar]
  Show dependency treegraph
 
Reported: 2013-04-20 18:35 UTC by Regina Henschel
Modified: 2013-07-11 13:56 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
File with 2 groups (27.55 KB, application/vnd.oasis.opendocument.graphics)
2013-04-20 18:35 UTC, Regina Henschel
no flags Details
Bug doc (8.40 KB, application/vnd.oasis.opendocument.graphics)
2013-04-20 19:49 UTC, Ariel Constenla-Haile
no flags Details
GDB backtrace (5.04 KB, text/plain)
2013-04-20 19:50 UTC, Ariel Constenla-Haile
no flags Details
Writer bug doc (8.82 KB, application/vnd.oasis.opendocument.text)
2013-04-20 20:01 UTC, Ariel Constenla-Haile
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Regina Henschel 2013-04-20 18:35:49 UTC
Created attachment 80560 [details]
File with 2 groups

Open the attached file. The left coordinate system is a group and the right coordinate system is another group.
Click on one and the other and back, copy to clipboard, click on the other, copy to clipboard. Play around this kind. Suddenly it will crash.

Notice, that when you click on the coordinate system the first time, it takes several seconds until the "copy" icon is enabled, sometimes it doesn't enable at all.

The side bar is open all the time at the left side, above the slide pane.
Comment 1 Ariel Constenla-Haile 2013-04-20 19:36:18 UTC
- Open attachment 80560 [details]
- Menu View - Sidebar, to hide the sidebar
- Select the shape on the left
- Menu View - Sidebar, to show the sidebar and wait a seconds, do not change the selection
- Crash
Comment 2 Ariel Constenla-Haile 2013-04-20 19:49:18 UTC
Created attachment 80561 [details]
Bug doc

The document has a rectangle shape and a line shape. They are not grouped.

Select both shapes, and wait some seconds.
Crash.
Comment 3 Ariel Constenla-Haile 2013-04-20 19:50:44 UTC
Created attachment 80562 [details]
GDB backtrace

The backtrace with  both bug docs is the same:

#0  __cxxabiv1::__dynamic_cast (src_ptr=0xffffffffffffffff, src_type=0x7f63b396eb30 <typeinfo for SfxPoolItem>, dst_type=0x7f63934cd8f0 <typeinfo for XLineWidthItem>, src2dst=0)
    at ../../../../libstdc++-v3/libsupc++/dyncast.cc:51
#1  0x00007f6393c3d8c2 in svx::sidebar::LinePropertyPanel::NotifyItemUpdate (this=0x2e52d38, nSID=10171, eState=16, pState=0xffffffffffffffff, bIsEnabled=true)
    at /build/aoo/src/playground/trunk/main/svx/source/sidebar/line/LinePropertyPanel.cxx:529

The address of pState looks indeed suspicious
Comment 4 Ariel Constenla-Haile 2013-04-20 20:01:41 UTC
Created attachment 80563 [details]
Writer bug doc

Document with a rectangle and a line with arrow.
Select both, wait some seconds.
Crash
Comment 5 Armin Le Grand 2013-04-22 16:37:31 UTC
ALG: SOunds like a dynamic_cast to that pointer, I'll have a look...
Comment 6 Armin Le Grand 2013-04-23 13:30:36 UTC
ALG: Indeed, in LinePropertyPanel::NotifyItemUpdate the param pState may be -1 (0xffffffff) when the param eState e.g equals SFX_ITEM_DONTCARE. This does not bode well when a dynamic_cast to an implemented ItemType is done; this already throws an exception since -1 *is* taken as object base address.
There may be two reasons for this:
- Someone needed a 'flag' value and used -1, somewhere (prob at one place) in the office this is used;
- Someone *wanted* AOO to crash when someone tries to use pState when eState is SFX_ITEM_DONTCARE since this cannot be useful.
Whatever it is; all cases in NotifyItemUpdate need to be safed to only dynamic_acst pState when eState is >= SFX_ITEM_DEFAULT. Doing this...
Comment 7 Armin Le Grand 2013-04-23 13:34:54 UTC
ALG: Bugdoc from comment (4) works now. Checked bugdoc from comment (1), it also gets pState ptrs with -1, so base reason is the same. Need to check other implementations of NotifyItemUpdate, too...
Comment 8 Armin Le Grand 2013-04-23 13:52:14 UTC
ALG: Added #122145#; when both group objects are selected, only PosSize panel stays open; this seems strage.
Comment 9 SVN Robot 2013-04-23 13:53:30 UTC
"alg" committed SVN revision 1470959 into trunk:
i122111 Corrected LinePropertyPanel::NotifyItemUpdate implementation to use p...
Comment 10 Armin Le Grand 2013-04-23 15:48:09 UTC
ALG: Most problems were in LinePropertyPanel, but also reworked some stuff in Area/PosSize/GraphicPropertyPanels. Doing some more checks...
Comment 11 Armin Le Grand 2013-04-23 17:30:15 UTC
ALG: Adapted PosSizePropertyPanel to also be able to get back to original control positions for various contexts; there was a context coming in-between when selecting another draw object. The correct context comes directly after this, but that switch did not restore the original positions. Being able to do so is correct and will not hurt; nonetheless it might be good to *not* get an in-between context of (Application_DrawImpress, Context_DrawPage)...
Comment 12 SVN Robot 2013-04-24 10:54:26 UTC
"alg" committed SVN revision 1471364 into trunk:
i122111 Adapted pState usages in NotifyItemUpdate methods; adapted control po...
Comment 13 Armin Le Grand 2013-04-24 10:58:35 UTC
ALG: Comitted, done.