Bug 92629 - sheet removeByName error if file loaded as hidden
Summary: sheet removeByName error if file loaded as hidden
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.0.0.2 rc
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Laurent Godard
URL:
Whiteboard: target:5.1.0 target:5.0.1
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-08 16:27 UTC by Laurent Godard
Modified: 2016-10-25 19:24 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
the main() macro that reproduces the problem (change url) (8.50 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-07-08 16:27 UTC, Laurent Godard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Godard 2015-07-08 16:27:28 UTC
Created attachment 117133 [details]
the main() macro that reproduces the problem (change url)

in a macro, 
doc loaded with loadOption Hidden = true
trying to remove a sheet
doc.sheets.removeByName(aSheetName)

* gives an error

Type: com.sun.star.uno.RuntimeException
Message: C++ code threw St12out_of_range: vector::_M_range_check: __n (which is 1) >= this->size() (which is 1).

* if file loaded with Hidden = false (normal mode), NO error
(even if it is hidden after loading)

so the problem seems on populating maTabData (in ScViewData)

* as attachement, a macro to reproduce the problem
(change the url var that stores the file)

* here is the bt

Catchpoint 2 (exception thrown), 0x00007ffff6c7684d in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0  0x00007ffff6c7684d in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007ffff6c999c5 in std::__throw_out_of_range_fmt(char const*, ...) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007fffc39e9e58 in _M_range_check (__n=1, this=0x1f73f00) at /usr/include/c++/4.9/bits/stl_vector.h:803
#3  at (__n=1, this=0x1f73f00) at /usr/include/c++/4.9/bits/stl_vector.h:824
#4  ScViewData::DeleteTab (this=this@entry=0x1f73ef0, nTab=nTab@entry=1) at /home/lgodard/hdd/cncc/libreoffice/master/sc/source/ui/view/viewdata.cxx:504
#5  0x00007fffc39cda84 in ScTabViewShell::Notify (this=0x1f73e80, rBC=..., rHint=...) at /home/lgodard/hdd/cncc/libreoffice/master/sc/source/ui/view/tabvwsh5.cxx:215
#6  0x00007ffff401b38d in SfxBroadcaster::Broadcast (this=0x1e82120, rHint=...) at /home/lgodard/hdd/cncc/libreoffice/master/svl/source/notify/SfxBroadcaster.cxx:51
#7  0x00007fffc367d7de in ScDocFunc::DeleteTable (this=0x38ad840, nTab=1, bRecord=<optimized out>, bRecord@entry=true) at /home/lgodard/hdd/cncc/libreoffice/master/sc/source/ui/docshell/docfunc.cxx:3100
#8  0x00007fffc386d27f in ScTableSheetsObj::removeByName (this=0x7fffd4a66cc0, aName=...) at /home/lgodard/hdd/cncc/libreoffice/master/sc/source/ui/unoobj/docuno.cxx:3185
#9  0x00007fffe0a0da13 in gcc3::callVirtualMethod (pThis=0x7fffd4a66ce8, nVtableIndex=10, pRegisterReturn=0x7fffffffccc0, pReturnTypeRef=0x650600, bSimpleReturn=true, pStack=0x7fffffffca00, nStack=0, pGPR=0x7fffffffcb20, 
    pFPR=0x7fffffffcb50) at /home/lgodard/hdd/cncc/libreoffice/master/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:122
#10 0x00007fffe0a0cd1e in cpp_call (pThis=pThis@entry=0x1e8edd0, aVtableSlot=..., pReturnTypeRef=<optimized out>, nParams=<optimized out>, pParams=<optimized out>, pUnoReturn=pUnoReturn@entry=0x7fffffffccc0, 
    pUnoArgs=0x7fffffffcca0, ppUnoExc=0x7fffffffcd70) at /home/lgodard/hdd/cncc/libreoffice/master/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:245
#11 0x00007fffe0a0d512 in bridges::cpp_uno::shared::unoInterfaceProxyDispatch (pUnoI=0x1e8edd0, pMemberDescr=0x1f88ca0, pReturn=0x7fffffffccc0, pArgs=0x7fffffffcca0, ppException=0x7fffffffcd70)
    at /home/lgodard/hdd/cncc/libreoffice/master/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:443
#12 0x00007fffc9ba771b in stoc_corefl::IdlInterfaceMethodImpl::invoke (this=0x7fffd4b10ab8, rObj=..., rArgs=...) at /home/lgodard/hdd/cncc/libreoffice/master/stoc/source/corereflection/criface.cxx:706
#13 0x00007ffff4affbad in SbUnoObject::Notify (this=0x37b2160, rBC=..., rHint=...) at /home/lgodard/hdd/cncc/libreoffice/master/basic/source/classes/sbunoobj.cxx:2286
#14 0x00007ffff401b38d in SfxBroadcaster::Broadcast (this=this@entry=0x38b5060, rHint=...) at /home/lgodard/hdd/cncc/libreoffice/master/svl/source/notify/SfxBroadcaster.cxx:51
#15 0x00007ffff4bb409f in SbxVariable::Broadcast (this=0x3993060, nHintId=<optimized out>) at /home/lgodard/hdd/cncc/libreoffice/master/basic/source/sbx/sbxvar.cxx:182
Comment 1 Commit Notification 2015-07-09 22:47:00 UTC
Laurent Godard committed a patch related to this issue.
It has been pushed to "master":

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

init maTabData to the correct tab size tdf#92629

It will be available in 5.1.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 2 Commit Notification 2015-08-07 12:19:40 UTC
Laurent Godard committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=35e449707501c2f19a585fba3efcf1ccd217df6e&h=libreoffice-5-0

init maTabData to the correct tab size tdf#92629

It will be available in 5.0.1.

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.