Bug 73168 - Crash with a message "JRE is Defective"
Summary: Crash with a message "JRE is Defective"
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.4.2 release
Hardware: All Windows (All)
: highest critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: mab4.1
  Show dependency treegraph
 
Reported: 2013-12-30 21:26 UTC by Maurice Glover
Modified: 2014-05-02 18:08 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
screen shots of crash (1.21 MB, application/pdf)
2013-12-30 21:26 UTC, Maurice Glover
Details
attachment-7005-0.html (5.60 KB, text/html)
2013-12-31 12:55 UTC, Maurice Glover
Details
attachment-7005-1.dat (1 bytes, multipart/alternative)
2013-12-31 12:55 UTC, Maurice Glover
Details
131231 Bug report 73168 screenshots.pdf (589.57 KB, application/pdf)
2013-12-31 12:55 UTC, Maurice Glover
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maurice Glover 2013-12-30 21:26:18 UTC
Created attachment 91349 [details]
screen shots of crash

Crash with a message "JRE is Defective" while running Oracle Java 1.7.0_45 (or Sun 1.6 0_45 or Sun 1.6 0_22 or Sun 1.6 0_18)
---------------------------------------------------

LibreOffice crashes in several circumstances. In this instance I am editing a cell function "=ROUND(D41*0.2,2)". When I do I get the message "LibreOffice requires a Java runtime environment (JRE) to perform this task The selective JRE is defective. Please select another version or install a new JRE and select it under Tools - Options - LibreOffice - Advanced.". I do this and the situation still occurs.

I used to have this problem occasionally with earlier versions of LibreOffice and a switch of JRE in the "Tools - Options - LibreOffice - Advanced" tab would fix it. Nothing seems to fix it now and it just crashes and crashes. 

I have had to install Open office just to get work done. I have used LibreOffice for a number of years and like it. It would be great to resolve this and get back to it.

Any suggestions please?
Comment 1 m_a_riosv 2013-12-30 23:49:15 UTC
Hi Maurice, thanks for reporting.

I think LibreOffice doesn't need java with functions.
In any case verify you are using a 32 bits java, 64 bits doesn't work.
Try resetting the user profile, sometimes solves strange issues.
Have you added some extension?
Comment 2 m_a_riosv 2013-12-30 23:50:41 UTC
Link about change user profile.
https://wiki.documentfoundation.org/UserProfile
Comment 3 Michael Meeks 2013-12-31 09:46:02 UTC
Maurice reports by E-mail that he has removed his profile, and the problems persist.

Maurice - can you confirm that you have no extensions installed ? This is not the 1st instance of problems in calc around formula editing and Java - I suspect that we attempt to use the scripting framework to check if there are any scripts present in each language (or something similarly silly), and this blows up with Java. what does "Tools->Extension Manager" show ? (another screenshot would be awesome).

Maurice - can you report whether Calc continues to work if you hit 'ok' ? I appreciate it throws up a scary looking dialog but ... it shoudl continue to work.

It sounds like we've got some problem here rather than all of the installed JRE's being defective of course :-)

What would be really helpful would be to get a better exception message out of that beastie I guess.

Stephan - any thoughts ? marking a MAB anyway.

void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionRequest >& Request ) throw (RuntimeException)

is where the error comes from:

    com::sun::star::java::JavaVMCreationFailureException    e4;
...
    else if ( anyExc >>= e4 )
    {
        if( !(m_bShowErrorsOnce && m_bVMCreationFailure_Handled))
        {
            // Java not correctly installed, or damaged
            SolarMutexGuard aSolarGuard;
            m_bVMCreationFailure_Handled = true;
#ifdef MACOSX
            ErrorBox aErrorBox( NULL, SvtResId( ERRORBOX_JVMCREATIONFAILED_MAC ) );
#else
            ErrorBox aErrorBox( NULL, SvtResId( ERRORBOX_JVMCREATIONFAILED ) );
#endif
            aErrorBox.SetText(SvtResId( STR_ERROR_JVMCREATIONFAILED ).toString());
            nResult = aErrorBox.Execute();
        }
        else

I guess we could try to provide / tunnel through more useful data here from the exception ? then again there is no useful information in the exception as it is thrown either.

stoc/source/javavm/javavm.cxx:

            css::java::JavaVMCreationFailureException exc(
                OUString("JavaVirtualMachine::getJavaVM failed because Java is defective!"),
                static_cast< cppu::OWeakObject * >(this), 0);
            askForRetry(css::uno::makeAny(exc));

I guess (?).

Thanks !
Comment 4 Maurice Glover 2013-12-31 12:55:58 UTC
Created attachment 91361 [details]
attachment-7005-0.html

Michael

This will obviously sounds completely stupid but what extension are you
talking about.

The screenshots pdf attached ("131231 Bug report 73168 screenshots") shows
a number of extensions which I have not myself consciously installed.


Going bacck to my crashing spreadsheet, When I had pressed OK to the "JRE
is Defective" message it did not crash immediately
but as soon as I tried to put in an "=" formula, up popped the message. I
then pressed the ESC key
and up popped the "Runtime Error!":

"Program:

This application has requested the runtime to terminate in an unusual way.
Please contact the application's support team for more information".

I then pressed Okay and it automatically and instantaneously closed
Libreoffice

I recovered the spreadsheet and sods law but I can't now get it to crash!
Yesterday several different calc files were crashing.

Very puzzling!

Moss




On Tue, Dec 31, 2013 at 9:46 AM, <bugzilla-daemon@freedesktop.org> wrote:

>  Michael Meeks <michael.meeks@collabora.com> changed bug 73168<https://bugs.freedesktop.org/show_bug.cgi?id=73168>
>  What Removed Added  CC   michael.meeks@collabora.com, sbergman@redhat.com
> Blocks   60270
>
>  *Comment # 3 <https://bugs.freedesktop.org/show_bug.cgi?id=73168#c3> on
> bug 73168 <https://bugs.freedesktop.org/show_bug.cgi?id=73168> from Michael
> Meeks <michael.meeks@collabora.com> *
>
> Maurice reports by E-mail that he has removed his profile, and the problems
> persist.
>
> Maurice - can you confirm that you have no extensions installed ? This is not
> the 1st instance of problems in calc around formula editing and Java - I
> suspect that we attempt to use the scripting framework to check if there are
> any scripts present in each language (or something similarly silly), and this
> blows up with Java. what does "Tools->Extension Manager" show ? (another
> screenshot would be awesome).
>
> Maurice - can you report whether Calc continues to work if you hit 'ok' ? I
> appreciate it throws up a scary looking dialog but ... it shoudl continue to
> work.
>
> It sounds like we've got some problem here rather than all of the installed
> JRE's being defective of course :-)
>
> What would be really helpful would be to get a better exception message out of
> that beastie I guess.
>
> Stephan - any thoughts ? marking a MAB anyway.
>
> void SAL_CALL JavaInteractionHandler::handle( const Reference<
> XInteractionRequest >& Request ) throw (RuntimeException)
>
> is where the error comes from:
>
>     com::sun::star::java::JavaVMCreationFailureException    e4;
> ...
>     else if ( anyExc >>= e4 )
>     {
>         if( !(m_bShowErrorsOnce && m_bVMCreationFailure_Handled))
>         {
>             // Java not correctly installed, or damaged
>             SolarMutexGuard aSolarGuard;
>             m_bVMCreationFailure_Handled = true;
> #ifdef MACOSX
>             ErrorBox aErrorBox( NULL, SvtResId( ERRORBOX_JVMCREATIONFAILED_MAC
> ) );
> #else
>             ErrorBox aErrorBox( NULL, SvtResId( ERRORBOX_JVMCREATIONFAILED ) );
> #endif
>             aErrorBox.SetText(SvtResId( STR_ERROR_JVMCREATIONFAILED
> ).toString());
>             nResult = aErrorBox.Execute();
>         }
>         else
>
> I guess we could try to provide / tunnel through more useful data here from the
> exception ? then again there is no useful information in the exception as it is
> thrown either.
>
> stoc/source/javavm/javavm.cxx:
>
>             css::java::JavaVMCreationFailureException exc(
>                 OUString("JavaVirtualMachine::getJavaVM failed because Java is
> defective!"),
>                 static_cast< cppu::OWeakObject * >(this), 0);
>             askForRetry(css::uno::makeAny(exc));
>
> I guess (?).
>
> Thanks !
>
>  ------------------------------
> You are receiving this mail because:
>
>    - You reported the bug.
>
>
Comment 5 Maurice Glover 2013-12-31 12:55:58 UTC
Created attachment 91362 [details]
attachment-7005-1.dat
Comment 6 Maurice Glover 2013-12-31 12:55:58 UTC
Created attachment 91363 [details]
131231 Bug report 73168 screenshots.pdf
Comment 7 m_a_riosv 2013-12-31 18:05:56 UTC
In:
https://bugs.freedesktop.org/show_bug.cgi?id=72134
seems NUMBERTEXT extension leads to a similar issue with the '='.
Comment 8 Stephan Bergmann 2014-01-06 13:02:42 UTC
* Maurice, the reason that LO tries to instantiate a JVM as soon as you are "editing a cell function '=ROUND(D41*0.2,2)'" is probably the CalcStockAddIn.oxt extension you have installed (per attachment 91363 [details]).  Maybe the problem disappears if you disable or remove that extension.

* The "The selected JRE is defective" error box ultimately must be caused by one of the four uses of JFW_PLUGIN_E_VM_CREATION_FAILED in jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx (i.e., either unable to load the JVM lib, no JNI_CreateJavaVM exported from that lib, or an error when calling that JNI_CreateJavaVM).  On Windows, this is most likely caused by the JVM lib depending on other libs (like a C++ runtime lib) that cannot be found; maybe do_msvcr71_magic (jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx) does not work as intended for some reason.
Comment 9 Maurice Glover 2014-01-06 17:03:10 UTC
I don't think I installed the CalcStockAddIn.oxt extension but I have now
disabled it. Very many thanks for your help. I hope it works. All seems
good at the moment! Fingers crossed.
Thanks again



On Mon, Jan 6, 2014 at 1:02 PM, <bugzilla-daemon@freedesktop.org> wrote:

>   *Comment # 8 <https://bugs.freedesktop.org/show_bug.cgi?id=73168#c8> on
> bug 73168 <https://bugs.freedesktop.org/show_bug.cgi?id=73168> from Stephan
> Bergmann <sbergman@redhat.com> *
>
> * Maurice, the reason that LO tries to instantiate a JVM as soon as you are
> "editing a cell function '=ROUND(D41*0.2,2)'" is probably the
> CalcStockAddIn.oxt extension you have installed (per attachment 91363 [details] <https://bugs.freedesktop.org/attachment.cgi?id=91363> [details] <https://bugs.freedesktop.org/attachment.cgi?id=91363&action=edit>).  Maybe
> the problem disappears if you disable or remove that extension.
>
> * The "The selected JRE is defective" error box ultimately must be caused by
> one of the four uses of JFW_PLUGIN_E_VM_CREATION_FAILED in
> jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx (i.e., either unable to
> load the JVM lib, no JNI_CreateJavaVM exported from that lib, or an error when
> calling that JNI_CreateJavaVM).  On Windows, this is most likely caused by the
> JVM lib depending on other libs (like a C++ runtime lib) that cannot be found;
> maybe do_msvcr71_magic (jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx)
> does not work as intended for some reason.
>
>  ------------------------------
> You are receiving this mail because:
>
>    - You reported the bug.
>
>
Comment 10 retired 2014-01-07 23:59:42 UTC
Maurice please only reply via browser not via mail. Otherwise the bug tracker will be cluttered with lots of useless info. Thanks for understanding.
Comment 11 sophie 2014-02-12 09:53:11 UTC
Changed importance to reflect the new policy - Sophie
Comment 12 retired 2014-02-12 10:11:22 UTC
Maurice does this persist with 4.2.0.4?
Comment 13 Maurice Glover 2014-02-12 22:42:13 UTC
I'm on version 4.1.4.2 now. I disabled the CalcStockAddIn and I haven't crashed since. Many thanks for the help
Comment 14 Michael Meeks 2014-02-13 11:24:01 UTC
Thanks for the feedback ! Stephan - is there any way we can protect against JVM's missing native symbols like that ? ... or is it a lost cause ? =)
Comment 15 Michael Meeks 2014-03-27 10:06:09 UTC
It would be great to know what the stack trace is/was when that add-in was in-use and the error message came up; I wonder if bug#62155 may have fixed this too.

Can anyone reproduce this ? and/or Stephan - is there a way that we can easily simulate this for unit testing in calc - injecting a bad JRE somehow ?
Comment 16 tommy27 2014-05-02 14:16:27 UTC
I'm in the process of cleaning the mab4.1 list.
is this bug still reproducible in LibO 4.2.x?

if YES, move it to mab4.2
if NO, mark it as RESOLVED WORKSFORME
Comment 17 Maurice Glover 2014-05-02 18:08:15 UTC
Many thanks