Bug 88256 - crash when running javascript macro
Summary: crash when running javascript macro
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.5.0.0.alpha0+ Master
Hardware: Other All
: high normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.5.0
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-09 20:58 UTC by raal
Modified: 2015-01-14 21:40 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
patch (3.53 KB, text/plain)
2015-01-09 23:34 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description raal 2015-01-09 20:58:06 UTC
Version: 4.5.0.0.alpha0+
Build ID: a272f5b7b30f356418ecf28eb95d066f081d1624
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-01-09_09:50:59

Steps to reproduce:
- open file from bug 72240   https://bugs.freedesktop.org/attachment.cgi?id=90225
- enable macros
 - tools->macro->organize macros ->javascript macros
navigate
	demo.ods
		Language
			language.js.js
select language.js.js
click button run

Crash

Error message:
[jni_uno bridge error] UNO calling Java method getPropertyValue: non-UNO exception occurred: java.lang.RuntimeException: java.lang.NoSuchFieldException: uri
java stack trace:
java.lang.RuntimeException: java.lang.NoSuchFieldException: uri
	at com.sun.star.lib.uno.helper.PropertySet.getPropertyValue(PropertySet.java:845)
	at com.sun.star.lib.uno.helper.PropertySet.getPropertyValue(PropertySet.java:380)
Caused by: java.lang.NoSuchFieldException: uri
	at java.lang.Class.getDeclaredField(Class.java:2062)
	at com.sun.star.lib.uno.helper.PropertySet.getPropertyValue(PropertySet.java:838)
	... 1 more
Comment 1 Julien Nabet 2015-01-09 23:31:51 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 2 Julien Nabet 2015-01-09 23:34:24 UTC
Created attachment 112038 [details]
patch

With the patch attached, I don't have error (on master sources).
Comment 3 Julien Nabet 2015-01-09 23:40:14 UTC
Noel: it seems there are problems with several commits:
eg:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=8583da1e934a49791ef8d86668f3d5c3c5dae1d7
http://cgit.freedesktop.org/libreoffice/core/commit/?id=da677dfd59c2b551f3335ee0a5d5dfb33f9869c5

Wonder if UCDetector could have some false positives.
Comment 4 Noel Grandin 2015-01-10 06:23:19 UTC
Thanks Julien, I'll go through the various commits I made and look for similar problems to this one.

UCDetector has problems with the use of reflection. At a later stage I will try and convert some of the property usage to attributes, which will make it more obvious that the fields are in use.
Comment 5 Commit Notification 2015-01-13 08:40:47 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3ab2d3a2c5b802ab88171770d19871e081c3252b

fdo#88256 fix crash when running javascript macro

It will be available in 4.5.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 6 Julien Nabet 2015-01-13 20:12:46 UTC
Thank you Noel for the patch!
Let's put this one to FIXED.
Comment 7 Julien Nabet 2015-01-14 21:40:20 UTC
I gave a new try after having updated today, I don't reproduce the crash.