Seen a Jenkins build fail in JunitTest_framework_complex as below, and the only remotely plausible scenario I can think of is that a call from Frame::contextChanged -> ToolBarManager::frameAction started the timer after Frame::close -> dispose -> ... -> ToolBarManager::dispose had been called but before Frame::close -> dispose -> ... -> ~ToolBarManager had been called. (And tracing the calls to Frame member functions, there indeed appear to be call patterns during JunitTest_framework_complex where Frame::contextChanged is called from within Frame::close -> dispose -> ...) Any other calls to m_aAsyncUpdateControllersTimer.Start() in ToolBarManager appear to already check for !m_bDisposed. <http://ci.libreoffice.org/job/lo_tb_master_linux_dbg/9049/console>: > #7 0x00002b2653546566 in __assert_fail_base () at /lib64/libc.so.6 > #8 0x00002b2653546612 in () at /lib64/libc.so.6 > #9 0x00002b2676f23777 in framework::ToolBarManager::~ToolBarManager() (this=0x3a48710, __in_chrg=<optimized out>) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/framework/source/uielement/toolbarmanager.cxx:198 > #10 0x00002b2676f23978 in framework::ToolBarManager::~ToolBarManager() (this=0x3a48710, __in_chrg=<optimized out>) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/framework/source/uielement/toolbarmanager.cxx:201 > #11 0x00002b2655fd5328 in cppu::OWeakObject::release() (this=0x3a48710) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppuhelper/source/weak.cxx:233 > #12 0x00002b2676ec7138 in cppu::WeakImplHelper<com::sun:⭐:frame::XFrameActionListener, com::sun:⭐:lang::XComponent, com::sun:⭐:ui::XUIConfigurationListener>::release() (this=0x3a48710) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/include/cppuhelper/implbase.hxx:113 > #13 0x00002b2655ef353a in com::sun:⭐:uno::cpp_release(void*) (pCppI=0x3a48738) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/include/com/sun/star/uno/genfunc.hxx:48 > #14 0x00002b2655c5d4ab in cppu::idestructElements(void*, _typelib_TypeDescriptionReference*, int, int, void (*)(void*)) (pElements=0x32c5a28, pElementType=0x1670d90, nStartIndex=0, nStopIndex=5, release=0x2b2655ef3517 <com::sun:⭐:uno::cpp_release(void*)>) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppu/source/uno/destr.hxx:238 > p = 0x3a48738 > nPos = 4 > #15 0x00002b2655c5d64f in cppu::idestroySequence(_sal_Sequence*, _typelib_TypeDescriptionReference*, _typelib_TypeDescription*, void (*)(void*)) (pSeq=0x32c5a20, pType=0x24a6cf0, pTypeDescr=0x24a6cf0, release=0x2b2655ef3517 <com::sun:⭐:uno::cpp_release(void*)>) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppu/source/uno/destr.hxx:284 > __PRETTY_FUNCTION__ = "void cppu::idestroySequence(uno_Sequence*, typelib_TypeDescriptionReference*, typelib_TypeDescription*, uno_ReleaseFunc)" > #16 0x00002b2655c8952f in uno_type_sequence_destroy(uno_Sequence*, typelib_TypeDescriptionReference*, uno_ReleaseFunc) (sequence=0x32c5a20, type=0x24a6cf0, release=0x2b2655ef3517 <com::sun:⭐:uno::cpp_release(void*)>) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppu/source/uno/sequence.cxx:916 > #17 0x00002b2655f31ba6 in com::sun:⭐:uno::Sequence<com::sun:⭐:uno::Reference<com::sun:⭐:uno::XInterface> >::~Sequence() (this=0x2679070, __in_chrg=<optimized out>) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/include/com/sun/star/uno/Sequence.hxx:113 > rType = invalid uno::Type > #18 0x00002b2655f2ef92 in cppu::OInterfaceIteratorHelper::~OInterfaceIteratorHelper() (this=0x2b26785beaf0, __in_chrg=<optimized out>) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppuhelper/source/interfacecontainer.cxx:103 > bShared = false > #19 0x00002b2655f2fb98 in cppu::OInterfaceContainerHelper::disposeAndClear(com::sun:⭐:lang::EventObject const&) (this=0x32bd280, rEvt=...) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppuhelper/source/interfacecontainer.cxx:288 > aGuard = {pT = 0x0} > aIt = {rCont = @0x32bd280, bIsList = 1 '\001', aData = {pAsSequence = 0x2679070, pAsInterface = 0x2679070}, nRemain = 0} > #20 0x00002b2655f308d7 in cppu::OMultiTypeInterfaceContainerHelper::disposeAndClear(com::sun:⭐:lang::EventObject const&) (this=0x38bc030, rEvt=...) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppuhelper/source/interfacecontainer.cxx:477 > i = 0 > nSize = 3 > ppListenerContainers = std::unique_ptr<cppu::OInterfaceContainerHelper *> containing 0x2f7c650 > #21 0x00002b2676e37180 in (anonymous namespace)::Frame::disposing() (this=0x38bbf30) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/framework/source/services/frame.cxx:2242 > parent = uno::Reference to (com::sun:⭐:uno::XInterface *) 0x2b26785beca0 > xThis = uno::Reference to ((anonymous namespace)::Frame *) 0x38bbfa0 > layoutMgr = uno::Reference to (framework::LayoutManager *) 0x2fa5190 > aEvent = {Source = uno::Reference to ((anonymous namespace)::Frame *) 0x38bbfa0} > xDisposableCtrl = uno::Reference to (com::sun:⭐:uno::XInterface *) 0x2b26785beca0 > xDisposableComp = uno::Reference to (com::sun:⭐:uno::XInterface *) 0x2b2676e34200 <(anonymous namespace)::Frame::isActive()+160> > disp = 0x2f7c650 > xDispatchHelper = uno::Reference to (com::sun:⭐:uno::XInterface *) 0x2b26785bec80 > old = Application::Off > contWin = uno::Reference to (com::sun:⭐:uno::XInterface *) 0x2b26785bf050 > #22 0x00002b2655f2b262 in cppu::WeakComponentImplHelperBase::dispose() (this=0x38bbf30) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppuhelper/source/implbase.cxx:107 > aEvt = {Source = uno::Reference to ((anonymous namespace)::Frame *) 0x38bbf30} > aGuard2 = {pT = 0x39553a0} > aGuard = {pT = 0x0} > #23 0x00002b2676e3f0a6 in cppu::PartialWeakComponentImplHelper<com::sun:⭐:lang::XServiceInfo, com::sun:⭐:frame::XFrame2, com::sun:⭐:awt::XWindowListener, com::sun:⭐:awt::XTopWindowListener, com::sun:⭐:awt::XFocusListener, com::sun:⭐:document::XActionLockable, com::sun:⭐:util::XCloseable, com::sun:⭐:frame::XComponentLoader, com::sun:⭐:frame::XTitle, com::sun:⭐:frame::XTitleChangeBroadcaster, com::sun:⭐🫘:XPropertySet, com::sun:⭐🫘:XPropertySetInfo>::dispose() (this=0x38bbf30) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/include/cppuhelper/compbase.hxx:94 > #24 0x00002b2676e34edb in (anonymous namespace)::Frame::close(sal_Bool) (this=0x38bbf30, bDeliverOwnership=0 '\000') at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/framework/source/services/frame.cxx:1829 > xSelfHold = uno::Reference to ((anonymous namespace)::Frame *) 0x38bbf30 > aSource = {Source = uno::Reference to ((anonymous namespace)::Frame *) 0x38bbf30} > pContainer = 0x33c4ba0 > aWriteLock = {m_bCleared = true, m_solarMutex = @0x16529c0} > #25 0x00002b26752971a1 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) (pThis=0x38bbfd0, nVtableIndex=5, pRegisterReturn=0x0, pReturnTypeRef=0x165a1b0, bSimpleReturn=true, pStack=0x2b26785bf1a0, nStack=0, pGPR=0x2b26785bf2c0, pFPR=0x2b26785bf2f0) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:133 > data = {pMethod = 47444203360446, pStack = 0x2b26785bf1a0, nStack = 0, pGPR = 0x2b26785bf2c0, pFPR = 0x2b26785bf2f0, rax = 47444228043088, rdx = 47444228043040, xmm0 = 4.9549649932863477e-314, xmm1 = 2.3440563169523938e-310} > pMethod = 47444209328504 > #26 0x00002b26752960bc in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, typelib_TypeDescriptionReference*, sal_Int32, typelib_MethodParameter*, void*, void**, uno_Any**) (pThis=0x2f330e0, aVtableSlot=..., pReturnTypeRef=0x165a1b0, nParams=1, pParams=0x3200050, pUnoReturn=0x0, pUnoArgs=0x3a70260, ppUnoExc=0x2b26785bf478) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:245 > pStack = 0x2b26785bf1a0 > pFPR = {2.34405631697769e-310, 2.3440546323697648e-310, 1.0609978954826362e-313, 2.3440563169796168e-310, 2.5903774855902888e-316, -9.6283901862001054e-07, 2.3440563169800615e-310, 0} > __PRETTY_FUNCTION__ = "void cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, typelib_TypeDescriptionReference*, sal_Int32, typelib_MethodParameter*, void*, void**, uno_Any**)" > pCppArgs = 0x2b26785bf170 > pStackStart = 0x2b26785bf1a0 > pGPR = {59490256, 0, 47444228043568, 47444174450194, 0, 52429824} > nTempIndices = 0 > nFPR = 0 > pAdjustedThisPtr = 0x38bbfd0 > ppTempParamTypeDescr = 0x2b26785bf180 > nGPR = 2 > pReturnTypeDescr = 0x165a1b0 > pCppReturn = 0x0 > bSimpleReturn = true > pTempIndices = 0x2b26785bf178 > #27 0x00002b2675296ada in bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (pUnoI=0x2f330e0, pMemberDescr=0x3200400, pReturn=0x0, pArgs=0x3a70260, ppException=0x2b26785bf478) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:436 > nMemberPos = 5 > aVtableSlot = {offset = 0, index = 5} > pThis = 0x2f330e0 > pTypeDescr = 0x2590e40 > __PRETTY_FUNCTION__ = "void bridges::cpp_uno::shared::unoInterfaceProxyDispatch(uno_Interface*, const typelib_TypeDescription*, void*, void**, uno_Any**)" > #28 0x00002b267653517a in binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (this=0x3aba970, returnValue=0x2b26785bf8a0, outArguments=0x2b26785bf920) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/binaryurp/source/incomingrequest.cxx:242 > exc = <error reading variable: Cannot access memory at address 0x3aba87808> > pexc = 0x2b26785bf4a0 > retType = {_pTypeDescr = 0x165a1b0} > nSize = 0 > retBuf = std::__debug::vector of length 0, capacity 0 > outBufs = empty std::__debug::list > args = std::__debug::vector of length 1, capacity 1 = {0x3a331c0} > __PRETTY_FUNCTION__ = "bool binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector<binaryurp::BinaryAny>*) const" > isExc = false > #29 0x00002b2676533f7a in binaryurp::IncomingRequest::execute() const (this=0x3aba970) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/binaryurp/source/incomingrequest.cxx:77 > resetCc = true > oldCc = {m_pUnoI = 0x0} > ret = {data_ = _uno_Any(void)} > outArgs = std::__debug::vector of length 0, capacity 0 > isExc = false > #30 0x00002b2676554a88 in binaryurp::(anonymous namespace)::request(void*) (pThreadSpecificData=0x3aba970) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/binaryurp/source/reader.cxx:85 > __PRETTY_FUNCTION__ = "void binaryurp::{anonymous}::request(void*)" > #31 0x00002b2655c27f0b in cppu_threadpool::JobQueue::enter(long, bool) (this=0x398ea80, nDisposeId=39254816, bReturnWhenNoJob=true) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppu/source/threadpool/jobqueue.cxx:107 > guard = {pT = 0x398ea80} > job = {pThreadSpecificData = 0x3aba970, doRequest = 0x2b2676554a1f <binaryurp::(anonymous namespace)::request(void*)>} > pReturn = 0x0 > #32 0x00002b2655c2cb57 in cppu_threadpool::ORequestThread::run() (this=0x256fb20) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/cppu/source/threadpool/thread.cxx:168 > #33 0x00002b2655c2d04d in osl::threadFunc(void*) (param=0x256fb30) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/include/osl/thread.hxx:185 > pObj = 0x256fb30 > #34 0x00002b2652f08340 in osl_thread_start_Impl(void*) (pData=0x2570ac0) at /home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/sal/osl/unx/thread.cxx:240 > terminate = false > pImpl = 0x2570ac0 > __PRETTY_FUNCTION__ = "void* osl_thread_start_Impl(void*)" > #35 0x00002b26538e1dc5 in start_thread () at /lib64/libpthread.so.0 > #36 0x00002b265360eced in clone () at /lib64/libc.so.6 Change-Id: I27e15a72f6b96484cb45928eaabae589cf9d7ed7
LibreOffice
LibreOffice is an integrated office suite based on copyleft licenses and compatible with most document formats and standards. Libreoffice is backed by The Document Foundation, which represents a large independent community of enterprises, developers and other volunteers moved by the common goal of bringing to the market the best software for personal productivity. LibreOffice is open source, and free to download, use and distribute.
A quick overview of the LibreOffice code structure.
Overview
You can develop for LibreOffice in one of two ways, one recommended and one much less so. First the somewhat less recommended way: it is possible to use the SDK to develop an extension, for which you can read the API docs here and here. This re-uses the (extremely generic) UNO APIs that are also used by macro scripting in StarBasic.
The best way to add a generally useful feature to LibreOffice is to work on the code base however. Overall this way makes it easier to compile and build your code, it avoids any arbitrary limitations of our scripting APIs, and in general is far more simple and intuitive - if you are a reasonably able C++ programmer.
The important bits of code
Each module should have a README
file inside it which has some
degree of documentation for that module; patches are most welcome to
improve those. We have those turned into a web page here:
However, there are two hundred modules, many of them of only peripheral interest for a specialist audience. So - where is the good stuff, the code that is most useful. Here is a quick overview of the most important ones:
Module | Description |
---|---|
sal/ | this provides a simple System Abstraction Layer |
tools/ | this provides basic internal types: 'Rectangle', 'Color' etc. |
vcl/ | this is the widget toolkit library and one rendering abstraction |
framework | UNO framework, responsible for building toolbars, menus, status bars, and the chrome around the document using widgets from VCL, and XML descriptions from /uiconfig/ files |
sfx2/ | legacy core framework used by Writer/Calc/Draw: document model / load/save / signals for actions etc. |
svx/ | drawing model related helper code, including much of Draw/Impress |
Then applications
Module | Description |
---|---|
desktop/ | this is where the 'main' for the application lives, init / bootstrap. the name dates back to an ancient StarOffice that also drew a desktop |
sw/ | Writer |
sc/ | Calc |
sd/ | Draw / Impress |
There are several other libraries that are helpful from a graphical perspective:
Module | Description |
---|---|
basegfx/ | algorithms and data-types for graphics as used in the canvas |
canvas/ | new (UNO) canvas rendering model with various backends |
cppcanvas/ | C++ helper classes for using the UNO canvas |
drawinglayer/ | View code to render drawable objects and break them down into primitives we can render more easily. |
Finding out more
Beyond this, you can read the README
files, send us patches, ask
on the mailing list libreoffice@lists.freedesktop.org (no subscription
required) or poke people on IRC #libreoffice-dev
on irc.freenode.net -
we're a friendly and generally helpful mob. We know the code can be
hard to get into at first, and so there are no silly questions.