judge-server icon indicating copy to clipboard operation
judge-server copied to clipboard

Add a runtime diagnostic tool for debugging selftest failures

Open Xyene opened this issue 6 years ago • 0 comments

We currently use a very ad-hoc method for debugging runtime failures. A diagnostic tool could address this.

This tool should be able to generate a list of syscalls used by a given runtime, via a new security manager acting somewhat like strace. If an error occurs during selftest, the judge should automatically run the diagnostic tool with the same parameters as the selftest, and save the output to a file. (On Travis, we can dump the contents of this file to standard output at the end of the build job.)

The file should contain, at least:

  • A list of syscalls used, as well as which syscalls would have been denied under chroot. See minjail's seccomp filter autogeneration script for inspiration.
    • Possible format: syscall_name: (allowed|denied)
    • The latter part might be difficult, since cptbox is currently set up to kill on a syscall denial — it can be added later, or the kill logic can be brought up into Python and overridden
  • Resource usage, in a \time-like format.

Of course, this tool should also be runnable standalone, to speed up the adding of new runtimes.

Xyene avatar Apr 25 '19 02:04 Xyene