File: icedtea-lucene-crash.patch

package info (click to toggle)
openjdk-6 6b18-1.8.10-0~lenny2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 102,040 kB
  • ctags: 43,823
  • sloc: java: 213,434; cpp: 30,201; ansic: 6,269; asm: 5,754; sh: 4,396; makefile: 3,511; python: 310
file content (44 lines) | stat: -rw-r--r-- 1,114 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
diff -r 51798f0e554f test/compiler/6707044/LuceneCrash.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ openjdk/hotspot/test/compiler/6707044/LuceneCrash.java	Thu Sep 25 21:55:28 2008 +0200
@@ -0,0 +1,40 @@
+/*
+ * @test
+ * @bug 6707044
+ * @summary uncommon_trap of ifnull bytecode leaves garbage on expression stack
+ * @run main/othervm -Xbatch LuceneCrash
+ */
+public class LuceneCrash {
+
+  public static void main(String[] args) throws Throwable {
+    new LuceneCrash().crash();
+  }
+
+  private Object alwaysNull;
+
+  final void crash() throws Throwable {
+    for (int r = 0; r < 3; r++) {
+      for (int docNum = 0; docNum < 10000;) {
+        if (r < 2) {
+          for(int j=0;j<3000;j++)
+            docNum++;
+        } else {
+          docNum++;
+          doNothing(getNothing());
+          if (alwaysNull != null) {
+            throw new RuntimeException("BUG: checkAbort is always null: r=" + r + " of 3; docNum=" + docNum);
+          }
+        }
+      }
+    }
+  }
+
+  Object getNothing() {
+    return this;
+  }
+
+  int x;
+  void doNothing(Object o) {
+    x++;
+  }
+}