-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Python Z3 api solver.check() crashes smt::cancel_exception when memory usage is higher than watermark #7629
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
Comments
this exception is thrown when internalizing expressions into the SMT solver. |
@NikolajBjorner Your intuition is correct. After enabling
this is in python3.12 on macos apple silicon if solver.push went over memory watermark, can we catch and rethrow python z3 exception, so the caller can discard the solver, while continue to use the global context. (I have spawn a child process to handle z3 calculation via a process pool, so if can simply let the solver goes out of scope and create a new solver. all the while using the global context, then i don't have to perform additional process manipulation). Thank you for your insight. |
The wrapper in z3core.py (which is auto-generated) is supposed to check the error code and throw Z3Exception. |
I see the culprit; api_util.h:#define Z3_CATCH_CORE(CODE) } catch (z3_exception & ex) { mk_c(c)->handle_exception(ex); CODE } cancel_exception does not inherit from z3_excption but only std::exception |
I am trying to isolate a smaller smt file to post
I set a memory_high_watermark_mb to control how much memory usage from Python side. During solver.check(), i did encounter the watermark being passed but instead of a z3. instead of check() termiantes with unknown, process actually crash with this on output
libc++abi: terminating due to uncaught exception of type smt::cancel_exception: smt-canceled
The text was updated successfully, but these errors were encountered: