Bug 57553 - EDITING: On computer without JRE, Picture dialog shows: JRE required and freezes after OK
Summary: EDITING: On computer without JRE, Picture dialog shows: JRE required and free...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.0.alpha1
Hardware: Other Windows (All)
: medium normal
Assignee: Korrawit Pruegsanusak
URL:
Whiteboard: BSA target:4.0.0
Keywords: regression
Depends on:
Blocks:
 
Reported: 2012-11-26 12:46 UTC by Korrawit Pruegsanusak
Modified: 2012-12-07 14:29 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot showing JRE Required dialog when opening Picture dialog (152.88 KB, image/png)
2012-11-26 12:46 UTC, Korrawit Pruegsanusak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Korrawit Pruegsanusak 2012-11-26 12:46:42 UTC
Created attachment 70587 [details]
screenshot showing JRE Required dialog when opening Picture dialog

Problem description: 
On Windows 7 x64 Home Premium, without Java Runtime Environment (JRE),
Double clicking Picture shows JRE required dialog, and clicking OK makes Picture dialog freeze.

Reproduced with 4.0 alpha1. Not reproduced with 3.6.3. => Regression

Steps to reproduce:
1. Open Writer, new document created
2. Drag and drop a picture into document, I use attachment 70190 [details] for a sample
3. Double click the picture

Current behavior:
The Picture dialog appears with "JRE Required" dialog. If I click OK, the Picture dialog freeze for a few seconds.

Expected behavior:
1. The dialog shows without "JRE Required" and 2. not freeze. I'm not sure if these two are same problems.
Operating System: Windows 7
Last worked in: 3.6.3.2 release
Comment 1 Michael Stahl (allotropia) 2012-12-04 21:51:38 UTC
hmm... it wants to load ScriptProviderForBeanShell.jar ...

ok there is a Macro tab on that Picture dialog, and since
there is a Scripting Framework that has some Java based providers,
it's sort of expected that it has to load these in order to
display available macros.

since i only have master build on windows, i'm trying on Linux...
...where the same thing happens, it's sufficient to turn off
Java in Tools->Options.

LO 3.6.3.2 on Linux has the same dialog, and it also crashes when clicking "No" on it with unhandled terminate called after throwing an instance of 'com::sun::star::loader::CannotActivateFactoryException'.
(which actually crashes only in --enable-dbgutil build)
TODO: backport b6b71d74fddca5e260ab2a3d6307603f5b469108

but the dialog only appears after clicking "Macro" tab, not when opening the Picture dialog.

LO 3.5.7.2 is the same as 3.6.3 except it does not crash.

LO master is annoyingly showing the dialog when opening Picture dialog.
and it does not crash, neither Windows nor Linux.

hmmm... on master there is apparently a timer that loads the macro stuff...
ok the following code seems to force the activation of all tab pages:

void SfxTabDialog::Start_Impl()
{
    //We need to force all tabs to exist to get overall optimal size for dialog
    for (sal_uInt16 n=0; n < m_pTabCtrl->GetPageCount(); ++n)
    {
        sal_uInt16 nPageId = m_pTabCtrl->GetPageId(n);
        if (!m_pTabCtrl->GetTabPage(nPageId))
        {
            m_pTabCtrl->SetCurPageId(nPageId);
            ActivatePageHdl(m_pTabCtrl);
        }
    }

introduced with bd2c14ec78a7549d4a19738154cdd5ea890f61c4 and 004369c76a3c43a478d668521bf7cee3176bf5d7 for UI layout...

hmm... should be possible to do the expensive java init lazily
on activating the Macro tab... think i have a lame patch for this,
will push it in a minute...

but what i don't get here is a crash on master; i don't get the same dialog (since i have disabled Java in configuration but do have JVM installed
and don't want to uninstall that on my development VM),
can you get a backtrace for the crash?
Comment 2 Not Assigned 2012-12-04 22:56:22 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5d84af7e83404f22d3c9cd0b0bb88fb84d0550e7

fdo#57553: Picture dialog Macro tab page: lazily init



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 3 Not Assigned 2012-12-05 08:58:26 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4b699f5b6f384529f49c3ffc3ad06d5afe245e76&g=libreoffice-4-0

fdo#57553: Picture dialog Macro tab page: lazily init


It will be available in LibreOffice 4.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 4 Michael Stahl (allotropia) 2012-12-05 13:05:11 UTC
just for the record i've pushed b6b71d74fddca5e260ab2a3d6307603f5b469108
to libreoffice-3-6 which means that doesn't crash in --enable-dbgutil any more
Comment 5 Michael Stahl (allotropia) 2012-12-05 13:07:17 UTC
Korrawit, please try to get a stacktrace of the crash, or mark the bug as fixed if it doesn't crash any more...
Comment 6 Korrawit Pruegsanusak 2012-12-07 14:29:03 UTC
Thanks Michael for the fix. :-) I've tested with 4.0 beta1, and it works fine now => FIXED

In beta1 (which is fine), when double-clicking picture, the picture dialog showed instantly without any freeze nor "JRE Required" dialog. :-) Clicking tab "Macro" still showed "JRE Required" dialog and freeze *for a few seconds* after clicking OK. But this is expected, right? :-)

Also, I'm sorry for the mis-communication. What I meant "freeze" is: After clicking OK, it froze for ~5 seconds, and then behaved normally after that. No need to kill process.