Bug 998815 - groovy @Grab broken with openjdk - causes infinite loop
Summary: groovy @Grab broken with openjdk - causes infinite loop
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.7.0-openjdk
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Omair Majid
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-20 06:51 UTC by Aleksandar Kostadinov
Modified: 2013-08-30 23:04 UTC (History)
7 users (show)

Fixed In Version: java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc18
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Fedora 18 x86_64
Last Closed: 2013-08-30 23:04:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
thread dump of frozen app (6.90 KB, text/plain)
2013-08-20 06:51 UTC, Aleksandar Kostadinov
no flags Details
sample groovy app (758 bytes, text/plain)
2013-08-20 06:55 UTC, Aleksandar Kostadinov
no flags Details

Description Aleksandar Kostadinov 2013-08-20 06:51:20 UTC
Created attachment 788338 [details]
thread dump of frozen app

Description of problem:
When using @Grab annotation in groovy script, program *often* freezes after dependencies are downloaded.

It does not sound like an openjdk problem and I was going to initially file it with upstream groovy. But I when I tried running groovy with oracle jdk 1.6 and 1.7 it all works fine every time. So it must be some difference with openjdk.

It must be something with the mechanism used by groovy to inject dependencies into app classloader when using @Grab (never looked at how does that work). If @Grab is not used and dependencies are specified with `-cp`, then everything works fine every time.

Version-Release number of selected component (if applicable):
java-1.7.0-openjdk-1.7.0.25-2.3.10.4.fc18.x86_64

How reproducible:
almost always

Steps to Reproduce:
1. Run app using @Grab (see attached sample app)
 e.g. groovy myapp.groovy

Actual results:
app freezes

Expected results:
app runs

Additional info:
I am attaching a thread dump of the app in the frozen state.

Comment 1 Aleksandar Kostadinov 2013-08-20 06:55:13 UTC
Created attachment 788339 [details]
sample groovy app

Comment 2 Aleksandar Kostadinov 2013-08-20 07:34:18 UTC
I notice that the app is not actually frozen but seems like looping infinitely because CPU is loaded 100%. I'm not sure if the problem is openjdk or groovy expecting something oracle jvm specific. So I decided to also file this issue upstream:
http://jira.codehaus.org/browse/GROOVY-6316

Comment 3 Aleksandar Kostadinov 2013-08-20 07:47:25 UTC
Another thing I'm finding is this thread:
http://www.mail-archive.com/mlvm-dev@openjdk.java.net/msg05349.html

That suggests the problem might be removal of sun.reflect.Reflection.getCallerClass(int)

Is this the case with the openjdk version in fedora?

Comment 4 Aleksandar Kostadinov 2013-08-20 07:53:09 UTC
Groovy dev believes the problem is in openjdk and the problem is outlined in this comment:
http://jira.codehaus.org/browse/GROOVY-6310?focusedCommentId=330609&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-330609

> In short, the openjdk7u25 contains changes in native code the oracle7u25 does not have, causing a different and wrong behavior for the openjdk. The next problem could appear in both jdks in 7u40 because of http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8014925 The jdk community is aware of the problem (we really did our best to make this one known as a problem for Groovy) and we will have to see what they now will do in the end

Please fix this issue in fedora so groovy and other software relying on this is usable again. It is a regression from initial fedora18 release because it started to happen after some update (unfortunately not sure exactly which one).

Comment 7 Fedora Update System 2013-08-20 21:21:41 UTC
java-1.7.0-openjdk-1.7.0.25-2.3.12.2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/java-1.7.0-openjdk-1.7.0.25-2.3.12.2.fc18

Comment 8 Aleksandar Kostadinov 2013-08-20 21:36:07 UTC
Still infinite loop for me with the updated package. Please try the attached test groovy app.

Comment 9 Andrew John Hughes 2013-08-20 21:49:34 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=976693

If it's the same issue, we've already applied a patch to the 2.3 trees which should fix this.  A 2.3.13 release will be out soon.

Comment 10 Fedora Update System 2013-08-22 00:50:55 UTC
Package java-1.7.0-openjdk-1.7.0.25-2.3.12.2.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing java-1.7.0-openjdk-1.7.0.25-2.3.12.2.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-15139/java-1.7.0-openjdk-1.7.0.25-2.3.12.2.fc18
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2013-08-27 23:34:06 UTC
Package java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-15139/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc18
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2013-08-30 23:04:13 UTC
java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.