diff options
author | Ying Wang <wangying@google.com> | 2015-12-22 12:21:17 -0800 |
---|---|---|
committer | Ying Wang <wangying@google.com> | 2015-12-22 14:08:15 -0800 |
commit | 9d99b19da7ab70bfff55327c5e4719addb1955f7 (patch) | |
tree | 82ea8780254ef7fddadb5c570143c10e62bc9815 /src | |
parent | 72a7fde89fd0fa930baf7b47d1bd19c73317de1a (diff) | |
download | external_proguard-9d99b19da7ab70bfff55327c5e4719addb1955f7.tar.gz external_proguard-9d99b19da7ab70bfff55327c5e4719addb1955f7.tar.bz2 external_proguard-9d99b19da7ab70bfff55327c5e4719addb1955f7.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/proguard/obfuscate/MappingPrinter.java | 16 |
1 files changed, 14 insertions, 2 deletions
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 + ":"); } } |