Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmoj/java-sandbox-agent
Java class sandbox with instrumentation support for online judges.
https://github.com/dmoj/java-sandbox-agent
instrumentation java online-judge policy sandbox
Last synced: 2 months ago
JSON representation
Java class sandbox with instrumentation support for online judges.
- Host: GitHub
- URL: https://github.com/dmoj/java-sandbox-agent
- Owner: DMOJ
- License: agpl-3.0
- Created: 2017-11-26T00:44:02.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-22T16:56:19.000Z (about 1 year ago)
- Last Synced: 2024-04-16T06:54:07.318Z (10 months ago)
- Topics: instrumentation, java, online-judge, policy, sandbox
- Language: Java
- Homepage: https://dmoj.ca
- Size: 46.9 KB
- Stars: 3
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# java-sandbox-agent [![Build Status](https://github.com/DMOJ/java-sandbox-agent/workflows/build/badge.svg)](https://github.com/DMOJ/java-sandbox-agent/actions/)
Java class sandbox with instrumentation support for online judges.It implements:
* a much faster, [unsynchronized ASCII-only `System.out` stream](https://github.com/DMOJ/java-sandbox-agent/blob/master/src/main/java/ca/dmoj/java/UnsafePrintStream.java) that's suitable for single-threaded online-judging scenarios
* support for **disallowing particular classes from being loaded**, to force certain solutions trivialized by the standard library
* optional **unbuffering of standard output**, for interactive problems without requiring users to flush manually
* logging of exceptional exits to a state file## Usage
To run a class `Submission` with agent the following suffices:
```
$ java -client -javaagent:/code/java-sandbox-agent.jar=[option, ...] Submission
```Supported fields for the `option` list are:
* `nobigmath` — disables `BigInteger` and `BigDecimal`, raising [appropriate exceptions](https://github.com/DMOJ/java-sandbox-agent/blob/master/src/main/java/ca/dmoj/java/BigIntegerDisallowedException.java) if they are used
* `unicode` — encodes `System.out` as UTF-8 instead of ASCII, sacrificing performance for Unicode support
* `nobuf` — sets `System.out` as being line-buffered, for interactive problems
* `unsafe` — enables `sun.misc.Unsafe`, which is disabled by default