-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
z3 crashes on sys.exit in python #989
Comments
Thanks for reporting this issue! I'm able to reproduce it on Windows as well. Looks like a cleanup problem that should be easy to fix. |
I was never able to reproduce this and I am not sure what the bug would be. |
Just rebuilt from most recent commit (e48e7ef) and it is definitely still happening for me (nondeterministic). running the following is sufficient for me to generate the error
|
Yes, I know what the problem is and what the fix is, but I haven't had time to write down the fix yet. I can reproduce it on my machine, but it's non-deterministic. The fix may also incur extra runtime overhead, so I'll have to run some tests to see how bad that is. (The problem is that Python collects |
…er lib() in function calls Signed-off-by: Nikolaj Bjorner <[email protected]>
Not sure if I properly understood the contract with the Python GC, but here is an attempt at addressing the bug. |
Looks like a reasonable attempt to me, thanks for taking this on! Doesn't this mean we can remove Here's my unedited repro of the original problem with multitudes of options:
It's non-determinstic but fails fairly frequently. The Script to make it run lots of times:
|
Signed-off-by: Nikolaj Bjorner <[email protected]>
|
Just checking whether _lib is still there will produce memory leaks, which may or may not matter for some applications. I think it's unlikely that there are many Python applications for which this will matter though. |
Signed-off-by: Nikolaj Bjorner <[email protected]>
touché |
…on (TravisCI build failure) Signed-off-by: Nikolaj Bjorner <[email protected]>
can this be closed now? I believe this addresses the problem. |
Were you able to reproduce the problem pre-fix and not able post-fix? If not, I suppose I'll have to run some tests to verify that it works as intended now. |
What I could observe was that the GC would collect objects in different orders and this fix is to take care of the different possible orders. |
So, that's a 'no' then, I guess? I'll need a few hours to reproduce the pre-fix state. |
correct, thanks |
Hmm. Sorry, but your changes only changed the GC order, they didn't fix any of the problems:
At the crucial time
Here's my repro:
Run it like so:
For me it doesn't repro using Python 3.6, only 3.5 (x86) at a rate of about 9 runs out of 100. |
Signed-off-by: Nikolaj Bjorner <[email protected]>
Took longer than expected, but now this problem should be fixed. |
Nondeterministically (about %50) terminates with the following output to stderr
If I declare a literal (e.g.
x = z3.BitVec('x', 16)
) in addition to first error I get:My enviroment
Ubuntu 16.04.1 LTS (xenial)
Python 3.5.2
Z3 version 4.5.1 - 64 (commit: 69aa5ca)
The text was updated successfully, but these errors were encountered: