-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
null pointer exception running logical compare (orig variables) #70
Comments
Additional notes from an email dated 4/21/2015: I've looked at several of the daikon-tests and they all fail with null pointer asserts. In every case it was the VarInfo.enclosing_var field not being set (but the asserts were in different locations). I used 'fib' as my test case and here is the tail end of the console log (I've added some print statements to provide additional info): New VarInfo: orig(args.getClass()) ppt: null enclosing_var: null So I looked in VarInfo.java at lines 661-724 where this 'orig' VarInfo is created. (Not all 'orig' VarInfos are created here; that's another issue confusing me - but not important for this problem.) The comment on the constructor (called at line 690; defined at 299) specifically says it does not set ppt or enclosing_var fields. I think a call "result.relate_var();" added at the end of the routine would set enclosing_var; but it requires ppt to be set first and I cannot figure out the proper way to do that. Here is a change to daikon-tests/Makefile you need: Targets that descend to child directories-clean clean-output txt-diff txt-daikon-suppress-diffed txt-suppress txt-daikon txt-chicory update-goals txt-all merge stats instrument compile diffs inv-checker list-targets chicory chicory-diff esc jml inv txt-daikon-diff txt-chicory-diff spinfo-static dyncomp dyncomp-diff txt-simplify txt-simplify-diff txt-csharpcontract txt-csharpcontract-diff txt-repair-diff txt-esc txt-esc-diff txt-jml-diff txt-merge-diff txt-jaif-diff txt-jaif rtc rtc-diff: This allows you to go to any daikon-tests subdirectory and say 'make txt-logicalcompare'. For what its worth, here are the debug print statements I added to VarInfo.java:
// At an exit point, parameters are uninteresting, but orig(param) is not. +System.out.println("str_name: " + str_name() + ", name: " + name() + ", enclosing_var: " + enclosing_var); That first insert was an initial change I made - I think testing result_vardef is incorrect - but I commented it out to keep things constant for further debugging. |
In directory daikon/tests/daikon-tests/fib:
make clean diffs
make txt-logicalcompare
tail of fib.txt-logicalcompare-failed:
Testing preconditions:
Testing postconditions:
Exception in thread "main" java.lang.NullPointerException at daikon.VarInfo.simplify_name(VarInfo.java:3364) at daikon.VarInfo.simplify_name(VarInfo.java:3338) at daikon.VarInfo.name_using(VarInfo.java:3080) at daikon.inv.unary.string.OneOfString.format_simplify(OneOfString.java:423) at daikon.inv.unary.string.OneOfString.format_using(OneOfString.java:241) at daikon.simplify.InvariantLemma.(InvariantLemma.java:21) at daikon.simplify.InvariantLemma.makeLemmaAddOrig(InvariantLemma.java:70) at daikon.tools.compare.LogicalCompare.translateAddOrig(LogicalCompare.java:208) at daikon.tools.compare.LogicalCompare.comparePpts(LogicalCompare.java:478) at daikon.tools.compare.LogicalCompare.mainHelper(LogicalCompare.java:796) at daikon.tools.compare.LogicalCompare.main(LogicalCompare.java:558)
The exception seems to be caused by processing a FUNCTION var_kind and there is no enclosing_var.
The text was updated successfully, but these errors were encountered: