Menu

#87 Certain string values cause instrumentation errors

open
CORE (51)
5
2007-08-29
2007-08-29
No

Using string values such as "\1\123" anywhere in your program causes emma to instrument code incorrectly. Here is the simplest program that I was able to use to trigger this error:

package com.emmabugs;

public class One_OneTwoThree {
public static void main(String[] s) {
System.err.println("\1\123");
}
}

When you run this program like this

java -cp c:\emma\emma.jar emmarun -merge n -raw -cp . com.emmabugs.One_OneTwoThree

you get the stack trace below (note the '☺' "face" character in the method name)

[EMMA v2.0, build 5312]
emmarun: [MAIN_METHOD_FAILURE] com.emmabugs.One_OneTwoThree.main() method failure: java.lang.NoSuchMethodError: com.vladium.emma.rt.RT.☺S([[ZLjava/lang/String;J)V
Exception in thread "main" com.vladium.emma.EMMARuntimeException: [MAIN_METHOD_FAILURE] com.emmabugs.One_OneTwoThree.main() method failure: java.lang.NoSuchMethodError: com.vladium.emma.rt.RT.☺S([[ZLjava/lang/String;J)V
at com.vladium.emma.rt.AppRunner._run(AppRunner.java:550)
at com.vladium.emma.rt.AppRunner.run(AppRunner.java:97)
at com.vladium.emma.runCommand.run(runCommand.java:247)
at emmarun.main(emmarun.java:27)
Caused by: java.lang.NoSuchMethodError: com.vladium.emma.rt.RT.☺S([[ZLjava/lang/String;J)V
at com.emmabugs.One_OneTwoThree.$VRi(One_OneTwoThree.java)
at com.emmabugs.One_OneTwoThree.<clinit>(One_OneTwoThree.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.vladium.emma.rt.AppRunner$Invoker.run(AppRunner.java:655)
at java.lang.Thread.run(Unknown Source)

Discussion


Log in to post a comment.