Bug 998815 - groovy @Grab broken with openjdk - causes infinite loop
groovy @Grab broken with openjdk - causes infinite loop
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: java-1.7.0-openjdk (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Omair Majid
Fedora Extras Quality Assurance
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-20 02:51 EDT by Aleksandar Kostadinov
Modified: 2013-08-30 19:04 EDT (History)
7 users (show)

See Also:
Fixed In Version: java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Fedora 18 x86_64
Last Closed: 2013-08-30 19:04:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Aleksandar Kostadinov 2013-08-20 02:51:20 EDT
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 02:55:13 EDT
Created attachment 788339 [details]
sample groovy app
Comment 2 Aleksandar Kostadinov 2013-08-20 03:34:18 EDT
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 03:47:25 EDT
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 03:53:09 EDT
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 17:21:41 EDT
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 17:36:07 EDT
Still infinite loop for me with the updated package. Please try the attached test groovy app.
Comment 9 Andrew John Hughes 2013-08-20 17:49:34 EDT
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-21 20:50:55 EDT
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 19:34:06 EDT
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 19:04:13 EDT
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.