valo / maycamp_arena

This is the grading system behind http://arena.maycamp.com. It started as a fork of spoj0, but at the end was almost completely reimplemented.
http://openfmi.net/projects/spoj0/
26 stars 14 forks source link

Tony reports that we don't disallow forks #16

Closed slavi closed 15 years ago

slavi commented 15 years ago

This source gets WA, while it should reports sth else (e.g. that we don't allow forks):

#include <unistd.h>
#include <cstdio>

int main()
{
  for (int i = 0; i < 10; i++)
  {
    fork();
  }

  printf("14\n");
  return 0;
}

Similarly, this source gets TL:

#include <unistd.h>

int main()
{
  while(true)
  {
    fork();
  }
  return 0;
}

While, again, it should be killed because of the fork-s..

slavi commented 15 years ago

It turns out the grader is working exactly as expected. The way we prevent forks works like this: the call to fork() fails (instead of returning the child's pid, it returns that it failed). So what Tony is seeing is correct - his program is not forking and he's getting WAs/TLEs.