Test ecma/Date/ infinite loop under JDK 1.3, -opt 9



18 years ago
15 years ago


(Reporter: norrisboyd, Assigned: beard)





18 years ago
Title says it all. Perhaps there's a bug in HotSpot? My analysis showed a 
possible loop in YearFromTime.

Comment 1

18 years ago
Reassigning to Patrick, as this fits in with the other Date bugs 
he inherited from mccabe -
Assignee: rogerl → beard

Comment 2

18 years ago
Reconfirming bug with JDK 1.3 on WinNT.
If I leave out the opt -9, the testcase passes:

java org.mozilla.javascript.tools.shell.Main 
-f ecma/shell.js -f ecma/Date/

Date.UTC( 1970,0,1,0,0,0,0) = 0 PASSED!
Date.UTC( 1970,0,1,0,0,0,0) = 0 PASSED!


But if I include -opt 9, an infinite loop occurs:

java org.mozilla.javascript.tools.shell.Main -opt 9 
-f ecma/shell.js -f ecma/Date/

Comment 3

18 years ago
Is this just a dupe of bug 64312?
"Repeatedly initializing JS (Rhino) causes breakpoint on W2K "

Note: has been acknowledged by Sun as a bug and is under ID 4402079.

Comment 4

18 years ago
I don't think we know yet whether or not this is a dup of 64312. Certainly the
behavior is different.

Comment 5

18 years ago
Accepting this bug for tracking purposes.

Comment 6

16 years ago
Phil, could you retest this old bug with the current Rhino against the
configuration that originally triggers the bug?

I committed the following patch to YearFromTime not to call TimeFromYear(mid)
twice. Perhaps it is what confused JDK 1.3 JIT initially?

             if (TimeFromYear(mid) > t) {
                 hi = mid - 1;
             } else {
-                if (TimeFromYear(mid) <= t) {
-                    int temp = mid + 1;
-                    if (TimeFromYear(temp) > t) {
-                        return mid;
-                    }
-                    lo = mid + 1;
+                lo = mid + 1;
+                if (TimeFromYear(lo) > t) {
+                    return mid;

Comment 7

16 years ago
Doesn't seem to help. I still hang under JDK 1.3 on WinNT:

[ ]java org.mozilla.javascript.tools.shell.Main -opt9 
        -f ecma/shell.js -f ecma/Date/

                   (..... HANGS ....)

[] java -fullversion
java full version "1.3.0_02"

There is no hang, though, even with -opt9, under JDK 1.4 on WinNT:

[ ] java -fullversion
java full version "1.4.1-b21"

Comment 8

16 years ago
I am curious, is it possible to reproduce this with a smaller test or perhaps a
simple file? 

Comment 9

15 years ago
Closing as WONTFIX as the test case runs fine under JDK 1.3.1_10 on Windows so
even with 1.3.* JDK one can get JVM that works.
Last Resolved: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.