Bug 57979 - ODatabaseContext::dispose uses other services during shutdown
Summary: ODatabaseContext::dispose uses other services during shutdown
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.0.0.0.alpha0+ Master
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 101734 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-12-07 11:13 UTC by Stephan Bergmann
Modified: 2019-01-28 03:42 UTC (History)
3 users (show)

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 2012-12-07 11:13:31 UTC
At least reproducible with current Linux x86-64 --enable-dbugtil master build: "File - New - Database", "Finish", save, "Reports - Use Wizard to Create Report...", "Cancel", "File - Exit LibreOffice" reports

> warn:legacy.osl:9105:1:lo/core/dbaccess/source/core/dataaccess/ModelImpl.cxx:924: caught an exception!
> in function:static bool dbaccess::ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors(const com::sun::star::uno::Reference<com::sun::star::embed::XStorage>&)
> type: com.sun.star.uno.DeploymentException
> message: component context fails to supply service com.sun.star.io.TempFile of type com.sun.star.io.XTempFile
> context: N4cppu16ComponentContextE

on stderr, coming from

> #0  0x00007fffa3ba44e5 in dbaccess::ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors (_rxStorage=uno::Reference to {<com::sun::star::container::XNameAccess> = {<com::sun::star::container::XElementAccess> = {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7fffb42ded10}, <No data fields>}, <No data fields>}, <com::sun::star::lang::XComponent> = {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7fffb42def80}, <No data fields>}, <No data fields>}) at lo/core/dbaccess/source/core/dataaccess/ModelImpl.cxx:924
> #1  0x00007fffa3ba371a in dbaccess::ODatabaseModelImpl::commitRootStorage (this=0x4af4af0) at lo/core/dbaccess/source/core/dataaccess/ModelImpl.cxx:828
> #2  0x00007fffa3ba208c in dbaccess::ODatabaseModelImpl::dispose (this=0x4af4af0) at lo/core/dbaccess/source/core/dataaccess/ModelImpl.cxx:741
> #3  0x00007fffa3b16565 in dbaccess::ODatabaseContext::disposing (this=0x7fffb4866258) at lo/core/dbaccess/source/core/dataaccess/databasecontext.cxx:290
> #4  0x00007ffff70258ba in cppu::WeakComponentImplHelperBase::dispose (this=0x7fffb4866258) at lo/core/cppuhelper/source/implbase.cxx:268
> #5  0x00007fffa3b25a52 in cppu::WeakComponentImplHelper3<com::sun::star::lang::XServiceInfo, com::sun::star::sdb::XDatabaseContext, com::sun::star::lang::XUnoTunnel>::dispose (this=0x7fffb4866258) at lo/core/solver/unxlngx6/inc/cppuhelper/compbase3.hxx:66
> #6  0x00007ffff701e8b0 in cppu::OFactoryComponentHelper::dispose (this=0x7fffb459d018) at lo/core/cppuhelper/source/factory.cxx:514
> #7  0x00007ffff6fda888 in cppu::OComponentHelper::release (this=0x7fffb459d018) at lo/core/cppuhelper/source/component.cxx:91
> #8  0x00007ffff70234e8 in cppu::OFactoryComponentHelper::release (this=0x7fffb459d018) at lo/core/cppuhelper/source/factory.cxx:334
> #9  0x00007ffff6fd601b in com::sun::star::uno::Reference<com::sun::star::lang::XSingleComponentFactory>::~Reference (this=0x7386e0, __in_chrg=<optimized out>) at lo/core/solver/unxlngx6/inc/com/sun/star/uno/Reference.hxx:108
> #10 0x00007ffff6ff9ea9 in (anonymous namespace)::Implementation::~Implementation (this=0x7386d0, __in_chrg=<optimized out>) at lo/core/cppuhelper/source/defaultbootstrap.cxx:150
> #11 0x00007ffff6ff9f02 in boost::checked_delete<{anonymous}::Implementation>((anonymous namespace)::Implementation *) (x=0x7386d0) at lo/core/solver/unxlngx6/inc/external/boost/checked_delete.hpp:34
> #12 0x00007ffff7000cb8 in boost::detail::sp_counted_impl_p<{anonymous}::Implementation>::dispose(void) (this=0x7387e0) at lo/core/solver/unxlngx6/inc/external/boost/smart_ptr/detail/sp_counted_impl.hpp:78
> #13 0x00007ffff7001300 in boost::detail::sp_counted_base::release (this=0x7387e0) at lo/core/solver/unxlngx6/inc/external/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:145
> #14 0x00007ffff700138f in boost::detail::shared_count::~shared_count (this=0x738830, __in_chrg=<optimized out>) at lo/core/solver/unxlngx6/inc/external/boost/smart_ptr/detail/shared_count.hpp:217
> #15 0x00007ffff6fde03c in boost::shared_ptr<{anonymous}::Implementation>::~shared_ptr(void) (this=0x738828, __in_chrg=<optimized out>) at lo/core/solver/unxlngx6/inc/external/boost/smart_ptr/shared_ptr.hpp:168
> #16 0x00007ffff6fe0151 in std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >::~pair(void) (this=0x738820, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_pair.h:88
> #17 0x00007ffff6ffea5e in std::_Rb_tree_node<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >::~_Rb_tree_node(void) (this=0x738800, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_tree.h:130
> #18 0x00007ffff6ffea7c in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::destroy<std::_Rb_tree_node<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >(std::_Rb_tree_node<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > *) (this=0x7fffffffdcf0, __p=0x738800) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/ext/new_allocator.h:114
> #19 0x00007ffff6ffc5fb in std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_M_destroy_node(std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_Link_type) (this=0x7fffffffdcf0, __p=0x738800) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_tree.h:419
> #20 0x00007ffff6ff8a15 in std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_M_erase(std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_Link_type) (this=0x7fffffffdcf0, __x=0x738800) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_tree.h:1084
> #21 0x00007ffff6ff89f2 in std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_M_erase(std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_Link_type) (this=0x7fffffffdcf0, __x=0x7385e0) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_tree.h:1082
> #22 0x00007ffff6ff89f2 in std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_M_erase(std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_Link_type) (this=0x7fffffffdcf0, __x=0x6e52b0) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_tree.h:1082
> #23 0x00007ffff6ff89f2 in std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_M_erase(std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_Link_type) (this=0x7fffffffdcf0, __x=0x6db140) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_tree.h:1082
> #24 0x00007ffff6ff89f2 in std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_M_erase(std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::_Link_type) (this=0x7fffffffdcf0, __x=0x6e8790) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_tree.h:1082
> #25 0x00007ffff6ff45e8 in std::_Rb_tree<rtl::OUString, std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> >, std::_Select1st<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > >, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::~_Rb_tree(void) (this=0x7fffffffdcf0, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_tree.h:646
> #26 0x00007ffff6fef3a8 in std::__cxx1998::map<rtl::OUString, boost::shared_ptr<{anonymous}::Implementation>, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::~map(void) (this=0x7fffffffdcf0, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/bits/stl_map.h:90
> #27 0x00007ffff6fef444 in std::__debug::map<rtl::OUString, boost::shared_ptr<{anonymous}::Implementation>, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, boost::shared_ptr<{anonymous}::Implementation> > > >::~map(void) (this=0x7fffffffdcf0, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/debug/map.h:107
> #28 0x00007ffff6fe14aa in (anonymous namespace)::Data::~Data (this=0x7fffffffdcf0, __in_chrg=<optimized out>) at lo/core/cppuhelper/source/defaultbootstrap.cxx:229
> #29 0x00007ffff6fe5b5e in (anonymous namespace)::ServiceManager::disposing (this=0x7fffe6a02208) at lo/core/cppuhelper/source/defaultbootstrap.cxx:1369
> #30 0x00007ffff70258ba in cppu::WeakComponentImplHelperBase::dispose (this=0x7fffe6a02208) at lo/core/cppuhelper/source/implbase.cxx:268
> #31 0x00007ffff701b860 in cppu::WeakComponentImplHelper8<com::sun::star::lang::XServiceInfo, com::sun::star::lang::XMultiServiceFactory, com::sun::star::lang::XMultiComponentFactory, com::sun::star::container::XSet, com::sun::star::container::XContentEnumerationAccess, com::sun::star::beans::XPropertySet, com::sun::star::beans::XPropertySetInfo, com::sun::star::lang::XEventListener>::dispose (this=0x7fffe6a02208) at lo/core/solver/unxlngx6/inc/cppuhelper/compbase8.hxx:66
> #32 0x00007ffff6fc8e95 in cppu::try_dispose (xInstance=uno::Reference to {_vptr.XInterface = 0x7ffff7306308}) at lo/core/cppuhelper/source/component_context.cxx:276
> #33 0x00007ffff6fcb47a in cppu::ComponentContext::disposing (this=0x7fffe69dd858) at lo/core/cppuhelper/source/component_context.cxx:745
> #34 0x00007ffff70258ba in cppu::WeakComponentImplHelperBase::dispose (this=0x7fffe69dd858) at lo/core/cppuhelper/source/implbase.cxx:268
> #35 0x00007ffff6fda10e in cppu::WeakComponentImplHelper2<com::sun::star::uno::XComponentContext, com::sun::star::container::XNameContainer>::dispose (this=0x7fffe69dd858) at lo/core/solver/unxlngx6/inc/cppuhelper/compbase2.hxx:66
> #36 0x00007ffff7a89459 in desktop::Desktop::DeInit (this=0x7fffffffe430) at lo/core/desktop/source/app/app.cxx:627
> #37 0x00007ffff32f1f31 in DeInitVCL () at lo/core/vcl/source/app/svmain.cxx:494
> #38 0x00007ffff32f119b in ImplSVMain () at lo/core/vcl/source/app/svmain.cxx:186
> #39 0x00007ffff32f11f8 in SVMain () at lo/core/vcl/source/app/svmain.cxx:199
> #40 0x00007ffff7acdccb in soffice_main () at lo/core/desktop/source/app/sofficemain.cxx:74
> #41 0x0000000000400948 in sal_main () at lo/core/desktop/source/app/main.c:48
> #42 0x0000000000400929 in main (argc=1, argv=0x7fffffffe618) at lo/core/desktop/source/app/main.c:47

As ODatabaseContext is a single-instance implementation (see use of cppu::createOneInstanceComponentFactory in dbaccess/soruce/misc/services.cxx), it is only disposed when the global service manager is disposed, but after the global service manager has cleaned its tables so that it no longer provides any services.

So either ODatabaseContext should not do substantial work during dispose (which is best not to do, anyway) or should be changed to destroy implementation(s) as soon as they are no longer referenced by client code (i.e., not use cppu::createOneInstanceComponentFactory).
Comment 1 Rich R 2014-08-14 18:57:54 UTC
I installed via apt, so not sure how to do that.  Should I try installing a downloaded version instead?
Comment 2 Rich R 2014-08-14 19:16:58 UTC Comment hidden (off-topic)
Comment 3 Rich R 2014-08-14 19:17:54 UTC Comment hidden (off-topic)
Comment 4 Alex Thurgood 2015-01-03 17:39:27 UTC Comment hidden (no-value)
Comment 5 QA Administrators 2016-01-17 20:04:45 UTC Comment hidden (obsolete)
Comment 6 Julien Nabet 2016-12-20 18:54:58 UTC
*** Bug 101734 has been marked as a duplicate of this bug. ***
Comment 7 Alex Thurgood 2016-12-21 11:23:16 UTC
So, confirming that this is still an issue with current master build
Comment 8 QA Administrators 2017-12-22 03:35:17 UTC Comment hidden (obsolete)
Comment 9 Julien Nabet 2018-01-27 22:33:38 UTC
Just to respond to QA Admin message, on pc Debian x86-64 with master sources updated today, I could reproduce this.

(now the file services.cxx is in dbaccess/source/core/misc)
Comment 10 QA Administrators 2019-01-28 03:42:21 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug