Skip to content

Commit

Permalink
[Fix] ulimit option (#130)
Browse files Browse the repository at this point in the history
ulimitのオプションを`-v`から`-m`へ変更しました
  • Loading branch information
ocha98 authored Dec 6, 2023
1 parent 68dfbcf commit 4ead30a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mojacoder-backend/judge-image/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func run(definition LanguageDefinition, stdin io.Reader, stdout io.Writer, stder
var result RunResult
var err error
additional_memory := 5 * 1024
command := fmt.Sprintf("ulimit -u 32 -v %d && timeout --preserve-status -sSIGKILL %d %s; EXIT_CODE=$?; kill -SIGKILL -1; wait; exit $EXIT_CODE", memoryLimit+additional_memory, timeLimit, definition.RunCommand)
command := fmt.Sprintf("ulimit -u 32 -m %d && timeout --preserve-status -sSIGKILL %d %s; EXIT_CODE=$?; kill -SIGKILL -1; wait; exit $EXIT_CODE", memoryLimit+additional_memory, timeLimit, definition.RunCommand)
cmd := exec.Command("bash", "-c", command)
cmd.Env = []string{}
cmd.Dir = TEMP_DIR
Expand Down

0 comments on commit 4ead30a

Please sign in to comment.