Hi Sung,
Thanks for the clarification.
I have another issue with exceptions... I have the following code:
public class CrashTest {
public static void main(String[] args) {
try{
f("hello");
} catch(Exception e) {
"reCrash with".equals(e);
}
}
static void f(Object o) { g(o); }
static void g(Object o) { crash_test(o); }
static void crash_test(Object o) { throw new RuntimeException(); }
}
I was expecting to have a test case with the all the elements to
reproduce the crash, i.e. call to f(..) -> g(..) -> crash_test(..)
with the argument "hello". Instead, reCrash only generates the test
for main(String[] args)
In the paper, it is mentioned that there were some issues with
exceptions, is this related to that? or did made something wrong?
public class Recrash_reCrash12514_trace_gz extends TestCase {
public void setUp() throws Exception {
TraceReader.readTrace("/var/tmp/reCrash12514.trace.gz");
}
public void test_CrashTest_main_0() throws Throwable {
TraceReader.setMethodTraceItem(0);
CrashTest thisObject = (CrashTest) TraceReader.readObject(0);
// load arguments
// String[] arg_1 = [Ljava.lang.String;@4f80d6;
String[] arg_1 = (String[])TraceReader.readObject(1);
// Method invocation
thisObject.main(arg_1);
}
}
By looking on the trace, it seems that there is something
incomplete...
Thanks in advance,
Alex
<edu.mit.csail.pag.recrash.tracer.item.StackTraceItem
serialization="custom">
<unserializable-parents/>
<vector>
<default>
<capacityIncrement>0</capacityIncrement>
<elementCount>1</elementCount>
<elementData>
<edu.mit.csail.pag.recrash.tracer.item.MethodTraceItem>
<serializedArgumentObject>
<edu.mit.csail.pag.recrash.tracer.item.ClonedArgumentObject>
<isCloned>false</isCloned>
<typeName>CrashTest</typeName>
</
edu.mit.csail.pag.recrash.tracer.item.ClonedArgumentObject>
<edu.mit.csail.pag.recrash.tracer.item.ClonedArgumentObject>
<isCloned>false</isCloned>
<typeName>java.lang.String[]</typeName>
<object class="string-array"/>
</
edu.mit.csail.pag.recrash.tracer.item.ClonedArgumentObject>
</serializedArgumentObject>
<methodName>CrashTest.main</methodName>
<nounceNumber>0</nounceNumber>
</edu.mit.csail.pag.recrash.tracer.item.MethodTraceItem>
<null/>
<null/>
<null/>
<null/>
<null/>
<null/>
<null/>
<null/>
<null/>
</elementData>
</default>
</vector>
<edu.mit.csail.pag.recrash.tracer.item.StackTraceItem>
<default>
<nounceNumber>1</nounceNumber>
<serializeOneByOne>false</serializeOneByOne>
<crashedException class="java.lang.RuntimeException">
<stackTrace>
<trace>CrashTest.crash_test(CrashTest.java:23)</trace>
<trace>CrashTest.g(CrashTest.java:20)</trace>
<trace>CrashTest.f(CrashTest.java:18)</trace>
<trace>CrashTest.__original_main__(CrashTest.java:9)</trace>
<trace>CrashTest.main(CrashTest.java)</trace>
</stackTrace>
</crashedException>
</default>
</edu.mit.csail.pag.recrash.tracer.item.StackTraceItem>
</edu.mit.csail.pag.recrash.tracer.item.StackTraceItem>
On Sep 16, 3:46 pm, "Sung Kim" <
hun...@gmail.com> wrote:
> Hi Alex,
> Currently, ReCrash does not support crashes in a constructor. However,
> ReCrash would include the method that calls a problematic constructor, which
> is often located the upper level of the stack. Also, it is not that hard to
> invoke constructors. We will consider adding the feature in the next
> release.
>
> Cheers,
> - Sung
>