Bug 1079744

Summary: unoil.jar does not contain any content in LibreOffice 5.4.4.2 update
Product: [openSUSE] openSUSE Distribution Reporter: Ulrich Windl <Ulrich.Windl>
Component: LibreOfficeAssignee: Tomáš Chvátal <tchvatal>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: astieger, cluster15, maint-coord, mschnitzer, Ulrich.Windl, wbauer
Version: Leap 42.3   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 42.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: strace of LibreOffice Writer start causing Java exception

Description Ulrich Windl 2018-02-07 07:25:26 UTC
After installing the LO Upgrade 5.3 -> 5.4 (libreoffice-5.4.4.2-12.6.x86_64), a Java exception was thrown on the first start:
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: com/sun/star/loader/XImplementationLoader
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Caused by: java.lang.ClassNotFoundException: com.sun.star.loader.XImplementationLoader
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 11 more
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: com/sun/star/loader/XImplementationLoader
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Caused by: java.lang.ClassNotFoundException: com.sun.star.loader.XImplementationLoader
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 11 more

The system has Java 1.8.0_151 and 1.7.0_161 installed, and it's not obvious from LO settings which JRE is being used. In a terminal "java -version" prints:
OpenJDK Runtime Environment (IcedTea 3.6.0) (build 1.8.0_151-b12 suse-18.1-x86_64)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
Comment 1 Tomáš Chvátal 2018-02-07 09:02:56 UTC
You can try to run it in gdb and trace it to see why it crashed... without core this is not possible to determine what happened and what needs to be fixed.
Comment 2 Ulrich Windl 2018-02-07 10:20:24 UTC
Created attachment 759211 [details]
strace of LibreOffice Writer start causing Java exception

(In reply to Tomáš Chvátal from comment #1)
> You can try to run it in gdb and trace it to see why it crashed... without
> core this is not possible to determine what happened and what needs to be
> fixed.

"it" being LO Writer did NOT crash. Not even sure anything crashed, but I see the exception stack trace every time I launch Writer. So I guess it's either a problem with IcedTea not being Oracle Java, or some packaging issue, or compatibility, etc.

The gdb thing suggested probably won't work either, as "oowriter" is a shell script calling `/usr/lib64/libreoffice/program/soffice --writer "$@"':
> file /usr/bin/oowriter
/usr/bin/oowriter: POSIX shell script, ASCII text executable

/usr/lib64/libreoffice/program/soffice in turn is another shell script:
usr/lib64/libreoffice/program/soffice: POSIX shell script, ASCII text executable

So I hacked the latter script to inject an strace (not GDB).
Comment 3 Tomáš Chvátal 2018-02-07 12:30:34 UTC
please check that files in /usr/lib64/libreoffice/program/classes/* have real content or just dump ls -laF output here
Comment 4 Ulrich Windl 2018-02-07 13:20:54 UTC
(In reply to Tomáš Chvátal from comment #3)
They all look like valid JAR files:
> file /usr/lib64/libreoffice/program/classes/*
/usr/lib64/libreoffice/program/classes/commonwizards.jar:               Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/form.jar:                        Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/hsqldb.jar:                      Zip archive data, at least v1.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/java_uno.jar:                    Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/js.jar:                          Zip archive data, at least v1.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/juh.jar:                         Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/jurt.jar:                        Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/query.jar:                       Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/reportbuilder.jar:               Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/reportbuilderwizard.jar:         Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/report.jar:                      Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/ridl.jar:                        Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/ScriptFramework.jar:             Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/ScriptProviderForJava.jar:       Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/ScriptProviderForJavaScript.jar: Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/sdbc_hsqldb.jar:                 Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/smoketest.jar:                   Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/table.jar:                       Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/unoil.jar:                       Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/unoloader.jar:                   Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/XMergeBridge.jar:                Zip archive data, at least v2.0 to extract Java archive data (JAR)
/usr/lib64/libreoffice/program/classes/xmerge.jar:                      Zip archive data, at least v2.0 to extract Java archive data (JAR)
Comment 5 Tomáš Chvátal 2018-02-07 13:30:19 UTC
If there is at least META-INF folder with MANIFEST.MF file it is valid jar, thats why I asked if they have reasonable size... anything bigger than couple hundred bytes...
Comment 6 Tomáš Chvátal 2018-02-12 12:19:42 UTC
Working unoil needs to be over 1MB size:
scarabeus@bugaboo: /usr/lib64/libreoffice/program/classes $ ls -la |grep unoil
-rw-r--r-- 1 root root 1,7M  9. úno 20.11 unoil.jar

@maint-coord: any idea what is wrong? in the devel project where I test stuff it works just fine:

https://build.opensuse.org/project/monitor/LibreOffice:5.4
Comment 7 Marcus Meissner 2018-02-12 13:06:38 UTC
I can confirm that it is so small in the built rpm in openSUSE:Maintenance:7521/libreoffice.openSUSE_Leap_42.3_Update

there are no errormessages related to unoil in the buildlog.
Comment 8 Tomáš Chvátal 2018-02-12 14:34:53 UTC
(In reply to Marcus Meissner from comment #7)
> I can confirm that it is so small in the built rpm in
> openSUSE:Maintenance:7521/libreoffice.openSUSE_Leap_42.3_Update
> 
> there are no errormessages related to unoil in the buildlog.

It is even weirder, it works fine on the install phase but breaks up on the %check phase, probably some errornous regeneration, but still it should not alter the %buildroot path no?
Comment 9 Stefan Münkner 2018-02-13 12:18:05 UTC
sorry, coming from via different route, I reopened an older bug, specifying that unoil.jar only contains MANIFEST.MF.

The empty unoil.jar breaks report generation in base completely.

Using the jars in /usr/lib64/libreoffice/program/classes/ from the previous version 5.3.5.2-3.4 fixes the error. Just replacing unoil.jar did not work.
Comment 10 Wolfgang Bauer 2018-02-13 13:15:02 UTC
(In reply to Stefan Münkner from comment #9)
> Using the jars in /usr/lib64/libreoffice/program/classes/ from the previous
> version 5.3.5.2-3.4 fixes the error. Just replacing unoil.jar did not work.

Yes, ridl.jar is again incomplete as well.

The situation seems to be exactly the same as in 13.2 3 years ago (bug#913042) ...
And has been mentioned, the package in LibreOffice:5.4 is fine as well too, the problem again only exists in the update repo.
Comment 11 Tomáš Chvátal 2018-02-13 14:13:30 UTC
(In reply to Wolfgang Bauer from comment #10)
> (In reply to Stefan Münkner from comment #9)
> > Using the jars in /usr/lib64/libreoffice/program/classes/ from the previous
> > version 5.3.5.2-3.4 fixes the error. Just replacing unoil.jar did not work.
> 
> Yes, ridl.jar is again incomplete as well.
> 
> The situation seems to be exactly the same as in 13.2 3 years ago
> (bug#913042) ...
> And has been mentioned, the package in LibreOffice:5.4 is fine as well too,
> the problem again only exists in the update repo.

Weird problem is that if we do not run %check phase the unoil.jar and others are fine... :/
Comment 12 Wolfgang Bauer 2018-02-13 14:29:21 UTC
(In reply to Tomáš Chvátal from comment #11)
> Weird problem is that if we do not run %check phase the unoil.jar and others
> are fine... :/

IIRC, that was the problem 3 years ago as well, wasn't it?
This was the "fix" back then:
--- libreoffice.spec (revision 1)
+++ libreoffice.spec (revision 1)
@@ -1013,11 +1013,9 @@
 sed -i -e "s|@INSTALLDIR@|%{_libdir}/%{name}|" pyuno/source/module/uno.py scripting/source/pyprov/officehelper.py
 
 # just call make here as we added the jobs in configure
+# The check phase is run here too if it is split with nocheck
+# install of jars get broken sometimes
+make VERBOSE=true
-make build-nocheck
-
-%check
-make unitcheck
-make slowcheck
 
 %install
 make DESTDIR=%{buildroot} distro-pack-install

Just mentioning...
Comment 13 Tomáš Chvátal 2018-02-13 14:35:43 UTC
(In reply to Wolfgang Bauer from comment #12)
> (In reply to Tomáš Chvátal from comment #11)
> > Weird problem is that if we do not run %check phase the unoil.jar and others
> > are fine... :/
> 
> IIRC, that was the problem 3 years ago as well, wasn't it?
> This was the "fix" back then:
> --- libreoffice.spec (revision 1)
> +++ libreoffice.spec (revision 1)
> @@ -1013,11 +1013,9 @@
>  sed -i -e "s|@INSTALLDIR@|%{_libdir}/%{name}|" pyuno/source/module/uno.py
> scripting/source/pyprov/officehelper.py
>  
>  # just call make here as we added the jobs in configure
> +# The check phase is run here too if it is split with nocheck
> +# install of jars get broken sometimes
> +make VERBOSE=true
> -make build-nocheck
> -
> -%check
> -make unitcheck
> -make slowcheck
>  
>  %install
>  make DESTDIR=%{buildroot} distro-pack-install
> 
> Just mentioning...

Yep, but the problem now is we build the tests conditionally and only on 64b intel, that means this would not solve it this time.
Comment 14 Wolfgang Bauer 2018-02-13 15:28:28 UTC
(In reply to Tomáš Chvátal from comment #13)
> Yep, but the problem now is we build the tests conditionally and only on 64b
> intel, that means this would not solve it this time.

Hm, maybe this would work?

+%ifarch x86_64
+make
+%else
 make build-nocheck
+%endif

-%check
-# Run tests only on 64b intel as they are resource hogs
-%ifarch x86_64
-make 
-%endif

AIUI, that should still run the tests on x86_64, just in %build instead of %check...
Comment 15 Ulrich Windl 2018-02-14 08:43:41 UTC
On comments 12, 13, and 14: Wouldn't it be preferable to to fix the check instead of disabling it?
Comment 16 Ulrich Windl 2018-02-15 07:18:35 UTC
Sadly the bug is still present after security update to libreoffice-5.4.5.1-15.1.x86_64.
Comment 17 Wolfgang Bauer 2018-02-17 03:35:09 UTC
(In reply to Ulrich Windl from comment #15)
> On comments 12, 13, and 14: Wouldn't it be preferable to to fix the check
> instead of disabling it?

Please read those comments again.

In particular, changing "make build-nocheck" to just "make" should actually *enable* to run the tests...

AFAICT, the problem only occurs when running the tests separately from the build phase.
But strange enough, only in the Update repo.

That said, maybe it relates now to the new compile options in Leap:42.3:Update?
Comment 18 Ulrich Windl 2018-02-19 11:21:47 UTC
(In reply to Wolfgang Bauer from comment #17)
> Please read those comments again.

You are right: I was confused, obviously. Sorry.
Comment 19 Wolfgang Bauer 2018-03-02 18:42:51 UTC
*** Bug 1083320 has been marked as a duplicate of this bug. ***
Comment 21 Tomáš Chvátal 2018-07-02 10:28:00 UTC
I've figured out a workaround and since nobody knows the real fix, this will be working on 6.1+ releases as it should.
Comment 22 Swamp Workflow Management 2018-10-31 12:30:06 UTC
This is an autogenerated message for OBS integration:
This bug (1079744) was mentioned in
https://build.opensuse.org/request/show/645726 Factory / libreoffice
Comment 25 Swamp Workflow Management 2019-02-28 20:15:03 UTC
SUSE-RU-2019:0520-1: An update that has 13 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1079744,1088266,1095755,1107012,1110345,1110348,1112112,1112113,1112114,1117195,1117300,1124658,882383
CVE References: 
Sources used:
SUSE Linux Enterprise Workstation Extension 12-SP4 (src):    libreoffice-6.1.5.2-43.44.3
SUSE Linux Enterprise Workstation Extension 12-SP3 (src):    libreoffice-6.1.5.2-43.44.3
SUSE Linux Enterprise Software Development Kit 12-SP4 (src):    libreoffice-6.1.5.2-43.44.3
SUSE Linux Enterprise Software Development Kit 12-SP3 (src):    libreoffice-6.1.5.2-43.44.3
SUSE Linux Enterprise Desktop 12-SP4 (src):    libreoffice-6.1.5.2-43.44.3
SUSE Linux Enterprise Desktop 12-SP3 (src):    libreoffice-6.1.5.2-43.44.3
Comment 26 Swamp Workflow Management 2019-03-01 11:13:13 UTC
SUSE-RU-2019:0522-1: An update that has 13 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1079744,1088266,1095755,1107012,1110345,1110348,1112112,1112113,1112114,1117195,1117300,1124658,882383
CVE References: 
Sources used:
SUSE Linux Enterprise Workstation Extension 15 (src):    libreoffice-6.1.5.2-3.10.3
Comment 27 Swamp Workflow Management 2019-03-13 17:09:26 UTC
openSUSE-RU-2019:0324-1: An update that has 13 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1079744,1088266,1095755,1107012,1110345,1110348,1112112,1112113,1112114,1117195,1117300,1124658,882383
CVE References: 
Sources used:
openSUSE Leap 42.3 (src):    libreoffice-6.1.5.2-30.3
Comment 28 Swamp Workflow Management 2019-06-07 10:11:51 UTC
openSUSE-RU-2019:1525-1: An update that has 13 recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1079744,1088266,1095755,1107012,1110345,1110348,1112112,1112113,1112114,1117195,1117300,1124658,882383
CVE References: 
Sources used:
openSUSE Leap 15.0 (src):    libreoffice-6.1.5.2-lp150.2.10.1