QingdaoU / Judger

Online judge sandbox based on seccomp | OnlineJudge 安全沙箱

Home Page:https://qduoj.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More CPU Time then allowed

rrutwik opened this issue · comments

Submission is taking approx 900 to 1000 ms more than allowed CPU TIME, for all languages.(Tested with infinite loops)
Also, how can CPU time be less than real-time? Any suggestion on what could have gone wrong?
Correct Answer:- {'cpu_time': 89, 'real_time': 74, 'memory': 28536832, 'signal': 0, 'exit_code': 0, 'error': 0, 'result': 0}
Time Limit :- {'cpu_time': 1985, 'real_time': 1969, 'memory': 28913664, 'signal': 9, 'exit_code': 0, 'error': 0, 'result': 1}

https://github.com/QingdaoU/Judger/blob/newnew/src/child.c#L60

https://github.com/QingdaoU/Judger/blob/newnew/src/runner.c#L135

because setrlimit only supports second, so we should covert the limit to second ( for example: 100ms to 1s) and then check again at the end.

However, I don't fully understand your question, feel free to add comment in this issue.