-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
_timeout_fn() still being called after emulation finishes #78
Comments
can you send a PR to put your code under regress/ directory? thanks. |
aquynh
added a commit
that referenced
this issue
Aug 29, 2015
add sample regression code for issue #78
Wait, won't this block until the timeout is done even if you have an error? I don't think that's good behavior. |
no block, since in that case we signal the timer to quit immediately. this is done by setting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I modified samples/sample_arm.c to use a 5-second timeout when calling uc_emu_start(). This caused it to segfault intermittently while calling uc_emu_start() for the second emulation session (the one in test_thumb()).
It looks like this happened because the emu timer tried to call uc_emu_stop() on the previous emulation session (the one in test_arm()), which had already been cleaned up by that point. This led to a null dereference in cpu_exit() looking pretty similar to #65, but with a different cause:
It sounds like there should be a check in uc_emu_start() to see if emulation ends before the emu timer fires. If that does happen, uc_emu_start() should disable the timer so that it won't call _timeout_fn() after emulation is already over.
The text was updated successfully, but these errors were encountered: