-
Notifications
You must be signed in to change notification settings - Fork 23
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
Finding a better solution instead of simply using check_call
#3
Comments
i am working on a fix to at least get rid of |
https://github.com/ise-uiuc/nnsmith/blob/main/nnsmith/graph_input_gen.py#L38 Made a commit to use real fork. Still need to understand the reason of hangs to further improve this to a single-process mode for best efficiency and engineering convenience. BTW, inconsistency in code is bad so we might want to stop using/migrate |
Though not sure what functionality you desire, one alternative I tried is to use nnsmith/nnsmith/graph_input_gen.py Line 28 in 2a487d5
So if what you meant by fork and IPC is what I described, then the 3 problems above may be worth noting. |
@lazycal What I mean by "stateful" is that: say coverage guided fuzzing, we need to let the generation function in the subprocess know the coverage change. But it is not quite good to pass the coverage information through command lines (i.e., |
@lazycal Yeah. my new implementation has the exact functionality of a new process. e.g., timeout, etc. Check here. https://github.com/ise-uiuc/nnsmith/blob/main/nnsmith/graph_input_gen.py#L66 But it becomes much easier as you can simply dispatch a subprocess to execute a python function with real forking (e.g., copy-on-write, isolation, IPC, etc.). |
Data communication can be done using shared variables so that we don't have to ship everything into the disk which is slow and inconvenient. Check here: https://github.com/ise-uiuc/nnsmith/blob/main/nnsmith/graph_input_gen.py#L58 |
Just read your code. It looks like you are doing the same thing as the |
Regarding reproducibility you mean |
BTW, it is important to accurately locate why it hangs. If it is an issue of our operators, then we might need to come up with some ideas to solve it. We should definitely report it to z3 community if you believe it is a bug by z3. From my last hang experience, it is due to the operators (i.e., Reshape5D). You can try to diagnose it by printing the constraint expressions and try to write some manual and simple z3 expressions including the patterns to see if it is slow. Last time I tried "abcd = ef*g" which is very slow that I thought it was not an issue from z3 but the expressions themselves. |
Probably not beacause of seed, but z3's problem. When I tried the fork approach, I find there are some generation failures (timeout) and when I fed the same seed into
I think z3 is really not stable. I found many weird z3 problems before, so in my mind hang in z3 is not surprising and a must to be handled. That's also why I am more inclined to believe it's a z3 issue and didn't prioritize locating hangs... I will probably do it next week though. |
I understood that z3 is unstable if we use some uncommon features ( I do think this is important to fix as any of our results will not be reliable if the code logic from ours or z3 is wrong. I will also help investigate this case to see if it is a z3 issue or some lagging operators. |
Eval doc improvement
nnsmith/nnsmith/graph_input_gen.py
Line 93 in 2a487d5
It is not a good workaround to use
check_call
here which:We can discuss better solutions in this thread.
Previously my implementation makes the generation phase in-process which works well. It seems there are some issues regarding timeout and generation failure.
check_call
to allow stateful fuzzing;We can discuss more in this thread.
The text was updated successfully, but these errors were encountered: