DOMjudge / domjudge

DOMjudge programming contest jury system
https://www.domjudge.org
GNU General Public License v2.0
712 stars 250 forks source link

C++ compile runguard error after upgrade to v5.3.1 #310

Closed myungwoo closed 6 years ago

myungwoo commented 6 years ago

There is the simple c++ code

#include <cstdio>
int main(){ puts("Hello, world!"); }

It throws COMPILE-ERROR since there's the runguard error.

The log files in judgings directory show as below: compile.meta

memory-bytes: 168964096
internal-error: runguard error

compile.out

Compiling failed with exitcode 255, compiler output:

compile.tmp

(Empty)

Actually, in compile directroy well-compiled executable was there.

Is there something different installing DOMjudge between v5.3.0 and v5.3.1? Or is it just a bug?

Please check and give me a fast answer since our ICPC regional will be start at next week. :( Thank you very much!

eldering commented 6 years ago

A nearly identical problem was reported on IRC, so likely a regression bug.

eldering commented 6 years ago

The only relevant code change between 5.3.0 and 5.3.1 is: https://github.com/DOMjudge/domjudge/commit/bbd05895d83cff22b374a30e749e49ca973b913a Could you try to revert that line and see if it fixes the problem? (To be honest I don't understand how it would.)

eldering commented 6 years ago

Also, could you report the output of cat /proc/cmdline and whether you're running this on a VM?

myungwoo commented 6 years ago

1) I'm running in AWS EC2 device (Ubuntu 16.04). And result of cat /proc/cmdline is as follow:

BOOT_IMAGE=/boot/vmlinuz-4.4.0-1039-aws root=UUID=3e13556e-d28d-407b-bcc6-97160eafebe1 ro console=tty1 console=ttyS0 quiet cgroup_enable=memory swapaccount=1

2) After I remove line added in bbd0589, and it works well. :) Is this a real solution? How about the bug mitigated in 9bad6d6?

Thank you for your kind and fast reply!

eldering commented 6 years ago

I don't understand yet why this extra line in bbd0589 triggers this runguard crash, and I don't even know yet why runguard crashes exactly. Still investigating. Indeed, removing it would reintroduce the bug fixed by this commit (and already mitigated by 9bad6d6, but only so in master), but I've not heard of other people who were affected by it than me. So an alternative to mitigate/fix the original bug is to apply https://github.com/DOMjudge/domjudge/commit/9bad6d6dd02542ebbfbccfa0115217d2f7dad968 to runguard.c.

myungwoo commented 6 years ago

Okay, please tell me after you find the reason of crash.

By the way, why did you use bbd0589 instead of 9bad6d6?

eldering commented 6 years ago

Because bbd0589 is the proper fix, while 9bad6d6 is only a workaround: it leaves many unclosed cgroup directories, but since the names are unique, they are not reused.

myungwoo commented 6 years ago

Oh, okay. May I ask your plan for v5.3.2 about this bug? Hmm... and expected release schedule?

eldering commented 6 years ago

If you urgently need it fixed, I recommend switching back to 5.3.0: the difference is only this and a minor issue with downloading testdata files, and some documentation changes. I'd plan a 5.3.2 release once we understand exactly what the problem and proper fix is.

myungwoo commented 6 years ago

Okay, thank you for your kind reply. I'll use 5.3.0 next week. :) And thank you for your service.