-
Notifications
You must be signed in to change notification settings - Fork 114
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
boogie does not terminate #993
Comments
It appears the problem here also manifests by ever growing memory (Boogie grows over 100g in some cases). Any idea what could cause this, and a possible option to turn off/on to prevent the memory growth? |
cc @shazqadeer |
The file is large. There is no magic. If I were to debug this problem, I would start by trying to minimize the size while not losing the issue. Can you try to do a bit of this? Then I will also try to help. How many verification problems are present in the file? Is there any non-linear arithmetic? If not, most likely the problem is due to quantifiers. |
The problem is not z3 here, with quantifiers and the like, but Boogie. We are observing that boogies memory grows unbounded (100GB and growing). Wondering what could cause this? Is there an algorithm inside Boogie which does constant rewriting of the VC such that it grows without bounds? We are used to this from Z3 but not from Boogie. We also seeing no active z3 instance running and still Boogie using compute. |
Thanks for that clarification. Very interesting! I will take a look. |
Here is another boogie.bpl (1).txt which should clearly show the memory explosion, run as:
|
This thing actually verifies sometimes but othertimes finishes with SIGKILL, I guess because out of memory. It may pass on your machine, but on my Mac I can see with Activity Monitor how it goes over 100GB |
I tried the first file @rahxephon89 supplied. Boogie has been running on my Mac for about 12 minutes now and the memory consumption of Boogie appears to be holding steady at 2GB. |
To summarize our observation:
Perhaps these two issues are separate, perhaps have some related cause? Thank you for any help. Unfortunately it is pretty hard to reproduce which of the tons of formulas causes it and which feature interaction contributes. |
@shazqadeer Here is a smaller example: boogie-bug.bpl.txt. It seems that procedure |
In the first file that @rahxephon89 provided (titled boogie.bpl), line 58806 has a very large expression (more than 1700 nested occurrences of ConcatVec). It appears that you are trying to translate a very large constant vector. When I stepped through the debugger, I noticed a "hang" in Boogie VC generation at the place where this expression is being translated. This is even before the VC is being sent to the SMT solver. You should be able to replicate this problem by running boogie with the following options:
The This behavior is surprising to me. Even though the expression is large, I expect expression translation to have linear complexity. So it should not appear to "hang". |
If you would like to help debug the issue further, you could do the following:
Otherwise, I will try to make progress as I find time. Are you blocked on this issue? You could consider getting unblocked for now by replacing the large constant vector with an uninterpreted constant. Perhaps the correctness of your program does not depend on the constant vector value. |
Shaz, thanks for looking into this. The first example is actually not blocking us right now, but the 2nd example I provided, where Boogie's memory goes over 100GB, brings us close to the point where we need to turn the Move prover off. We have worked around it by sharding verification in multiple Boogie files (so it only goes up to 80GB and passes on CI), but that seems fragile until a further butterfly. As a background, we are creating large Boogie files with huge constants since years and never run into problems. Given the automatic generation of Boogie from Move, we can't just turn a constant easily into an uninterpreted function. But we will take a look for other solutions. Could you confirm that in the internal architecture of Boogie, such large memory growth is something which could even happen outside of a bug? My understanding until now was there is no non-linear term rewriting or similar happening in Boogie. |
Hi @shazqadeer, the memory issue has been mitigated by making specs more opaque. I will try to debug the first issue and get back to you once there is anything interesting found. Thanks! Update: confirmed that removing all large vector constants makes verification go through. |
Hey, while we have now a feasible workaround, I'm still wondering whether we are hitting expected Boogie behavior or a bug: Is Boogie expected to do term rewritings / SMTLib generation which can become very large, effectively hanging or running out of memory? I'm asking this because I've never seen this before in the 6 years we are using it now for the Move prover. This would be important to know to inform ongoing Boogie based designs. |
Hi, when I tried to verify the following program boogie.bpl using the command:
boogie got stuck without terminating. Any hints on why it happens and/or how to debug it further? Thanks!
System spec:
The text was updated successfully, but these errors were encountered: