diff --git a/judge/compiler.py b/judge/compiler.py index 3643bd0e..8e741ecb 100644 --- a/judge/compiler.py +++ b/judge/compiler.py @@ -2,7 +2,6 @@ import time import os import judger -import commands from judge_exceptions import CompileError, JudgeClientError from logger import logger from settings import judger_workspace @@ -14,11 +13,11 @@ def compile_(language_item, src_path, exe_path): compile_args = compile_command[1:] compiler_output_file = os.path.join(judger_workspace, str(time.time()) + ".out") - compile_result = judger.run(exe_path=compiler, + compile_result = judger.run(path=compiler, in_file="/dev/null", out_file=compiler_output_file, max_cpu_time=2000, - max_memory=200000000, + max_memory=2000000000, args=compile_args, env=["PATH=" + os.environ["PATH"]], use_sandbox=False) diff --git a/judge/language.py b/judge/language.py index e6406566..4f5658bb 100644 --- a/judge/language.py +++ b/judge/language.py @@ -7,7 +7,7 @@ languages = { "src_name": "main.c", "code": 1, "syscalls": "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync,sync_file_range:k,syncfs:k,unshare:k,setns:k,clone:k,query_module:k,sysinfo:k,syslog:k,sysfs:k", - "compile_command": "gcc -DONLINE_JUDGE -O2 -w -std=c99 {src_path} -lm -o {exe_path}/main", + "compile_command": "/usr/bin/gcc -DONLINE_JUDGE -O2 -w -std=c99 {src_path} -lm -o {exe_path}/main", "execute_command": "{exe_path}/main" }, 2: { @@ -15,7 +15,7 @@ languages = { "src_name": "main.cpp", "code": 2, "syscalls": "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync,sync_file_range:k,syncfs:k,unshare:k,setns:k,clone:k,query_module:k,sysinfo:k,syslog:k,sysfs:k", - "compile_command": "g++ -DONLINE_JUDGE -O2 -w -std=c++11 {src_path} -lm -o {exe_path}/main", + "compile_command": "/usr/bin/g++ -DONLINE_JUDGE -O2 -w -std=c++11 {src_path} -lm -o {exe_path}/main", "execute_command": "{exe_path}/main" }, 3: { @@ -23,7 +23,7 @@ languages = { "src_name": "Main.java", "code": 3, "syscalls": "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync,sync_file_range:k,syncfs:k,unshare:k,setns:k,clone[a&268435456==268435456]:k,query_module:k,sysinfo:k,syslog:k,sysfs:k", - "compile_command": "javac {src_path} -d {exe_path}", + "compile_command": "/usr/bin/javac {src_path} -d {exe_path}", "execute_command": "java -cp {exe_path} -Djava.security.manager -Djava.security.policy==policy Main" } }