summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2015-12-22 12:21:17 -0800
committerYing Wang <wangying@google.com>2016-01-21 15:34:12 -0800
commit9323689e53509aa4b0f2cdee861dd984a8f418e9 (patch)
tree4703572039bbc91618a4e285711786721fd29e69
parentef2942809b198653e0cf181151a5f435f5bb7476 (diff)
downloadproguard-9323689e53509aa4b0f2cdee861dd984a8f418e9.tar.gz
Fix 'Exception in thread "main" java.lang.AbstractMethodError:'
When running with OpenJDK 8 (openjdk version "1.8.0_45-internal") on module messaging, sometimes an odd exception is caught in main: Exception in thread "main" java.lang.AbstractMethodError: java.lang.Exception.getMessage()Ljava/lang/String; at proguard.ProGuard.main(ProGuard.java:519) It's not 100% reproducible. But it's certain to happen if you run the same ProGuard tasks in parallel (e.g. x40). The exception runtime type is actually java.lang.ArrayIndexOutOfBoundsException, which I tracked down to raise from MappingPrinter.visitLineNumberTableAttribute(). It's strange that the exception object is in a weird state that e.printStatckTrace() throws java.lang.AbstractMethodError. Other people have seen similar things too: http://stackoverflow.com/questions/6777710/abstractmethoderror-on-calling-exception-printstacktrace Using temparary variables low/high fixes the crash. It seems to be an OpenJDK 8 bug. Rebuilt the jar files by running build/build.sh. Bug: 26274804 Change-Id: I773023b2dc57bd048c6781aded84e0c0df923a90 (cherry-pick from commit 9d99b19da7ab70bfff55327c5e4719addb1955f7)
-rw-r--r--lib/proguard.jarbin853203 -> 806163 bytes
-rw-r--r--lib/proguardgui.jarbin139582 -> 137002 bytes
-rw-r--r--lib/retrace.jarbin6973 -> 7556 bytes
-rw-r--r--src/proguard/obfuscate/MappingPrinter.java16
4 files changed, 14 insertions, 2 deletions
diff --git a/lib/proguard.jar b/lib/proguard.jar
index a948c89..43faf48 100644
--- a/lib/proguard.jar
+++ b/lib/proguard.jar
Binary files differ
diff --git a/lib/proguardgui.jar b/lib/proguardgui.jar
index b876e89..e2d9439 100644
--- a/lib/proguardgui.jar
+++ b/lib/proguardgui.jar
Binary files differ
diff --git a/lib/retrace.jar b/lib/retrace.jar
index c00fbe7..94c8c6b 100644
--- a/lib/retrace.jar
+++ b/lib/retrace.jar
Binary files differ
diff --git a/src/proguard/obfuscate/MappingPrinter.java b/src/proguard/obfuscate/MappingPrinter.java
index aab779f..537a345 100644
--- a/src/proguard/obfuscate/MappingPrinter.java
+++ b/src/proguard/obfuscate/MappingPrinter.java
@@ -140,7 +140,19 @@ implements ClassVisitor,
public void visitLineNumberTableAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute, LineNumberTableAttribute lineNumberTableAttribute)
{
- ps.print(lineNumberTableAttribute.getLowestLineNumber() + ":" +
- lineNumberTableAttribute.getHighestLineNumber() + ":");
+ // ps.print(lineNumberTableAttribute.getLowestLineNumber() + ":" +
+ // lineNumberTableAttribute.getHighestLineNumber() + ":");
+ // With the above statement,
+ // OpenJDK 8 (openjdk version "1.8.0_45-internal") crashed with:
+ // Exception in thread "main" java.lang.AbstractMethodError:
+ // java.lang.Exception.getMessage()Ljava/lang/String;
+ // at proguard.ProGuard.main(ProGuard.java:519)
+ //
+ // Using temporary variables fixed the crash.
+ // See bug 26274804.
+ int low,high;
+ low = lineNumberTableAttribute.getLowestLineNumber();
+ high = lineNumberTableAttribute.getHighestLineNumber();
+ ps.print(low + ":" + high + ":");
}
}