java.lang.VerifyError: Inconsistent stackmap frames

瀏覽次數:14 次
跳到第一則未讀訊息

Josep Valls via StackOverflow

未讀,
2016年1月15日 下午5:46:082016/1/15
收件者:google-appengin...@googlegroups.com

I am getting an error and I have absolutely no clue how to go to fix it. Looking around stackoverflow it seems this error is related to either corrupt files or classes compiled in incompatible versions of Java. This is one of the questions I've been looking into: Reasons of getting a java.lang.VerifyError

WARNING: Error for /clearnlp
java.lang.VerifyError: Inconsistent stackmap frames at branch target 60
Exception Details:
  Location:
    edu/emory/clir/clearnlp/util/DSUtils.createStringHashMap(Ljava/io/InputStream;Ledu/emory/clir/clearnlp/util/CharTokenizer;Z)Ljava/util/Map; @60: aload_1
  Reason:
    Type top (current frame, locals[5]) is not assignable to 'java/lang/String' (stack map, locals[5])
  Current Frame:
    bci: @39
    flags: { }
    locals: { 'java/io/InputStream', 'edu/emory/clir/clearnlp/util/CharTokenizer', integer, 'java/io/BufferedReader', 'java/util/Map', top, 'java/lang/String' }
    stack: { integer }
  Stackmap Frame:
    bci: @60
    flags: { }
    locals: { 'java/io/InputStream', 'edu/emory/clir/clearnlp/util/CharTokenizer', integer, 'java/io/BufferedReader', 'java/util/Map', 'java/lang/String' }
    stack: { }
  Bytecode:
    0x0000000: bb00 5159 bb00 6f59 2ab7 0074 b700 774e
    0x0000010: bb00 8a59 0312 8c12 0b12 0db8 0013 b700
    0x0000020: 8d3a 04a7 0045 1c99 0015 1905 b600 323a
    0x0000030: 0519 05b6 0036 9900 06a7 002f 2b19 0503
    0x0000040: 1295 120b 120d b800 13b6 0099 3a06 1904
    0x0000050: 1906 0332 1906 0432 0312 9b12 0b12 0db8
    0x0000060: 0013 b900 9f03 0057 2db6 005c 593a 05c7
    0x0000070: ffb7 a700 0a3a 0719 07b6 0061 1904 b0  
  Exception Handler Table:
    bci [35, 114] => handler: 117
  Stackmap Table:
    full_frame(@38,{Object[#143],Object[#145],Integer,Object[#81],Object[#147],Top,Object[#40]},{})
    full_frame(@60,{Object[#143],Object[#145],Integer,Object[#81],Object[#147],Object[#40]},{})
    chop_frame(@104,1)
    same_locals_1_stack_item_frame(@117,Object[#71])
    same_frame(@124)

    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:70)
    at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:65)
    at edu.emory.clir.clearnlp.coreference.sieve.SpeakerIdentification.<init>(SpeakerIdentification.java:24)
    at edu.emory.clir.clearnlp.coreference.config.SieveSystemCongiuration.loadDefaultSieves(SieveSystemCongiuration.java:63)
    at edu.drexel.gameailab.ClearNLPServlet.doGet(ClearNLPServlet.java:66)
    at edu.drexel.gameailab.ClearNLPServlet.doPost(ClearNLPServlet.java:44)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)

In order to dismiss this kinds of errors, I've cleaned the project several times, deleted every single .class file I found. Updated all the dependencies (JARs) to the latest version and for the more obscure JARs I could not find new versions for I tracked the source code and I dumped it along my sources to ensure it's being compiled again by my JVM.

Regarding the setup, this is a web interface to the clearnlp parser project using servlets (Jetty) and the Google App Engine. I know there are some limitations on the GAE and I have already rewritten the file access parts that would be troublesome. I already went though the same process with the stanford corenlp and there were no issues once rewritten.

The at edu.emory.clir.clearnlp.coreference.sieve.SpeakerIdentification.<init>(SpeakerIdentification.java:24) is initializing some collections: private final Set<String> firstPersonSingularPronouns = DSUtils.toHashSet("i", "me", "my", "mine"); and below there is some source code from DSUtils.java:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.Set;
import java.util.regex.Pattern;

import edu.emory.clir.clearnlp.collection.list.FloatArrayList;
import edu.emory.clir.clearnlp.collection.pair.DoubleIntPair;
import edu.emory.clir.clearnlp.collection.pair.Pair;

public class DSUtils
{
[...]

    @SuppressWarnings("unchecked")
    static public <T>Set<T> toHashSet(T... items)
    {
        Set<T> set = new HashSet<T>(items.length);
        for (T item : items) set.add(item);
        return set;
    }

Anyone has any pointer on what I should be looking at next? Is GAE corrupting the class files? How could I fix it? I don't have source code for com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:70) or com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:65), those belong to the GAE SDK, I am currently in Release: 1.9.30. Not sure if relevant but I'm on OSX 10.11.2 using Apple's jdk1.8.0_60.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/34821047/java-lang-verifyerror-inconsistent-stackmap-frames

Sasikanth Bharadwaj via StackOverflow

未讀,
2016年1月17日 清晨6:01:082016/1/17
收件者:google-appengin...@googlegroups.com

The problem is in the code generated for createStringHashmap method, and if you are using eclipse to compile your code, this could be a bug in the eclipse compiler because of which it is generating wrong byte code. See if you can identify which portion of the code is causing the problem and file a bug with eclipse. I would also recommend you try a more recent version of eclipse you aren't on one already.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/34821047/java-lang-verifyerror-inconsistent-stackmap-frames/34837524#34837524
回覆所有人
回覆作者
轉寄
0 則新訊息