Joda-Time is a standard date and time library for Java. Result from Ziyuan: The bug is at BasicMonthOfYearDateTimeField (line: 212). The reason is that after rolling over to the next month, when it rolls over again, the new month value is mistaken calculated based on the original month value but the one that is calculated previously. We feed the passed test cases from Ziyuan to Daikon. After a while, Daikon throws an exception as below: [1:43:44 PM]: Reading ./DaikonTestIssue227.dtrace.gz (line 1802772, 34.02%) ...E[1:43:46 PM]: Reading ./DaikonjTeastvIass.ule2a27n.gd.tErrarcoer.:g zj a(vlai.nel a1n8g0.2O7u7t2O,f M3e4m.o0r2y%E)r r.o.r.: GC overhead limit exceeded at daikon.FileIO.read_data_trace_files(FileIO.java:1006) at daikon.FileIO.read_data_trace_files(FileIO.java:965) at daikon.Daikon.process_data(Daikon.java:1859) at daikon.Daikon.mainHelper(Daikon.java:573) at daikon.Daikon.main(Daikon.java:453) Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded at java.util.regex.Pattern$BnM.optimize(Pattern.java:5408) at java.util.regex.Pattern.compile(Pattern.java:1709) at java.util.regex.Pattern. at java.util.regex.Pattern.compile(Pattern.java:1054) at java.lang.String.replace(String.java:2239) at daikon.VarInfoName.parse(VarInfoName.java:78) at daikon.VarInfoName.parse(VarInfoName.java:110) at daikon.VarInfoName.parse(VarInfoName.java:110) at daikon.VarInfoName.parse(VarInfoName.java:110) at daikon.VarInfoName.parse(VarInfoName.java:84) at daikon.VarInfo. at daikon.VarInfo.origVarInfo(VarInfo.java:690) at daikon.Daikon.create_orig_vars(Daikon.java:1558) at daikon.Daikon.init_ppt(Daikon.java:1393) at daikon.FileIO.read_data_trace_record(FileIO.java:1637) at daikon.FileIO.read_data_trace_file(FileIO.java:1489) at daikon.FileIO.read_data_trace_files(FileIO.java:987) ... 4 more [1:43:48 PM]: Reading ./DaikonTestIssue227.dtrace.gz (line 1802772, 34.02%) ... The input of FailureDoc is a sequence. In this case, we manually create below sequence as its input. However, FailureDoc says that the sequence has not error and does not give any explanation. START SEQUENCE var0 = prim : int:5 : var1 = prim : int:15 : var2 = prim : int:50 : var3 = cons : org.joda.time.MonthDay. var4 = method : org.joda.time.MonthDay.plusDays(int) : var3 var2 END SEQUENCE
http://www.joda.org/joda-time/
Issue 227: https://github.com/JodaOrg/joda-time/issues/227
Problem:
MonthDay.plusDays does not return the expected value when adding a number of days that would cause the month to rollover more than once
Test case:
expected output:
50 days after 5-15 should be 7-4
instead,
d.plusDays(50) gives 6-4
The first five results are not output since Ziyuan can't find a good bug explanation there. The next two are not output because selective sampling failed to refine the predicate. The following is thus the result:
-1.0*days-1.0*iValues[1] >= -62.0 (org.joda.time.MonthDay:616)
We remark that this line a bit far from where the bug is because the bug is contained in a big recursive method, which Ziyuan avoids to search for bug understanding for now.
The following line:
int curMonth0 = partial.getValue(0) - 1;
should be changed to the following instead.
int curMonth0 = values[0] - 1;