JDK7 loop compilation bugs ?

85 views
Skip to first unread message

Jan Goyvaerts

unread,
Jul 29, 2011, 5:41:14 AM7/29/11
to The Java Posse
I don't mean to minimize Oracle's effort nor discredit Lucene in any way...

It seems JDK7 is not usuable for Lucene at the moment. But looking to the blog entry underneath, it looks like it might impact quite a lot of other applications.
http://www.lucidimagination.com/blog/2011/07/28/dont-use-java-7-for-anything/

Can anybody tell how serious this might be ?

mbien

unread,
Jul 29, 2011, 6:50:21 AM7/29/11
to The Java Posse
as you can see in the bug reports 2 of those 3 bugs have been already
fixed, they just wait for the next update release.

using a .0 release in production on the first day is almost never a
good idea - doesn't matter what SW you are using. I am using jdk7 for
dev for a long time already and experienced only in one ea build JVM
related stability issues so far. so... don't panic - nothing unusual
with this release :)

On Jul 29, 11:41 am, Jan Goyvaerts <java.arti...@gmail.com> wrote:
> I don't mean to minimize Oracle's effort nor discredit Lucene in any way...
>
> It seems JDK7 is not usuable for Lucene at the moment. But looking to the
> blog entry underneath, it looks like it might impact quite a lot of other
> applications.http://www.lucidimagination.com/blog/2011/07/28/dont-use-java-7-for-a...

Jan Goyvaerts

unread,
Jul 29, 2011, 7:21:28 AM7/29/11
to java...@googlegroups.com
Thanks. It's just that I don't mind if it crashes. It's about wrong results I'm worrying.

Knowing the speed of adoption, I'm pretty sure it'll take some time before JDK7's used in production anyway. ;-)

--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.


Michael Barker

unread,
Jul 29, 2011, 9:10:17 AM7/29/11
to java...@googlegroups.com
It's annoying, I was hoping to drop it into our CI environment next week...

Mark Derricutt

unread,
Jul 29, 2011, 6:05:28 PM7/29/11
to java...@googlegroups.com
Yes, but you can work around it by using:

-XX:-UseLoopPredicate

I'm getting tired already of seeing many sites ranting about this bug without mentioning the work around described in the actual Oracle bug tickets.

The tests that actually uncovered the problems were only written last month:

https://issues.apache.org/jira/browse/LUCENE-3079

I've not looked at the tests/patches yet but I'm curious as to what they're doing that managed to uncover this problem, and just how likely it is to hit in normal day-to-day code that no other tests fails/hit it.

Mark

Jess Holle

unread,
Jul 29, 2011, 7:52:00 PM7/29/11
to java...@googlegroups.com, Mark Derricutt
I really don't like that Oracle knew about this and released anyway
(even if it were only hours prior to the release) -- without making

-XX:-UseLoopPredicate

the default.

It's better not to release on time than to release something that
customers don't trust.

Having to add JVM options just to get a JVM to work correctly is a
non-starter. That's the sort of thing I expect from IBM JVMs -- and
detest them for. The default mode of the JVM should be correct and
stable -- with -XX:+UseLoopPredicate, etc, allowing those most desperate
for speed to live dangerously on their own time.

Stuart McCulloch

unread,
Jul 29, 2011, 8:46:34 PM7/29/11
to java...@googlegroups.com
On 29 Jul 2011, at 23:05, Mark Derricutt wrote:

> Yes, but you can work around it by using:
>
> -XX:-UseLoopPredicate
>
> I'm getting tired already of seeing many sites ranting about this bug without mentioning the work around described in the actual Oracle bug tickets.
>
> The tests that actually uncovered the problems were only written last month:
>
> https://issues.apache.org/jira/browse/LUCENE-3079
>
> I've not looked at the tests/patches yet but I'm curious as to what they're doing that managed to uncover this problem, and just how likely it is to hit in normal day-to-day code that no other tests fails/hit it.

That's the problem with a lot of JIT bugs - it can be hard to say what other applications might encounter it, often it just seems like bad luck.

Back in January I debugged an infinite loop on a remote server. I tracked it down to a simple method involving an array and a counter, but couldn't see any way the loop could ever happen. Turns out the c2 JIT in 1.6.0_23 left out an increment instruction when it compiled the method :/ The workaround was to replace:

members = views[viewIndex++].members( clazz ); // this was the increment that the JIT left out

with:

members = views[viewIndex].members( clazz );
viewIndex++;

Unfortunately reducing this to a simple test class was impossible, since any change to the surrounding methods (which were also relatively simple) made the problem go away. I filed a bug report via bugs.sun.com and got a review number (1965196) but never heard anything since then - hopefully they fixed it!

JIT/JVM crashes I don't mind because at least you know there's been a problem, it's the silent bugs (such as missing/incorrect instructions) that scare me.

That said, this was the first JIT bug I'd encountered in many years...

--
Cheers, Stuart

> Mark
>
>
>
> On 30/07/2011, at 1:10 AM, Michael Barker wrote:
>
>> It's annoying, I was hoping to drop it into our CI environment next week...
>>
>>
>

Kirk

unread,
Jul 30, 2011, 4:12:40 AM7/30/11
to java...@googlegroups.com
the other work around is to tell hotspot not to compile the offending method.

Regards,

Kirk

Reply all
Reply to author
Forward
0 new messages