@@ -270,13 +270,17 @@ auto TaskJudger::traditionalTaskPrepare() -> bool {
270270
271271 if (! isJudging) {
272272 compilerProcess.kill ();
273+ compilerProcess.waitForFinished (3000 );
273274 return false ;
274275 }
275276 }
276277
277278 if (! flag) {
278279 compilerProcess.kill ();
280+ compilerProcess.waitForFinished (3000 );
279281 compileState = CompileTimeLimitExceeded;
282+ LOG (" traditionalTaskPrepare: compile TIMEOUT for "
283+ << contestantName.toStdString ());
280284 } else if (compilerProcess.exitCode () != 0 ) {
281285 compileState = CompileError;
282286 compileMessage =
@@ -320,6 +324,9 @@ auto TaskJudger::traditionalTaskPrepare() -> bool {
320324 }
321325
322326 if (compileState != CompileSuccessfully) {
327+ LOG (" traditionalTaskPrepare FAILED: compileState=" << static_cast <int >(compileState)
328+ << " contestant=" << contestant->getContestantName ().toStdString ()
329+ << " task=" << task->getProblemTitle ().toStdString ());
323330 emit compileError (task->getTotalTimeLimit (), static_cast <int >(compileState));
324331 return false ;
325332 }
@@ -330,7 +337,13 @@ auto TaskJudger::traditionalTaskPrepare() -> bool {
330337void TaskJudger::judgeIt () {
331338 qDebug () << " Start Judging" ;
332339 emit judgingStarted (task->getProblemTitle ());
333- if (judge ()) {
340+ int judgeResult = judge ();
341+ LOG (" judgeIt: contestant=" << contestant->getContestantName ().toStdString ()
342+ << " task=" << task->getProblemTitle ().toStdString ()
343+ << " judge()=" << judgeResult
344+ << " compileState=" << static_cast <int >(compileState)
345+ << " result.size()=" << result.size ());
346+ if (judgeResult) {
334347 contestant->setCheckJudged (taskId, true );
335348 contestant->setCompileMessage (taskId, compileMessage);
336349 contestant->setCompileState (taskId, compileState);
@@ -354,8 +367,14 @@ int TaskJudger::judge() {
354367 return 0 ;
355368
356369 if (task->getTaskType () != Task::AnswersOnly)
357- if (! traditionalTaskPrepare ())
370+ if (! traditionalTaskPrepare ()) {
371+ LOG (" judge: traditionalTaskPrepare FAILED for contestant="
372+ << contestant->getContestantName ().toStdString ()
373+ << " task=" << task->getProblemTitle ().toStdString ()
374+ << " compileState=" << static_cast <int >(compileState)
375+ << " result.size()=" << result.size ());
358376 return 1 ;
377+ }
359378
360379 for (int i = 0 ; i < task->getTestCaseList ().size (); i++) {
361380 timeUsed.append (QList<int >());
0 commit comments