From 6276627ee18cf288103c460bd72b68f50c09a588 Mon Sep 17 00:00:00 2001 From: Yang Gao <6821729+criyle@users.noreply.github.com> Date: Mon, 30 Oct 2023 06:23:44 +0800 Subject: [PATCH] judge: add limit to stack when strict_memory enabled (#681) --- packages/hydrojudge/src/sandbox.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hydrojudge/src/sandbox.ts b/packages/hydrojudge/src/sandbox.ts index 57b9ab6c..23fb86f2 100644 --- a/packages/hydrojudge/src/sandbox.ts +++ b/packages/hydrojudge/src/sandbox.ts @@ -101,7 +101,7 @@ function proc(params: Parameter): Cmd { clockLimit: 3 * cpuLimit, memoryLimit: Math.floor(memory * 1024 * 1024), strictMemoryLimit: getConfig('strict_memory'), - // stackLimit: memory * 1024 * 1024, + stackLimit: getConfig('strict_memory') ? Math.floor(memory * 1024 * 1024) : 0, procLimit: params.processLimit || getConfig('processLimit'), copyOutMax: Math.floor(1024 * 1024 * stdioLimit * 3), copyIn,