Michael Stahl a05e5adc62 dbaccess: avoid deadlock in ODatabaseContext::registerObject()
Limit the scope of m_aMutex lock to what is necessary.

As observed by Jan-Marek Glogowski:

[Switching to thread 198 (Thread 0x2aab44e5b700 (LWP 46847))]
3  osl_acquireMutex(oslMutexImpl*) (pMutex=0x1e59d10) at sal/osl/unx/mutex.cxx:97
4  osl::Mutex::acquire() (this=0x1ebbe28) at include/osl/mutex.hxx:56
5  osl::Guard<osl::Mutex>::Guard(osl::Mutex&, bool) (this=0x2aab44e56198, rT=..., bAquire=true) at include/osl/mutex.hxx:135
6  dbaccess::ODatabaseContext::getElementNames() (this=0x1ebbd90) at dbaccess/source/core/dataaccess/databasecontext.cxx:661
7  non-virtual thunk to dbaccess::ODatabaseContext::getElementNames() () at dbaccess/source/core/dataaccess/databasecontext.cxx:659
8  dbaui::SbaTableQueryBrowser::initializeTreeModel() (this=0xb174890) at dbaccess/source/ui/browser/unodatbr.cxx:2086
9  dbaui::SbaTableQueryBrowser::impl_initialize() (this=0xb174890) at dbaccess/source/ui/browser/unodatbr.cxx:3201
10 dbaui::OGenericUnoController::initialize(com::sun::uno::Sequence<com::sun::uno::Any> const&) (this=0xb174890, aArguments=uno::Sequence of length 9 = {...}) at dbaccess/source/ui/browser/genericcontroller.cxx:299
11 DBContentLoader::load(com::sun::uno::Reference<com::sun::frame::XFrame> const&, rtl::OUString const&, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&, com::sun::uno::Reference<com::sun::frame::XLoadEventListener> const&) (this=0xb1730a0, rFrame=uno::Reference to ((anonymous namespace)::Frame *) 0xb162690, rURL=".component:DB/DataSourceBrowser", rArgs=uno::Sequence of length 8 = {...}, rListener=uno::Reference to (framework::LoadEnvListener *) 0xb174228) at dbaccess/source/ui/browser/dbloader.cxx:270
12 framework::LoadEnv::impl_loadContent() (this=0xb16f5b8) at framework/source/loadenv/loadenv.cxx:1077
13 framework::LoadEnv::startLoading() (this=0xb16f5b8) at framework/source/loadenv/loadenv.cxx:372

[Switching to thread 196 (Thread 0x2aab4565f700 (LWP 42841))]
3  osl_acquireMutex(oslMutexImpl*) (pMutex=0x773cd0) at sal/osl/unx/mutex.cxx:97
4  osl::Mutex::acquire() (this=0x77b4a8) at include/osl/mutex.hxx:56
5  comphelper::GenericSolarMutex::doAcquire(unsigned int) (this=0x77b4a0, nLockCount=1) at comphelper/source/misc/solarmutex.cxx:61
6  comphelper::SolarMutex::acquire(unsigned int) (this=0x77b4a0, nLockCount=1) at include/comphelper/solarmutex.hxx:74
7  osl::ClearableGuard<comphelper::SolarMutex>::ClearableGuard(comphelper::SolarMutex&) (this=0x2aab4565d478, t=...) at include/osl/mutex.hxx:170
8  osl::ResettableGuard<comphelper::SolarMutex>::ResettableGuard(comphelper::SolarMutex&) (this=0x2aab4565d478, rT=...) at include/osl/mutex.hxx:215
9  SolarMutexResettableGuard::SolarMutexResettableGuard() (this=0x2aab4565d478) at include/vcl/svapp.hxx:1416
10 dbaccess::ModelMethodGuard::ModelMethodGuard(dbaccess::ModelDependentComponent const&) (this=0x2aab4565d478, _component=...) at dbaccess/source/core/dataaccess/ModelImpl.hxx:587
11 dbaccess::ODatabaseSource::getDatabaseDocument() (this=0x281d690) at dbaccess/source/core/dataaccess/datasource.cxx:1300
12 non-virtual thunk to dbaccess::ODatabaseSource::getDatabaseDocument() () at dbaccess/source/core/dataaccess/datasource.cxx:1298
13 dbaccess::ODatabaseContext::registerObject(rtl::OUString const&, com::sun::uno::Reference<com::sun::uno::XInterface> const&) (this=0x1ebbd90, _rName="MyFactory", _rxObject=uno::Reference to (dbaccess::ODatabaseSource *) 0x281d708) at dbaccess/source/core/dataaccess/databasecontext.cxx:433
14 gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) (pThis=0x1ebbdf8, nVtableIndex=4, pRegisterReturn=0x0, pReturnTypeRef=0x781090, bSimpleReturn=true, pStack=0x2aab4565d810, nStack=0, pGPR=0x2aab4565db30, pFPR=0x2aab4565daf0) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77

Change-Id: I06e91d9c4e193c97f98f29f6b73eaf01b12922c0
2017-08-24 13:04:36 +02:00
2017-06-15 08:24:33 +02:00
2017-08-22 10:51:36 +02:00
2017-08-20 12:51:00 +02:00
2017-08-19 11:54:25 +02:00
2017-08-01 11:06:26 +02:00
2017-08-17 21:53:28 +02:00
2017-08-14 09:14:39 +02:00
2017-06-22 00:27:26 +02:00
2017-08-01 13:42:21 +01:00
2017-08-23 16:42:20 +02:00
2017-08-24 10:14:54 +02:00
2017-08-21 03:46:36 +02:00
2017-08-06 17:28:45 +02:00
2017-08-21 21:29:11 +02:00
2017-08-11 08:47:22 +01:00
2017-08-08 20:56:44 +02:00
2017-07-31 08:25:07 +02:00
2017-08-01 13:42:21 +01:00
2017-08-14 09:14:39 +02:00
2017-08-01 12:30:55 +02:00
2017-08-19 11:59:16 +02:00
2017-08-21 08:43:01 +02:00
2017-08-18 07:44:59 +02:00
2017-08-02 13:45:36 +02:00
2017-07-31 08:25:07 +02:00
2017-08-17 21:53:28 +02:00
2017-08-17 21:53:28 +02:00
2017-08-17 21:53:28 +02:00
2017-08-24 08:01:58 +02:00
2017-07-31 08:25:07 +02:00
2017-08-10 12:19:50 +02:00
2017-08-22 20:16:03 +02:00
2017-08-18 08:49:37 +02:00
2017-08-22 08:38:48 +02:00
2017-08-24 10:55:29 +02:00
2017-08-01 13:42:21 +01:00
2017-07-19 14:36:13 +02:00
2017-08-21 08:43:01 +02:00
2017-07-21 08:20:50 +01:00
2017-08-24 07:53:30 +02:00
2017-08-17 21:53:28 +02:00
2017-08-21 23:31:25 +02:00
2017-08-18 08:49:37 +02:00
2017-06-27 13:15:34 +02:00
2017-07-12 18:19:40 +02:00
2017-08-22 00:24:08 +02:00
2017-08-17 21:53:28 +02:00
2017-08-22 15:46:38 +02:00
2017-08-01 13:42:21 +01:00
2017-08-18 07:44:59 +02:00
2017-07-25 12:03:50 +02:00
2017-08-11 08:34:55 +02:00
2017-08-17 21:53:28 +02:00
2017-07-21 08:20:50 +01:00
2017-08-02 17:20:00 +02:00
2017-07-28 09:18:04 +01:00
2017-08-17 21:53:28 +02:00

LibreOffice

Coverity Scan Build Status CII Best Practices

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:

http://docs.libreoffice.org/

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.

Description
LibreOffice mirror (not auto-updating).
Readme 1.9 GiB
Languages
C++ 82.4%
Java 5.3%
Rich Text Format 2.3%
PostScript 1.9%
Python 1.9%
Other 5.7%