Bug 30604 - full stop of LibO after pasting table with hyperlink as RTF and clicking in pasted table
Summary: full stop of LibO after pasting table with hyperlink as RTF and clicking in p...
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium major
Assignee: Cédric Bosdonnat
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2010-10-04 13:41 UTC by Cor Nouws
Modified: 2010-11-01 10:46 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
odt with table and hyperlink, to reproduce the stop (8.29 KB, application/vnd.oasis.opendocument.text)
2010-10-04 13:41 UTC, Cor Nouws
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2010-10-04 13:41:49 UTC
Created attachment 39159 [details]
odt with table and hyperlink, to reproduce the stop

1- open attached document LibrOBug_xxx_StartDoc.odt
   this has a simple table, with a hyperlink in one of the cells
2- copy content (Ctrl-A)
3- create new writer document, add enter
4- Ctrl-Shft-V > Paste as RTF
5- go up in document en click in upper row
   (somwhere position x in picture below) 
   ________________________________________
  |                                       |   
  |                                       |   
  |- - - - - - - - - - - - - - - - - - - -|   
  |             x                         |   
  |                                       |   
  |- - - - - - - - - - - - - - - - - - - -|   
  |              |                        |   
  |- - - - - - - - - - - - - - - - - - - -|   
  |                                       |   

 > full stop
   (LibrO vanishes immediately from the screen)

Does not happen in OOo 330m1 or OOo330m9, so no need to go to issueTracker ;-)
Comment 1 Michael Meeks 2010-10-04 14:13:46 UTC
Thanks Cor ! :-) the trace is:

Program received signal SIGFPE, Arithmetic exception.
0xb7a58c88 in __udivdi3 () from /opt/LOInstall/program/../basis-link/ure-link/lib/libgcc_s.so.1
(gdb) bt
#0  0xb7a58c88 in __udivdi3 () from /opt/LOInstall/program/../basis-link/ure-link/lib/libgcc_s.so.1
#1  0xaf5ad75f in lcl_SortedTabColInsert(SwTabCols&, SwTableBox const*, SwFrmFmt const*, unsigned char, int) () from /opt/LOInstall/program/../basis-link/program/libswli.so
#2  0xaf5ad9ce in lcl_ProcessBoxGet(SwTableBox const*, SwTabCols&, SwFrmFmt const*, int) () from /opt/LOInstall/program/../basis-link/program/libswli.so
#3  0xaf5adb0b in SwTable::GetTabCols(SwTabCols&, SwTableBox const*, unsigned char, unsigned char) const () from /opt/LOInstall/program/../basis-link/program/libswli.so
#4  0xaf4cccff in SwDoc::GetTabCols(SwTabCols&, SwCursor const*, SwCellFrm const*) const () from /opt/LOInstall/program/../basis-link/program/libswli.so
#5  0xaf5cddb1 in SwFEShell::_GetTabCols(SwTabCols&, SwFrm const*) const () from /opt/LOInstall/program/../basis-link/program/libswli.so
#6  0xaf5cde90 in SwFEShell::GetTabCols(SwTabCols&) const () from /opt/LOInstall/program/../basis-link/program/libswli.so
#7  0xaf812bbe in SwView::StateTabWin(SfxItemSet&) () from /opt/LOInstall/program/../basis-link/program/libswli.so
#8  0xaf7f1fa6 in SfxStubSwViewStateTabWin(SfxShell*, SfxItemSet&) () from /opt/LOInstall/program/../basis-link/program/libswli.so
#9  0xb7569d58 in SfxShell::CallState(void (*)(SfxShell*, SfxItemSet&), SfxItemSet&) () from /opt/LOInstall/program/../basis-link/program/libsfxli.so
#10 0xb7572a0e in SfxDispatcher::_FillState(SfxSlotServer const&, SfxItemSet&, SfxSlot const*) () from /opt/LOInstall/program/../basis-link/program/libsfxli.so
#11 0xb7563c79 in SfxBindings::Update_Impl(SfxStateCache*) () from /opt/LOInstall/program/../basis-link/program/libsfxli.so
#12 0xb75671ef in SfxBindings::NextJob_Impl(Timer*) () from /opt/LOInstall/program/../basis-link/program/libsfxli.so
#13 0xb7566fc6 in SfxBindings::LinkStubNextJob_Impl(void*, void*) () from /opt/LOInstall/program/../basis-link/program/libsfxli.so
#14 0xb67d32bd in Link::Call(void*) const () from /opt/LOInstall/program/../basis-link/program/libvclli.so
#15 0xb67df153 in Timer::Timeout() () from /opt/LOInstall/program/../basis-link/program/libvclli.so
#16 0xb67df06b in Timer::ImplTimerCallbackProc() () from /opt/LOInstall/program/../basis-link/program/libvclli.so
#17 0xb3eff7d2 in SalTimer::CallCallback() () from /opt/LOInstall/basis3.3/program/libvclplug_genli.so
#18 0xb489c9cd in GtkXLib::timeoutFn(void*) () from /opt/LOInstall/basis3.3/program/libvclplug_gtkli.so
#19 0xb3f89fbf in ?? () from /usr/lib/libglib-2.0.so.0
#20 0xb3f88859 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#21 0xb3f89060 in ?? () from /usr/lib/libglib-2.0.so.0
#22 0xb3f8931e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#23 0xb489b6f9 in GtkXLib::Yield(bool, bool) () from /opt/LOInstall/basis3.3/program/libvclplug_gtkli.so
#24 0xb3f073e5 in X11SalInstance::Yield(bool, bool) () from /opt/LOInstall/basis3.3/program/libvclplug_genli.so
#25 0xb67db739 in ImplYield(bool, bool) () from /opt/LOInstall/program/../basis-link/program/libvclli.so
#26 0xb67d8ba0 in Application::Yield(bool) () from /opt/LOInstall/program/../basis-link/program/libvclli.so
#27 0xb67d8bd1 in Application::Execute() () from /opt/LOInstall/program/../basis-link/program/libvclli.so
#28 0xb7de22f6 in desktop::Desktop::Main() () from /opt/LOInstall/program/../basis-link/program/libsofficeapp.so
#29 0xb67deaf9 in ImplSVMain() () from /opt/LOInstall/program/../basis-link/program/libvclli.so
#30 0xb67dec07 in SVMain() () from /opt/LOInstall/program/../basis-link/program/libvclli.so
#31 0xb7dfbd8c in soffice_main () from /opt/LOInstall/program/../basis-link/program/libsofficeapp.so
#32 0x08048d24 in main ()

though clearly some more symbols would help - investigating ...
Comment 2 Michael Meeks 2010-10-04 14:20:39 UTC
476     void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
477                        const SwFrmFmt *pTabFmt, const BOOL bHidden,
478                        const FASTBOOL bRefreshHidden )
479     {
480         const long nWish = pTabFmt->GetFrmSize().GetWidth();
481         const long nAct  = rToFill.GetRight() - rToFill.GetLeft();  // +1 why?
482
483         //Der Wert fuer die linke Kante der Box errechnet sich aus den
484         //Breiten der vorhergehenden Boxen.
485         USHORT nPos = 0;
486         USHORT nSum = 0;
487         USHORT nLeftMin = 0;
488         USHORT nRightMax = 0;
489         const SwTableBox  *pCur  = pBox;
490         const SwTableLine *pLine = pBox->GetUpper();
491         while ( pLine )
492         {   const SwTableBoxes &rBoxes = pLine->GetTabBoxes();
493             for ( USHORT i = 0; i < rBoxes.Count(); ++i )
494             {
495                 SwTwips nWidth = rBoxes[i]->GetFrmFmt()->GetFrmSize().GetWidth();
496                 nSum = (USHORT)(nSum + nWidth);
497                 sal_uInt64 nTmp = nSum;
498                 nTmp *= nAct;
499                 nTmp /= nWish;
500                 if (rBoxes[i] != pCur)
501                 {
502                     if ( pLine == pBox->GetUpper() || 0 == nLeftMin )
503                         nLeftMin = (USHORT)(nTmp - nPos);

Program received signal SIGFPE, Arithmetic exception.
0xb7a58c88 in __udivdi3 () from /opt/LOInstall/program/../basis-link/ure-link/lib/libgcc_s.so.1
(gdb) up
#1  0xaf854060 in lcl_SortedTabColInsert (rToFill=..., pBox=0xae7861b8, pTabFmt=0xae784098, bHidden=0 '\000', bRefreshHidden=0)
    at /data/opt/OpenOffice/loffice/sw/source/core/table/swtable.cxx:499
499                 nTmp /= nWish;
(gdb) p nWish
$1 = 0

as expected; fun. Cor - out of interest how did you come up with this test ? :-) you normally spend lots of time pasting as RTF ? or ... [ it is rather a nice minimal test too - I'm impressed ].
Comment 3 Cor Nouws 2010-10-04 15:04:10 UTC
'Simple' (just how poeple use the office):
 - I plan traveling by train/bus on a website.
 - To save the info, I copy/paste from the site (includes hyperlinks).
 - To clean up the doc, I copy/paste as rtf in a new doc.

Have found another bug in OOo some years ago in the same way.
And tend to find useful shopstoppers regularly (which is often time consuming). Esp the kind of issues as the three that found a fix in 114703...
Comment 4 Cédric Bosdonnat 2010-10-05 00:01:56 UTC
For me.
Comment 5 Cédric Bosdonnat 2010-10-05 01:34:31 UTC
.
Comment 6 Michael Meeks 2010-10-05 02:23:10 UTC
So - some more information; there are two bugs here. The crasher bug is present in up-stream OO.o - but it depends on getting some malformed RTF [ which seemingly we are putting onto the clipboard in LO ]. If I - copy in LO and paste into OO -> I get the same table corruption, and OO crashes when I click.

If I copy in OO and paste into LO - then I get neither a crash, nor corruption.

Clearly we should fix / work around the div/zero crasher in the writer layout core; but the primary problem is in the RTF clipboard export I believe.
Comment 7 Michael Meeks 2010-10-05 02:23:44 UTC
So - some more information; there are two bugs here. The crasher bug is present in up-stream OO.o - but it depends on getting some malformed RTF [ which seemingly we are putting onto the clipboard in LO ]. If I - copy in LO and paste into OO -> I get the same table corruption, and OO crashes when I click.

If I copy in OO and paste into LO - then I get neither a crash, nor corruption.

Clearly we should fix / work around the div/zero crasher in the writer layout core; but the primary problem is in the RTF clipboard export I believe.
Comment 8 Miklos Vajna 2010-10-05 03:57:18 UTC
I'll try to have a look at this in the afternoon.
Comment 9 Cor Nouws 2010-10-05 04:37:21 UTC
thanks for te attention. Fast and impressive (though - sorry - not unique ;-) )

I do not want to stop you, however, if it is too complicated / much for this short term, it is OK for me too. With the current knowlegde of the risk that users run into this, I would not vote for this issue to be a showstopper.
Comment 11 Cor Nouws 2010-10-08 06:52:09 UTC
thanks Cédric!
Comment 12 sophie 2010-11-01 10:46:47 UTC
Verified in 10_10_28_Cedric.rpm build - Closing - Sophie