Bug 96703 - Exceptions com.sun.star.lang.NotInitializedException when opening odb file
Summary: Exceptions com.sun.star.lang.NotInitializedException when opening odb file
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.0.0 target:5.4.2
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-24 00:14 UTC by Julien Nabet
Modified: 2017-09-15 10:38 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with debug symbols (5.70 KB, text/plain)
2015-12-24 00:17 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Nabet 2015-12-24 00:14:39 UTC
On pc Debian x86-64 with master sources updated today, I got these exceptions when just opening simple odb file (hsqldb):
warn:legacy.osl:3848:1:xmloff/source/core/xmlimp.cxx:938: caught an exception!
in function:virtual void SvXMLImport::setTargetDocument(const com::sun::star::uno::Reference<com::sun::star::lang::XComponent>&)
type: com.sun.star.lang.NotInitializedException
context: N8dbaccess17ODatabaseDocumentE

warn:xmloff.core:3848:1:xmloff/source/core/xmlimp.cxx:936: exception caught
TODO Exception 
warn:legacy.osl:3848:1:xmloff/source/core/xmlimp.cxx:938: caught an exception!
in function:virtual void SvXMLImport::setTargetDocument(const com::sun::star::uno::Reference<com::sun::star::lang::XComponent>&)
type: com.sun.star.lang.NotInitializedException
context: N8dbaccess17ODatabaseDocumentE

It's quite old, see http://nabble.documentfoundation.org/crash-course-in-unittests-td4068590.html#a4068683
Comment 1 Julien Nabet 2015-12-24 00:17:30 UTC
Created attachment 121525 [details]
bt with debug symbols

This bt seems to show the root cause.
At this moment, we're at the initializing, we're not initialized yet.
Comment 2 Julien Nabet 2015-12-24 00:27:19 UTC
Lionel: thought you might be interested in this one.
I wonder if the init problem could trigger tdf#96625.
Considering http://cgit.freedesktop.org/libreoffice/core/commit/?id=48a697ef1c123812c47e7e7c33688ca2b2c5e93a + bt attached, perhaps "getDocumentStorage" should use "DocumentGuard::MethodUsedDuringInit" instead of "DocumentGuard::DefaultMethod"? (see http://opengrok.libreoffice.org/xref/core/dbaccess/source/core/dataaccess/databasedocument.cxx#1963)
Comment 3 Alex Thurgood 2015-12-24 07:52:25 UTC
Yes, been seeing this for ages now, or so it seems.

Confirming
Comment 4 Alex Thurgood 2015-12-24 07:57:05 UTC
See also :

bug 69406 where I reported this same exception, unrelated to the bug in question, but neverthelesss already present in 4.2
Comment 5 Alex Thurgood 2015-12-24 07:59:11 UTC
You also noticed this in bug 69091, and that was already in relation to LO 3.5
Comment 6 Alex Thurgood 2015-12-24 08:01:16 UTC
And I mentioned it again in bug 79203, but as I couldn't attribute this exception any particular weird behaviour, I closed as WFM.
Comment 7 Julien Nabet 2016-06-18 08:22:38 UTC
With master sources updated yesterday, I could still reproduce this.


Caolán: noticing this https://cgit.freedesktop.org/libreoffice/core/commit/?id=48a697ef1c123812c47e7e7c33688ca2b2c5e93a, thought you might have some idea here.
Indeed even if it doesn't seem to trigger wrong behaviour, it'd be a good thing to avoid these warnings.
Comment 8 Julien Nabet 2017-06-05 19:16:23 UTC
Just to give an update, I still reproduce this on master sources updated today.
warn:xmloff.core:32753:1:xmloff/source/core/xmlimp.cxx:947: exception caught
warn:legacy.osl:32753:1:xmloff/source/core/xmlimp.cxx:948: DBG_UNHANDLED_EXCEPTION in virtual void SvXMLImport::setTargetDocument(const com::sun::star::uno::Reference<com::sun::star::lang::XComponent>&)
    type: com.sun.star.lang.NotInitializedException
    context: N8dbaccess17ODatabaseDocumentE
Comment 9 Julien Nabet 2017-08-21 08:25:41 UTC
Since I build with enable-dbgutil, are there any useful information I could provide to help to tackle this one?
(I wonder too if it could trigger some other bugs)
Comment 10 Caolán McNamara 2017-08-28 19:49:58 UTC
my hackery there with https://cgit.freedesktop.org/libreoffice/core/commit/?id=48a697ef1c123812c47e7e7c33688ca2b2c5e93a is just to give coverity specific methods each of which throw different exceptions depending on which is called, instead of one method which throws different exceptions depending on a conditional argument so that coverity exception specification checker can better see which exceptions can really be thrown. So nothing really changed there and I've no special insight into the noisy spew in dbaccess
Comment 11 Commit Notification 2017-09-02 16:09:54 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

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

tdf#96703: getDocumentStorage is called during initialization

It will be available in 6.0.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 12 Alex Thurgood 2017-09-05 09:42:41 UTC
Confirming resolved in my master build

Version: 6.0.0.0.alpha0+
Build ID: 595371e520ce4f64ad9d99a7866bdb8404271b6e
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group
Comment 13 Commit Notification 2017-09-15 10:38:43 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4f269f8c8965be157e0584ead84a65347d8b6b69&h=libreoffice-5-4

tdf#96703: getDocumentStorage is called during initialization

It will be available in 5.4.2.

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.