21 · 2026

Syscall Sandbox Visualizer

ดูทีละขั้นว่า online judge ใช้ fork, setrlimit, seccomp และ execve กันโค้ดอันตรายอย่างไร ลองส่งลูปไม่รู้จบหรือ fork bomb แล้วดูผลได้เลยStep through how an online judge uses fork, setrlimit, seccomp and execve to contain hostile code — try an infinite loop or a fork bomb.

sandbox/index.ts
// ทุก scenario เริ่มด้วยลำดับเดียวกันconst setup = [fork, rlimitCpu, rlimitMem,               seccompLoad, execve];export function simulate(id: ScenarioId) {  return [...setup, ...RUNS[id]().steps];}
21SCENARIOS5

ทำไมถึงทำ

ต่อยอดจากโปรเจกต์วิชา Operating Systems (Secure Code Judge Sandbox) — อธิบายเรื่อง system call ด้วยคำพูดอย่างเดียวเข้าใจยาก เลยทำเป็นภาพที่กดเดินทีละขั้นได้

ทำงานอย่างไร

  • ตัวจำลองเป็นฟังก์ชัน TypeScript ล้วน simulate(scenario) คืนลำดับ system call และผลตัดสิน (AC / TLE / MLE / SV)
  • มี unit test ตรวจว่าทุก scenario เรียก fork → setrlimit → seccomp → execve ตามลำดับ และจบด้วย wait4
  • UI แยกบทบาท judge / process ลูก / kernel ให้เห็นว่าใครทำอะไร

การเข้าถึง

  • เดินทีละขั้นด้วยปุ่มหรือคีย์บอร์ด ไม่มีอะไรเล่นเองโดยไม่ได้กด
  • ทุกขั้นประกาศผ่าน screen reader (aria-live)
  • ถ้าตั้ง "ลดการเคลื่อนไหว" จะไม่มีแอนิเมชัน

Why

A spin-off of my Operating Systems course project (Secure Code Judge Sandbox). System calls are hard to explain in words, so this turns the sequence into something you can step through.

How it works

  • The simulator is a pure TypeScript function, simulate(scenario), returning the syscall sequence and a verdict (AC / TLE / MLE / SV)
  • Unit tests check that every scenario runs fork → setrlimit → seccomp → execve in order and ends with wait4
  • The UI separates the judge, the child process and the kernel so you can see who does what

Accessibility

  • Step with buttons or the keyboard — nothing auto-plays unless you press Play
  • Every step is announced to screen readers (aria-live)
  • No animation when "reduce motion" is on