mimalloc-bench icon indicating copy to clipboard operation
mimalloc-bench copied to clipboard

Add a timeout for binaries in the security benchmark

Open jvoisin opened this issue 3 years ago • 4 comments

Since we're testing for memory corruption, some tests might result in infinite loops on some allocators, and this behaviour isn't nice™.

jvoisin avatar Aug 26 '22 12:08 jvoisin

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

mjp41 avatar Aug 26 '22 14:08 mjp41

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

jvoisin avatar Aug 26 '22 18:08 jvoisin

Less cryptic would certainly be good :)

mjp41 avatar Aug 26 '22 20:08 mjp41

Please do send a pull-request then ♥

jvoisin avatar Aug 27 '22 12:08 jvoisin