Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Preventing process from ignoring resource limits

0 views
Skip to first unread message

anomit

unread,
Jun 25, 2009, 1:35:42 PM6/25/09
to
Hi,

I'm trying to develop an online judge, like the one you'd find at SPOJ
(www.spoj.pl). I've some doubts about a specific part of the program.
The compilation is done on the server by exec()ing gcc with the source
file as its argument in a forked process. Now, a CPU time limit is
placed on the forked process using setrlimit() and on exceeding the
limit, a SIGXCPU is sent to the forked process.

Suppose someone writes a malicious code that handles the SIGXCPU
signal, so the program could basically ignorte the signal and continue
running.

What can I do to avoid this?

David Schwartz

unread,
Jun 25, 2009, 2:18:14 PM6/25/09
to
On Jun 25, 10:35 am, anomit <anomit.gh...@gmail.com> wrote:

> Suppose someone writes a malicious code that handles the SIGXCPU
> signal, so the program could basically ignorte the signal and continue
> running.
>
> What can I do to avoid this?

Exceeding the soft limit for CPU usage is not malicious. That's what
makes it a soft limit.

DS

Jasen Betts

unread,
Jun 26, 2009, 6:41:32 AM6/26/09
to

you don't need to avoid it you only need to detect it.
make a rule against it, if detect abuse you can disqualify the
competitor.

0 new messages