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
URGENT: JML rac "Internal Bug please report" preventing my teaching JML at RMIT University #255
Comments
I'm working on this promptly. In the meantime, note that the problem relates to using generics (whose implementation is in progress). If you can I suggest you use an example without generic types until this problem is repaired. Original comment by: davidcok |
Another workaround is to make pos an int instead of an Integer. Original comment by: davidcok |
Hi David I have removed all generics and changed boxed types to their primitive counterparts. The IndexOutOfBounds exception has gone and now the java files are compile into class files (this is good progress) but I still get the following errors saying assertions are not implemented and indeed no assertions are run when I run my test cases which trigger contract violations. See the command below and the files attached. w8097129:openjml keith$ java -jar openjml.jar -rac ListSeq.java Seq.java Please let men know what I’m doing wrong. CheersKeith Foster On 25 Apr 2014, at 7:44 am, David Cok davidcok@users.sf.net wrote:
Original comment by: keith-foster |
Hi David Actually I was running a non-intrumented version of the classes in IntelliJ IDEA which did its own compiling without JML instrumentation) and located the class files in a different place. This explains why no assertions happened. I am now running everything on the command line and have converted the test class from groovy to plain java and JUnit 4.11. However, the test code hangs (on the “.E.E.E.”) every time a JML instrumented method is called. See the command history below (and latest files attached) : w8097129:openjml keith$ java -jar openjml.jar -command rac -racCompileToJavaAssert ListSeq.java Seq.java Keith Foster On 26 Apr 2014, at 2:05 pm, Keith Foster keith.foster@rmit.edu.au wrote:
Original comment by: keith-foster |
Keith - I see your following email, but to comment on this one: The messages "
From: Keith keith-foster@users.sf.net Hi David
[bugs:#402] URGENT: JML rac "Internal Bug please report" preventing my teaching JML at RMIT University java -jar openjml.jar -rac ListSeq.java Seq.java (see full error text attached) Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jmlspecs/bugs/402/ Original comment by: davidcok |
note: I’m not using any quantified expressions.Keith Foster On 27 Apr 2014, at 2:52 am, David Cok davidcok@users.sf.net wrote:
Original comment by: keith-foster |
forwarded email with java test caseKeith Foster Begin forwarded message:
Original comment by: keith-foster |
Keith, I created a standalone test harness that calls your tests. I think the following will get you working for your class, while I fix the missing checks you exposed, run the test suite and publish a current updated version (which will take a few days). -David Try the following:
These are the commands I'm running: For good measure I'm attaching the files that work for me, both with the current unstable version and the released version. Original comment by: davidcok |
Hi David Thank you. I have overcome the previous problems and I have triggerred some runtime contract violations. However, It appears ensures with \result is ignored. See the test for pos(). It should trigger a violation of the ensures but does not. I am attaching the three files cleaned up and with headings prated for each test case. Keith Foster On 27 Apr 2014, at 6:03 pm, David Cok davidcok@users.sf.net wrote:
Original comment by: keith-foster |
Keith, I'm not seeing why testPos() should trigger a postcondition error.
Original comment by: davidcok |
On second thought I see you meant testViolationPos. It is actually the precondition test that is silently ignored. You will see it if you compile the test framework with RAC.
Original comment by: davidcok |
Keith, I should have explained a bit more. A method is permitted to assume that it is called with its preconditions holding. It is the caller's job to be sure that they do. Since SeqTest was not compiled with RAC, it did not check or report the precondition failure. There are two options:
It is reasonable to think that option #2 should be the default, to avoid surprises like this one. If it is the default, then every pre and post condition is by the caller and by the callee, if they are both compiled with RAC. So when both are compiled with RAC, we get double reports of checks and much larger instrumented files (since many more checks are compiled in). In some cases the instrumented files become too big for the compiler. So for now it is not the default, but I see it leads to confusion when working with test drivers. -racCheckAssumptions is your helper here.
From: David Cok davidcok@users.sf.net On second thought I see you meant testViolationPos. [bugs:#402] URGENT: JML rac "Internal Bug please report" preventing my teaching JML at RMIT University java -jar openjml.jar -rac ListSeq.java Seq.java (see full error text attached) Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jmlspecs/bugs/402/ Original comment by: davidcok |
Hi David Thank you very much. I got a full working example of DbC using JML after your last email. Hopefully the students will spread the word on JML. Cheers and Thanks for your immense help. :-)Keith Foster On 27 Apr 2014, at 11:33 pm, David Cok davidcok@users.sf.net wrote:
Original comment by: keith-foster |
Excellent. I'm glad it went well. And I have some things to fix (once I get the SMTCOMP organized :-).
From: Keith keith-foster@users.sf.net Hi David
[bugs:#402] URGENT: JML rac "Internal Bug please report" preventing my teaching JML at RMIT University java -jar openjml.jar -rac ListSeq.java Seq.java (see full error text attached) Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jmlspecs/bugs/402/ Original comment by: davidcok |
Original comment by: davidcok |
This example compiles OK in current OpenJML - see sf402 in racfiles. Closing the issue |
I am compiling a simple demo with JML annotations and I get an internal error :
java -jar openjml.jar -rac ListSeq.java Seq.java
ListSeq.java:47: Note: Runtime assertion checking is not implemented for this type or number of declarations in a quantified expression
}
^
ListSeq.java:47: Note: Runtime assertion checking is not implemented for this type or number of declarations in a quantified expression
}
^
Internal JML bug - please report. BuildOpenJML-20131218-REV3178
java.lang.ArrayIndexOutOfBoundsException: 277
(see full error text attached)
Also find the two source files attached.
Original comment by: keith-foster
The text was updated successfully, but these errors were encountered: