mimalloc-bench
mimalloc-bench copied to clipboard
Add a timeout for binaries in the security benchmark
Since we're testing for memory corruption, some tests might result in infinite loops on some allocators, and this behaviour isn't nice™.
How about something like:
( timeout 1s bash -c "/usr/bin/env $3 ./$binary || echo CRASHED" || echo TIMEOUT ) 2>/dev/null > "$tmpfile"
But I'm not sure what we want to consider success? I am thinking maybe
[+]Doesn't print NOT_CAUGHT and doesn't timeout[t]Doesn't print NOT_CAUGHT and times out[d]Prints NOT_CAUGHT, doesn't timeout, and terminates with an error code[dt]Prints NOT_CAUGHT and times out[-]Prints NOT_CAUGHT and doesn't timeout
t - is a timeout
d - is a delayed failure
https://github.com/mjp41/mimalloc-bench/pull/new/timeout
Shouldn't it be like this instead:
( timeout 1s bash -c "/usr/bin/env $3 ./$binary || echo CRASHED") || echo TIMEOUT 2>/dev/null > "$tmpfile"
I would also take this as an opportunity to reconsider the output, to make it less cryptic :D
Less cryptic would certainly be good :)
Please do send a pull-request then ♥