Bug 51685 - crash on start / duplicate component registration issue ...
Summary: crash on start / duplicate component registration issue ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium blocker
Assignee: Not Assigned
URL:
Whiteboard: (target:3.6.0)
Keywords:
Depends on:
Blocks: 43489 mab3.6
  Show dependency treegraph
 
Reported: 2012-07-03 03:21 UTC by Michael Meeks
Modified: 2012-08-03 09:39 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
~/.config/libreoffice/3 (776.22 KB, application/x-compressed-tar)
2012-07-03 03:26 UTC, Michael Meeks
Details
DeploymentException (228.78 KB, application/zip)
2012-07-17 08:11 UTC, István Túri
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2012-07-03 03:21:53 UTC
It seems a tad unfortunate that we crash on start without any warning message at all explaining that :-) [ makes it hard to debug too ].

#0  0xb7c8b8c5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0xb7c8d1d5 in __GI_abort () at abort.c:93
#2  0xb7eca81d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6
#3  0xb7ec85b3 in ?? () from /usr/lib/libstdc++.so.6
#4  0xb7ec85ef in std::terminate() () from /usr/lib/libstdc++.so.6
#5  0xb7ec8794 in __cxa_rethrow () from /usr/lib/libstdc++.so.6
#6  0xb7f39c92 in desktop::Desktop::ensureProcessServiceFactory () at /data/opt/libreoffice/master/desktop/source/app/app.cxx:718
#7  0xb7f39cb3 in desktop::Desktop::GetCommandLineArgs () at /data/opt/libreoffice/master/desktop/source/app/app.cxx:278
#8  0xb7f590a7 in soffice_main () at /data/opt/libreoffice/master/desktop/source/app/sofficemain.cxx:61
#9  0x0804852c in sal_main () at /data/opt/libreoffice/master/desktop/source/app/main.c:25
#10 main (argc=Cannot access memory at address 0x5620
) at /data/opt/libreoffice/master/desktop/source/app/main.c:24

This appears to come ultimately from:

Breakpoint 3, 0xb7ec86d0 in __cxa_throw () from /usr/lib/libstdc++.so.6
(gdb) bt
#0  0xb7ec86d0 in __cxa_throw () from /usr/lib/libstdc++.so.6
#1  0xb7a46d61 in handleImplementation (this=0xbfffe9ac) at /data/opt/libreoffice/master/cppuhelper/source/defaultbootstrap.cxx:478
#2  (anonymous namespace)::Parser::Parser (this=0xbfffe9ac, uri=<optimized out>, alienContext=empty uno::Reference, data=0x8067f00)
    at /data/opt/libreoffice/master/cppuhelper/source/defaultbootstrap.cxx:332
#3  0xb7a48c76 in (anonymous namespace)::ServiceManager::readRdbFile (this=0x8067eb0, 
    uri="file:///data/opt/OOInstall/program/../share/extensions/pdfimport/components.rdb", optional=true)
    at /data/opt/libreoffice/master/cppuhelper/source/defaultbootstrap.cxx:1442
#4  0xb7a49934 in readRdbs (
    uris="file:///data/opt/OOInstall/ure/lib/../share/misc/services.rdb ?file:///etc/opt/ure/services.rdb ?file:///home/michael/.ure/services.rdb   ?file:///home/michael/.config/libreoffice/3/user/extensions/bu"..., this=0x8067eb0)
    at /data/opt/libreoffice/master/cppuhelper/source/defaultbootstrap.cxx:1408
#5  ServiceManager (
    rdbUris="file:///data/opt/OOInstall/ure/lib/../share/misc/services.rdb ?file:///etc/opt/ure/services.rdb ?file:///home/michael/.ure/services.rdb   ?file:///home/michael/.config/libreoffice/3/user/extensions/bu"..., this=0x8067eb0)
    at /data/opt/libreoffice/master/cppuhelper/source/defaultbootstrap.cxx:593
#6  bootstrapComponentContext (bootstrap=..., 
    serviceUris="file:///data/opt/OOInstall/ure/lib/../share/misc/services.rdb ?file:///etc/opt/ure/services.rdb ?file:///home/michael/.ure/services.rdb   ?file:///home/michael/.config/libreoffice/3/user/extensions/bu"..., typeRegistry=
    uno::Reference to {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0xb40d10b0}, <No data fields>})
    at /data/opt/libreoffice/master/cppuhelper/source/defaultbootstrap.cxx:1989
#7  cppu::defaultBootstrap_InitialComponentContext (iniUri="file:///data/opt/OOInstall/ure/lib/unorc")
    at /data/opt/libreoffice/master/cppuhelper/source/defaultbootstrap.cxx:2193
#8  0xb7a4a22a in cppu::defaultBootstrap_InitialComponentContext () at /data/opt/libreoffice/master/cppuhelper/source/defaultbootstrap.cxx:2200
#9  0xb7f48c68 in desktop::Desktop::CreateApplicationServiceManager () at /data/opt/libreoffice/master/desktop/source/app/appinit.cxx:177
#10 0xb7f39c3b in desktop::Desktop::ensureProcessServiceFactory () at /data/opt/libreoffice/master/desktop/source/app/app.cxx:711
#11 0xb7f39cb3 in desktop::Desktop::GetCommandLineArgs () at /data/opt/libreoffice/master/desktop/source/app/app.cxx:278
#12 0xb7f590a7 in soffice_main () at /data/opt/libreoffice/master/desktop/source/app/sofficemain.cxx:61
#13 0x0804852c in sal_main () at /data/opt/libreoffice/master/desktop/source/app/main.c:25
#14 main (argc=134698896, argv=0x0) at /data/opt/libreoffice/master/desktop/source/app/main.c:24
(gdb) up
#1  0xb7a46d61 in handleImplementation (this=0xbfffe9ac) at /data/opt/libreoffice/master/cppuhelper/source/defaultbootstrap.cxx:478
478	            css::uno::Reference< css::uno::XInterface >());
(gdb) l
473	        second)
474	    {
475	        throw css::registry::InvalidRegistryException(
476	            (reader_.getUrl() + ": duplicate <implementation name=\""
477	             + attrImplementation_ + "\">"),
478	            css::uno::Reference< css::uno::XInterface >());
479	    }
480	}
481	
482	void Parser::handleService() {
(gdb) p reader_.getUrl()
$3 = "file:///data/opt/OOInstall/program/../share/extensions/pdfimport/components.rdb"
(gdb) p attrImplementation_ 
$4 = "com.sun.star.comp.documents.HybridPDFImport"

I was amazed tracing the exceptions through here that we go looking for trouble (and creating directories) in ~/.ure - why ? and /etc/opt/ure/ and other apparently unhinged locations ;-)

Anyhow - it seems the problem is a change of status of the HybridPDFImport - I attach my ~/.config/libreoffice/3-suse/ directory which contains:

3-suse/user/extensions/bundled/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/backenddb.xml:
...
<comp:component url="vnd.sun.star.expand:$BUNDLED_EXTENSIONS/pdfimport/pdfimport.uno.so"><comp:java-type-library>false</comp:java-type-library><comp:implementation-names><comp:name>com.sun.star.comp.documents.DrawPDFImport</comp:name><comp:name>com.sun.star.comp.documents.WriterPDFImport</comp:name><comp:name>com.sun.star.comp.documents.ImpressPDFImport</comp:name><comp:name>com.sun.star.comp.documents.HybridPDFImport</comp:name><comp:name>com.sun.star.comp.documents.PDFDetector</comp:name></comp:implementation-names></comp:component><comp:component url="vnd.sun...

As does:

share/extensions/pdfimport/components.rdb:<components xmlns="http://openoffice.org/2010/uno-components"><component loader="com.sun.star.loader.SharedLibrary" uri="./pdfimport.uno.so"><implementation name="com.sun.star.comp.documents.HybridPDFImport"><service name="com.sun.star.document.ImportFilter"/></implementation><implementation name="com.sun.star.comp.documents.WriterPDFImport"><service name="com.sun.star.document.ImportFilter"/></implementation><implementation name="com.sun.star.comp.documents.DrawPDFImport"><service name="com.sun.star.document.ImportFilter"/></implementation><implementation name="com.sun.star.comp.documents.ImpressPDFImport"><service name="com.sun.star.document.ImportFilter"/></implementation><implementation name="com.sun.star.comp.documents.PDFDetector"><service name="com.sun.star.document.ImportFilter"/></implementation></component></components>


Which presumably explains the crash-on-start. This is with a master build from:

commit 3b59ee9402bd0d32cd1036c90ecf457df06b28e8
Author: Philipp Riemer <ruderphilipp@gmail.com>
Date:   Sat Jun 30 22:36:59 2012 +0200

Just built today.

Is this an artifact of migration ? or of the new component registration code ? or ...
Comment 1 Michael Meeks 2012-07-03 03:26:01 UTC
Created attachment 63757 [details]
~/.config/libreoffice/3

I guess we badly need some migration regression tests with odd / canned setups that people can have :-)
Comment 2 Michael Meeks 2012-07-03 03:27:04 UTC
removing the profile makes it work; but I fear this is in 3.6 as well ...
Comment 3 Jean-Baptiste Faure 2012-07-10 11:00:03 UTC
No link with bug 43989 ?

Best regards. JBF
Comment 4 Stephan Bergmann 2012-07-12 08:00:56 UTC
(In reply to comment #0)
> I was amazed tracing the exceptions through here that we go looking for trouble
> (and creating directories) in ~/.ure - why ? and /etc/opt/ure/ and other
> apparently unhinged locations ;-)

Originates from making URE standalone, cf. ure/source/README.
Comment 5 Stephan Bergmann 2012-07-12 08:55:55 UTC
UserInstallation's user/extensions/bundled/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/backenddb.xml contains information about bundled extensions that still use active component registration.

When an extension is switched from active to passive component registration, it is important that its version is bumped.  (Otherwise, LO's extension mgr logic would not detect that it needs to regenerate per-user extension information at start up, which could lead to old, active-registration data for an extension's component co-existing with new, passive-registration data, which in turn could lead to the "duplicate <implementation name" exception at start up.)

The pdfimport extension had been changed to passive component registration (but erroneously without bumping its version), and later on its version has been bumped (from 1.0.5 to 1.0.6) with <http://cgit.freedesktop.org/libreoffice/core/commit/?id=de562138eabd3ee3ecab28e5d1348a3fee7301e0> "Bump extension versions after changing to passive registration."

If your existing UserInstallation has ever been produced/modified by some "interim" developer build (instead of an "official" build, where it is known that none of them can lead to these inconsistencies), it can have become inconsistent to a point where only manually removing the UserInstallation's user/extensions/bundled directory can fix this, see <http://lists.freedesktop.org/archives/libreoffice/2012-April/030728.html> "Weird runtime error."  However, this should not happen to ordinary end users (who only ever installed "official" builds).
Comment 6 Stephan Bergmann 2012-07-12 10:06:55 UTC
For the record, we indeed appear to be safe with regard to all combinations of having a single extension installed both bundled and per-user (which could potentially lead to such duplicate implementation name exceptions).  On a recent LO master build (that includes at least mysql-connector-ooo.oxt and pdfimporter.oxt as bundled extensions):

$ rm -rf ~/.config/libreoffice/
$ mv solver/unxlngx6/installation/opt/share/extensions solver/unxlngx6/installation/opt/share/extensions-HIDDEN
$ solver/unxlngx6/installation/opt/program/soffice solver/unxlngx6/bin/mysql-connector-ooo.oxt # 1.0.1, using active registration; accept to install per-user
$ mv solver/unxlngx6/installation/opt/share/extensions-HIDDEN solver/unxlngx6/installation/opt/share/extensions
$ touch solver/unxlngx6/installation/opt/share/extensions
$ solver/unxlngx6/installation/opt/program/soffice
...
Exited with code '81'
oosplash: re-start with all params !
...

$ rm -rf ~/.config/libreoffice/
$ mv solver/unxlngx6/installation/opt/share/extensions solver/unxlngx6/installation/opt/share/extensions-HIDDEN
# manually change solver/unxlngx6/bin/mysql-connector-ooo.oxt:description.xml <version> to 1.0.0
$ solver/unxlngx6/installation/opt/program/soffice solver/unxlngx6/bin/mysql-connector-ooo.oxt # accept to install per-user
$ mv solver/unxlngx6/installation/opt/share/extensions-HIDDEN solver/unxlngx6/installation/opt/share/extensions
$ touch solver/unxlngx6/installation/opt/share/extensions
$ solver/unxlngx6/installation/opt/program/soffice
...
Exited with code '81'
oosplash: re-start with all params !
...

$ rm -rf ~/.config/libreoffice/
$ mv solver/unxlngx6/installation/opt/share/extensions solver/unxlngx6/installation/opt/share/extensions-HIDDEN
# manually change solver/unxlngx6/bin/mysql-connector-ooo.oxt:description.xml <version> to 1.0.2
$ solver/unxlngx6/installation/opt/program/soffice solver/unxlngx6/bin/mysql-connector-ooo.oxt # accept to install per-user
$ mv solver/unxlngx6/installation/opt/share/extensions-HIDDEN solver/unxlngx6/installation/opt/share/extensions
$ touch solver/unxlngx6/installation/opt/share/extensions
$ solver/unxlngx6/installation/opt/program/soffice
...
Exited with code '81'
oosplash: re-start with all params !
...

$ rm -rf ~/.config/libreoffice/
$ mv solver/unxlngx6/installation/opt/share/extensions solver/unxlngx6/installation/opt/share/extensions-HIDDEN
$ solver/unxlngx6/installation/opt/program/soffice solver/unxlngx6/bin/pdfimport.oxt # 1.0.6, using passive registration; accept to install per-user
$ mv solver/unxlngx6/installation/opt/share/extensions-HIDDEN solver/unxlngx6/installation/opt/share/extensions
$ touch solver/unxlngx6/installation/opt/share/extensions
$ solver/unxlngx6/installation/opt/program/soffice
...
Exited with code '81'
oosplash: re-start with all params !
...

$ rm -rf ~/.config/libreoffice/
$ mv solver/unxlngx6/installation/opt/share/extensions solver/unxlngx6/installation/opt/share/extensions-HIDDEN
# manually change solver/unxlngx6/bin/pdfimport.oxt:description.xml <version> to 1.0.5
$ solver/unxlngx6/installation/opt/program/soffice solver/unxlngx6/bin/pdfimport.oxt # accept to install per-user
$ mv solver/unxlngx6/installation/opt/share/extensions-HIDDEN solver/unxlngx6/installation/opt/share/extensions
$ touch solver/unxlngx6/installation/opt/share/extensions
$ solver/unxlngx6/installation/opt/program/soffice
...
Exited with code '81'
oosplash: re-start with all params !
...

$ rm -rf ~/.config/libreoffice/
$ mv solver/unxlngx6/installation/opt/share/extensions solver/unxlngx6/installation/opt/share/extensions-HIDDEN
# manually change solver/unxlngx6/bin/pdfimport.oxt:description.xml <version> to 1.0.7
$ solver/unxlngx6/installation/opt/program/soffice solver/unxlngx6/bin/pdfimport.oxt # accept to install per-user
$ mv solver/unxlngx6/installation/opt/share/extensions-HIDDEN solver/unxlngx6/installation/opt/share/extensions
$ touch solver/unxlngx6/installation/opt/share/extensions
$ solver/unxlngx6/installation/opt/program/soffice
...
Exited with code '81'
oosplash: re-start with all params !
...

$ rm -rf ~/.config/libreoffice/
$ mv solver/unxlngx6/installation/opt/share/extensions solver/unxlngx6/installation/opt/share/extensions-HIDDEN
$ solver/unxlngx6/installation/opt/program/soffice ~/lo3.4/pdfimport.oxt # 1.0.5, still using active registration; accept to install per-user
$ mv solver/unxlngx6/installation/opt/share/extensions-HIDDEN solver/unxlngx6/installation/opt/share/extensions
$ touch solver/unxlngx6/installation/opt/share/extensions
$ solver/unxlngx6/installation/opt/program/soffice
...
Exited with code '81'
oosplash: re-start with all params !
...
Comment 7 Michael Meeks 2012-07-12 13:16:28 UTC
great ! thanks for that Stephan :-)
Comment 8 István Túri 2012-07-17 08:11:00 UTC
Created attachment 64299 [details]
DeploymentException

a UNO Exception from git/solver/unxlngi6.pro/installation/opt/program/../share/extensions/script-provider-for-python/components.rdb
Comment 9 Michael Meeks 2012-07-17 09:22:19 UTC
István: this should have been fixed in RC1 (I believe) - are you still seeing the issue there with your profile ?
Comment 10 Stephan Bergmann 2012-07-17 09:38:36 UTC
(In reply to comment #9)
> István: this should have been fixed in RC1 (I believe) - are you still seeing
> the issue there with your profile ?

I was discussing István's problem with him on IRC and he had no other easy way to make available his UserInstallation than to add it to this issue.  Quoting #libreoffice-dev: "sberg> pista, your ~/.config/libreoffice/3/user information about bundled extensions has somehow become inconsistent, and I would *love* to assume that it is 'merely' due to the specific repo snapshots you happened to create builds from, see the last paragraph of <https://bugs.freedesktop.org/show_bug.cgi?id=51685#c5>"
Comment 11 Stephan Bergmann 2012-07-26 11:31:47 UTC
(In reply to comment #6)
> For the record, we indeed appear to be safe with regard to all combinations of
> having a single extension installed both bundled and per-user (which could
> potentially lead to such duplicate implementation name exceptions).  On a
> recent LO master build (that includes at least mysql-connector-ooo.oxt and
> pdfimporter.oxt as bundled extensions):

...and that experiment, it turns out, was useless, as I used a "make dev-install" build w/o share/prereg/bundled, see <https://bugs.freedesktop.org/show_bug.cgi?id=51252#c35>.
Comment 12 Rainer Bielefeld Retired 2012-08-03 04:33:34 UTC
@Stephan, @Michael:
Please check my assumption concerning target and correct it if necessary. We need correct target information for automatically generated lists for release notes (Remaining Problems ...)
Comment 13 Stephan Bergmann 2012-08-03 09:39:11 UTC
(In reply to comment #12)
> Please check my assumption concerning target and correct it if necessary.

I think we can still consider this specific issue fixed with target:3.6.0.  For the regressions caused by the overall fixing in this area see issue 53006, esp. <https://bugs.freedesktop.org/show_bug.cgi?id=53006#c14>.