Bug Hunting Session
Bug 60730 - Crash removing last visible extension from Extension Manager
Summary: Crash removing last visible extension from Extension Manager
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.1.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Stephan Bergmann
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-12 14:45 UTC by Stephan Bergmann
Modified: 2015-02-03 10:27 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Bergmann 2013-02-12 14:45:32 UTC
In "Tools - Extension Manager..." deselect "Type of Extension" "Installation" and "Shared", leaving only "User" selected.  With just one such extension installed, select it and chose "Remove".

At least with certain --enable-dbgutil builds that can lead to stderr output

> /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/debug/vector:336:
>  error: attempt to subscript container with out-of-bounds index -1, but
>  container only holds 0 elements.
> Objects involved in the operation:
> sequence "this" @ 0x0x2a36100 {
>  type = NSt7__debug6vectorIN5boost10shared_ptrIN6dp_gui10Entry_ImplEEESaIS5_EEE;
> }

and a SIGABRT crash.  The reason is that m_bHasActive and m_nActive members of ExtensionBox_Impl (desktop/source/deployment/gui/dp_gui_extlistbox.hxx) are not properly synchronized, so that it can happen that while one thread is somewhere past

> #0  dp_gui::ExtensionBox_Impl::removeEntry (this=0x2f70ff0, xPackage=uno::Reference to (XInterface) 0x7fe9a410c5d0) at lo/core/desktop/source/deployment/gui/dp_gui_extlistbox.cxx:1114
> #1  0x00007fe996fc9439 in dp_gui::ExtMgrDialog::addPackageToList (this=0x2f53b50, xPackage=uno::Reference to (XInterface) 0x7fe9a410c5d0, bLicenseMissing=false) at lo/core/desktop/source/deployment/gui/dp_gui_dialog2.cxx:765
> #2  0x00007fe9970020ca in dp_gui::TheExtensionManager::createPackageList (this=0x7fe9a4157ac0) at lo/core/desktop/source/deployment/gui/dp_gui_theextmgr.cxx:300
> #3  0x00007fe99700319b in dp_gui::TheExtensionManager::modified (this=0x7fe9a4157ac0) at lo/core/desktop/source/deployment/gui/dp_gui_theextmgr.cxx:476
> #4  0x00007fe9946421a3 in boost::_mfi::mf1<void, com::sun::star::util::XModifyListener, com::sun::star::lang::EventObject const&>::call<com::sun::star::uno::Reference<com::sun::star::util::XModifyListener> const, com::sun::star::lang::EventObject const> (this=0x7fe98f9c4660, u=uno::Reference to (XInterface) 0x7fe9a4157af0, b1=...) at lo/core/workdir/unxlngx6/UnpackedTarball/boost/boost/bind/mem_fn_template.hpp:156
> #5  0x00007fe994640378 in boost::_mfi::mf1<void, com::sun::star::util::XModifyListener, com::sun::star::lang::EventObject const&>::operator()<com::sun::star::uno::Reference<com::sun::star::util::XModifyListener> > (this=0x7fe98f9c4660, u=uno::Reference to (XInterface) 0x7fe9a4157af0, a1=...) at lo/core/workdir/unxlngx6/UnpackedTarball/boost/boost/bind/mem_fn_template.hpp:179
> #6  0x00007fe99463d629 in boost::_bi::list2<boost::arg<1>, boost::_bi::value<com::sun::star::lang::EventObject> >::operator()<boost::_mfi::mf1<void, com::sun::star::util::XModifyListener, com::sun::star::lang::EventObject const&>, boost::_bi::list1<com::sun::star::uno::Reference<com::sun::star::util::XModifyListener> const&> > (this=0x7fe98f9c4670, f=..., a=...) at lo/core/workdir/unxlngx6/UnpackedTarball/boost/boost/bind/bind.hpp:318
> #7  0x00007fe99463a216 in boost::_bi::bind_t<void, boost::_mfi::mf1<void, com::sun::star::util::XModifyListener, com::sun::star::lang::EventObject const&>, boost::_bi::list2<boost::arg<1>, boost::_bi::value<com::sun::star::lang::EventObject> > >::operator()<com::sun::star::uno::Reference<com::sun::star::util::XModifyListener> > (this=0x7fe98f9c4660, a1=uno::Reference to (XInterface) 0x7fe9a4157af0) at lo/core/workdir/unxlngx6/UnpackedTarball/boost/boost/bind/bind_template.hpp:53
> #8  0x00007fe99463621b in cppu::OInterfaceContainerHelper::forEach<com::sun::star::util::XModifyListener, boost::_bi::bind_t<void, boost::_mfi::mf1<void, com::sun::star::util::XModifyListener, com::sun::star::lang::EventObject const&>, boost::_bi::list2<boost::arg<1>, boost::_bi::value<com::sun::star::lang::EventObject> > > > (this=0x7fe9a4141df8, func=...) at lo/core/solver/unxlngx6/inc/cppuhelper/interfacecontainer.h:280
> #9  0x00007fe99462d5fe in dp_manager::ExtensionManager::fireModified (this=0x7fe9a47390c8) at lo/core/desktop/source/deployment/manager/dp_extensionmanager.cxx:1499
> #10 0x00007fe994626256 in dp_manager::ExtensionManager::activateExtension (this=0x7fe9a47390c8, identifier="org.openoffice.ne.hunspell.dictionaries", fileName="dict-ne.oxt", bUserDisabled=false, bStartup=false, xAbortChannel=uno::Reference to (XInterface) 0x7fe96d087860, xCmdEnv=uno::Reference to (XInterface) 0x7fe96ce5fa78) at lo/core/desktop/source/deployment/manager/dp_extensionmanager.cxx:442
> #11 0x00007fe994628cf4 in dp_manager::ExtensionManager::removeExtension (this=0x7fe9a47390c8, identifier="org.openoffice.ne.hunspell.dictionaries", fileName="dict-ne.oxt", repository="user", xAbortChannel=uno::Reference to (XInterface) 0x7fe96d087860, xCmdEnv=uno::Reference to (XInterface) 0x7fe96ce5fa78) at lo/core/desktop/source/deployment/manager/dp_extensionmanager.cxx:886
> #12 0x00007fe996fdc5ad in dp_gui::ExtensionCmdQueue::Thread::_removeExtension (this=0x2f80b70, rCmdEnv=rtl::Reference to {<cppu::WeakImplHelper3<com::sun::star::ucb::XCommandEnvironment, com::sun::star::task::XInteractionHandler, com::sun::star::ucb::XProgressHandler>> = {<cppu::OWeakObject> = {<com::sun::star::uno::XWeak> = {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7fe997274890 <vtable for dp_gui::ProgressCmdEnv+16>}, <No data fields>}, m_refCount = 2, m_pWeakConnectionPoint = 0x0, m_pReserved = 0x732f65726f632f6f}, <com::sun::star::lang::XTypeProvider> = {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7fe997274910 <vtable for dp_gui::ProgressCmdEnv+144>}, <No data fields>}, <com::sun::star::ucb::XCommandEnvironment> = {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7fe997274948 <vtable for dp_gui::ProgressCmdEnv+200>}, <No data fields>}, <com::sun::star::task::XInteractionHandler> = {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7fe997274980 <vtable for dp_gui::ProgressCmdEnv+256>}, <No data fields>}, <com::sun::star::ucb::XProgressHandler> = {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7fe9972749b0 <vtable for dp_gui::ProgressCmdEnv+304>}, <No data fields>}, <No data fields>}, m_xHandler = empty uno::Reference, m_xContext = uno::Reference to (XInterface) 0x7fe9aac96dd8, m_xAbortChannel = uno::Reference to (XInterface) 0x7fe96d087860, m_pDialogHelper = 0x2f53dc8, m_sTitle = "Add Extension(s)", m_bAborted = false, m_bWarnUser = false, m_nCurrentProgress = 4}, xPackage=uno::Reference to (XInterface) 0x7fe96dde2a98) at lo/core/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:916
> #13 0x00007fe996fdb909 in dp_gui::ExtensionCmdQueue::Thread::execute (this=0x2f80b70) at lo/core/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx:770
> #14 0x00007fe9ba9c3a98 in salhelper::Thread::run (this=0x2f80b70) at lo/core/salhelper/source/thread.cxx:60
> #15 0x00007fe9ba9c3e6d in osl::threadFunc (param=0x2f80b80) at lo/core/solver/unxlngx6/inc/osl/thread.hxx:187
> #16 0x00007fe9bbea1d0b in osl_thread_start_Impl (pData=0x2f642d0) at lo/core/sal/osl/unx/thread.c:252
> #17 0x0000003c80a07d15 in start_thread (arg=0x7fe98f9c5700) at pthread_create.c:308
> #18 0x0000003c806f246d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:114

the main thread fails at

> #0  0x0000003c80635ba5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:63
> #1  0x0000003c80637358 in __GI_abort () at abort.c:90
> #2  0x0000003c82eb193d in __gnu_debug::_Error_formatter::_M_error (this=0x7ffff437f2b0) at ../../../../../libstdc++-v3/src/c++11/debug.cc:777
> #3  0x00007f8a3c698e6e in std::__debug::vector<boost::shared_ptr<dp_gui::Entry_Impl>, std::allocator<boost::shared_ptr<dp_gui::Entry_Impl> > >::operator[] (this=0x2a36100, __n=18446744073709551615) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/debug/vector:336
> #4  0x00007f8a3c6b0ba2 in dp_gui::ExtensionBox_Impl::CalcActiveHeight (this=0x2a35e80, nPos=-1) at lo/core/desktop/source/deployment/gui/dp_gui_extlistbox.cxx:407
> #5  0x00007f8a3c6b2b90 in dp_gui::ExtensionBox_Impl::RecalcAll (this=0x2a35e80) at lo/core/desktop/source/deployment/gui/dp_gui_extlistbox.cxx:688
> #6  0x00007f8a3c68ccf3 in dp_gui::ExtBoxWithBtns_Impl::RecalcAll (this=0x2a35e80) at lo/core/desktop/source/deployment/gui/dp_gui_dialog2.cxx:233
> #7  0x00007f8a3c6b30d3 in dp_gui::ExtensionBox_Impl::Paint (this=0x2a35e80) at lo/core/desktop/source/deployment/gui/dp_gui_extlistbox.cxx:793
> #8  0x00007f8a54e5cff0 in Window::ImplCallPaint (this=0x2a35e80, pRegion=0x351dff0, nPaintFlags=28) at lo/core/vcl/source/window/window.cxx:2459
> #9  0x00007f8a54e5d152 in Window::ImplCallPaint (this=0x2a364d0, pRegion=0x351ec90, nPaintFlags=28) at lo/core/vcl/source/window/window.cxx:2483
> #10 0x00007f8a54e5d152 in Window::ImplCallPaint (this=0x2a35870, pRegion=0x3526b40, nPaintFlags=28) at lo/core/vcl/source/window/window.cxx:2483
> #11 0x00007f8a54e5d152 in Window::ImplCallPaint (this=0x2a27f20, pRegion=0x350b870, nPaintFlags=28) at lo/core/vcl/source/window/window.cxx:2483
> #12 0x00007f8a54e5d152 in Window::ImplCallPaint (this=0x2a18a20, pRegion=0x0, nPaintFlags=28) at lo/core/vcl/source/window/window.cxx:2483
> #13 0x00007f8a54e5d360 in Window::ImplCallOverlapPaint (this=0x2a18a20) at lo/core/vcl/source/window/window.cxx:2519
> #14 0x00007f8a54e5d4b5 in Window::ImplHandlePaintHdl (this=0x2a18a20) at lo/core/vcl/source/window/window.cxx:2546
> #15 0x00007f8a54e5d3cb in Window::LinkStubImplHandlePaintHdl (pThis=0x2a18a20, pCaller=0x2a1ec40) at lo/core/vcl/source/window/window.cxx:2533
> #16 0x00007f8a548e112e in Link::Call (this=0x2a1ec60, pCaller=0x2a1ec40) at lo/core/solver/unxlngx6/inc/tools/link.hxx:123
> #17 0x00007f8a54906005 in Timer::Timeout (this=0x2a1ec40) at lo/core/vcl/source/app/timer.cxx:245
> #18 0x00007f8a54905c6e in Timer::ImplTimerCallbackProc () at lo/core/vcl/source/app/timer.cxx:133
> #19 0x00007f8a47d0e183 in SalTimer::CallCallback (this=0x28c4790) at lo/core/vcl/inc/saltimer.hxx:57
> #20 0x00007f8a47d0d790 in sal_gtk_timeout_dispatch (pSource=0x7f8a280086e0) at lo/core/vcl/unx/gtk/app/gtkdata.cxx:844
> #21 0x0000003222c47a55 in g_main_dispatch (context=0x1da2130) at gmain.c:2715
> #22 g_main_context_dispatch (context=context@entry=0x1da2130) at gmain.c:3219
> #23 0x0000003222c47d88 in g_main_context_iterate (context=context@entry=0x1da2130, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3290
> #24 0x0000003222c47e44 in g_main_context_iteration (context=0x1da2130, may_block=1) at gmain.c:3351
> #25 0x00007f8a47d0caf0 in GtkData::Yield (this=0x1d692a0, bWait=true, bHandleAllCurrentEvents=false) at lo/core/vcl/unx/gtk/app/gtkdata.cxx:587
> #26 0x00007f8a47d106b0 in GtkInstance::Yield (this=0x1d69730, bWait=true, bHandleAllCurrentEvents=false) at lo/core/vcl/unx/gtk/app/gtkinst.cxx:563
> #27 0x00007f8a548fae9e in ImplYield (i_bWait=true, i_bAllEvents=false) at lo/core/vcl/source/app/svapp.cxx:429
> #28 0x00007f8a548f725d in Application::Yield (i_bAllEvents=false) at lo/core/vcl/source/app/svapp.cxx:463
> #29 0x00007f8a548f71fe in Application::Execute () at lo/core/vcl/source/app/svapp.cxx:408
> #30 0x00007f8a59141a73 in desktop::Desktop::Main (this=0x7ffff4380590) at lo/core/desktop/source/app/app.cxx:1687
> #31 0x00007f8a549026bf in ImplSVMain () at lo/core/vcl/source/app/svmain.cxx:163
> #32 0x00007f8a549027ec in SVMain () at lo/core/vcl/source/app/svmain.cxx:200
> #33 0x00007f8a59184322 in soffice_main () at lo/core/desktop/source/app/sofficemain.cxx:73
> #34 0x0000000000400998 in sal_main () at lo/core/desktop/source/app/main.c:48
> #35 0x0000000000400979 in main (argc=2, argv=0x7ffff4380778) at lo/core/desktop/source/app/main.c:47

with m_bHasActive = true but m_nActive = -1.
Comment 1 Stephan Bergmann 2015-02-03 10:27:55 UTC
fixed with <http://cgit.freedesktop.org/libreoffice/core/commit/?id=661f7bdefc8215f742951727b93395d47293cf0e> "m_bHasActive must be false after last visible entry is removed"