klee icon indicating copy to clipboard operation
klee copied to clipboard

Solver timeout inconsistency

Open paulmar opened this issue 10 years ago • 5 comments

Right now the --max-solver-time option accepts a double argument. However, that argument is truncated to an integer before calling the solver because the timer is enforced by means of alarm(unsigned seconds). This might cause confusion and also makes the minimum solver timeout 1 second.

Confusion can be avoided by making the --max-solver-time take an integer or we can be more flexible by using setitimer.

paulmar avatar Jul 08 '14 14:07 paulmar

Good catch. We should definitely implement one of these solutions. I guess the setitimer is indeed more flexible. Do you want to write a patch implementing one of them?

ccadar avatar Jul 08 '14 21:07 ccadar

@251 I believe this very old issue was solved by the new time API you contributed a couple of years back. This being said, I still see a few alarm calls in the codebase. Is this issue still present after your changes?

ccadar avatar Sep 03 '20 19:09 ccadar

@ccadar Yes, upstream still uses alarm and is limited to seconds. MoKlee has a sigtimedwait implementation though - shall I create a PR?

251 avatar Sep 04 '20 09:09 251

@251 thanks. Would sigtimedwait work on macOS and FreeBSD? Maybe you can use sigwait instead?

ccadar avatar Sep 04 '20 17:09 ccadar

@ccadar sigtimedwait is part of POSIX and sigwait is implemented on top of sigtimedwait in Linux acc. to the man page. Should work for all of them.

251 avatar Sep 05 '20 12:09 251