pushkar8723 / aurora

SPOJ like judge to automatically judge the submitted solution.
http://aurora.pushkaranand.com
MIT License
99 stars 81 forks source link

judge closes unexpectedly #9

Closed vozille closed 9 years ago

vozille commented 9 years ago

on judging a program, except .txt files, i get RTE and terminal closes unexpectedly. if there are any compilation errors, they appear all right. I have not set up any jail or virtualenv yet. The terminal also shuts down unexpectedly when i properly close and start the judge

pushkar8723 commented 9 years ago

There security issues if you run your judge outside jail or virtual environment and so I would recommend you to set it up. There are scripts in repo that will setup jail for you. Still if you want to run judge without a jail / vm, you need to ensure that your system is configured properly. For security I kill all processes started by judge user after completion. This might be the reason your terminal is closing.

Following are the step for Debian env.

Steps to set up compilers and interpreters.

# echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > "/etc/apt/sources.list"
# apt-get update
# apt-get install bf bc g++ fpc mono-gmcs openjdk-6-jdk perl php5 python python3 rhino ruby

Since judge depends on psmisc package and requires pymysql for db interaction, following are also required to be installed.

# apt-get install psmisc python3-pip
# pip3 install pymysql

You also need to configure perl

# locale-gen en_US en_US.UTF-8 hu_HU hu_HU.UTF-8
# dpkg-reconfigure locales

Steps to set up environment.

Finally create user 'judge' and change permission of directories to ensure security.

# chmod 700 /tmp
# useradd -m -u 8723 -s /bin/bash judge
# cd /home/judge
# curl -O https://raw.githubusercontent.com/pushkar8723/Aurora/master/Judge/judge.py
# mkdir env io_cache
# chmod 755 env
# chmod 700 io_cache
# chown judge env
# chgrp judge env
# chmod 600 judge.py

Note : You must run judge.py in /home/judge as root user.

vozille commented 9 years ago

I think I should have set up a virtualenv first and then played with creating user.. now I have to reinstall os :|

pushkar8723 commented 9 years ago

There is no step that can screw up your os. What happened?

vozille commented 9 years ago

I was kinda stuck in a login loop and I screwed up from there, even the bios conifg is corrupted now :P .. not much experience with Linux .. will be back though in few days

vozille commented 9 years ago

I will set up virtual env, but first I want to run the judge, just like that.. so I created user judge, but every submission gives TLE , any reasons ?

vozille commented 9 years ago

silly things from my side.. anyways set up virtual env and everything work fine

vozille commented 9 years ago

Thanks for ur help :)