From ee35981fcbb5b3201b6bb81438814720ae34cc75 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Mon, 1 Feb 2016 22:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=AF=91=E5=99=A8=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84=EF=BC=8C=E5=90=A6=E5=88=99?= =?UTF-8?q?=E6=8A=A5=E6=89=BE=E4=B8=8D=E5=88=B0=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge/compiler.py | 5 ++--- judge/language.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) 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" } }