Giter Site home page Giter Site logo

Comments (17)

zgjava avatar zgjava commented on May 25, 2024

[root@localhost bin]# g++ -v
使用内建 specs。
目标:x86_64-redhat-linux6E
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --disable-gnu-unique-object --enable-languages=c,c++,fortran --disable-libgcj --with-mpfr=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-x86_64-redhat-linux6E/mpfr-install/ --with-ppl=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-x86_64-redhat-linux6E/ppl-install --with-cloog=/builddir/build/BUILD/gcc-4.4.4-20100726/obj-x86_64-redhat-linux6E/cloog-install --with-tune=generic --with-arch_32=i586 --build=x86_64-redhat-linux6E
线程模型:posix
gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)

[root@localhost bin]# gcc -v
使用内建 specs。
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.1.2 20080704 (Red Hat 4.1.2-50)

from moodle-local_onlinejudge.

sunner avatar sunner commented on May 25, 2024

Do all kinds of program get the same result?

from moodle-local_onlinejudge.

zgjava avatar zgjava commented on May 25, 2024

yes,all kinds of program

from moodle-local_onlinejudge.

sunner avatar sunner commented on May 25, 2024

But OJ should never print the string "内部错误!sandbox错误255". What exactly it looks like?

from moodle-local_onlinejudge.

zgjava avatar zgjava commented on May 25, 2024

状态: 内部错误
标准输出* 不可用
标准错误输出* 不可用
编译器输出 不可用
敏感信息* 不可用
信息 沙箱错误:255
CPU使用时间 不可用
内存使用量 不可用

  • 只教师可见

from moodle-local_onlinejudge.

zgjava avatar zgjava commented on May 25, 2024

问题起初是因为升级gcc从4.1.2到gcc4.4.7,发现不能用。现在还原为gcc4.1.2,就出现这个情况

from moodle-local_onlinejudge.

sunner avatar sunner commented on May 25, 2024

Try rerun judged.php . If still the problem, post output of cc -v and gcc -v

from moodle-local_onlinejudge.

zgjava avatar zgjava commented on May 25, 2024

[root@localhost cli]# sudo -u apache php judged.php
Judge daemon successfully created. PID = 12681
[root@localhost cli]# cc -v
使用内建 specs。
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.1.2 20080704 (Red Hat 4.1.2-52)
[root@localhost cli]# gcc -v
使用内建 specs。
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.1.2 20080704 (Red Hat 4.1.2-52)

from moodle-local_onlinejudge.

sunner avatar sunner commented on May 25, 2024

Rerun means you should kill all old judged first

from moodle-local_onlinejudge.

zgjava avatar zgjava commented on May 25, 2024

yes,but yet error

from moodle-local_onlinejudge.

zgjava avatar zgjava commented on May 25, 2024

[root@localhost judge]# cd sandbox/sand && make
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 --static -o stdin_test testcase/stdin.c
make -C libsandbox libsandbox.a
make[1]: Entering directory /usr/local/apache/htdocs/moodle/local/onlinejudge/j udge/sandbox/sand/libsandbox' cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 -shared -fPIC -pthread -D SANDBOX -D NDE BUG -D WITH_NATIVE_TRACER -D WITH_NATIVE_MONITOR -D WITHOUT_TSC_COUNTER -I src - c -o src/platform.o src/platform.c cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 -shared -fPIC -pthread -D SANDBOX -D NDE BUG -D WITH_NATIVE_TRACER -D WITH_NATIVE_MONITOR -D WITHOUT_TSC_COUNTER -I src - c -o src/sandbox.o src/sandbox.c src/sandbox.c: In function ‘__sandbox_tracer’: src/sandbox.c:1030: 警告:标号 ‘next’ 定义后未使用 cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 -shared -fPIC -pthread -D SANDBOX -D NDE BUG -D WITH_NATIVE_TRACER -D WITH_NATIVE_MONITOR -D WITHOUT_TSC_COUNTER -I src - c -o src/symbols.o src/symbols.c ar rcvs libsandbox.a src/platform.o src/sandbox.o src/symbols.o a - src/platform.o a - src/sandbox.o a - src/symbols.o make[1]: Leaving directory/usr/local/apache/htdocs/moodle/local/onlinejudge/ju dge/sandbox/sand/libsandbox'
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 -D SANDBOX -D NDEBUG -D WITH_NATIVE_TRACE R -D WITHOUT_TSC_COUNTER -I ./libsandbox/src -c policy_print.c
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 -D SANDBOX -D NDEBUG -D WITH_NATIVE_TRACE R -D WITHOUT_TSC_COUNTER -I ./libsandbox/src -c sand.c
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 -D SANDBOX -D NDEBUG -D WITH_NATIVE_TRACE R -D WITHOUT_TSC_COUNTER -I ./libsandbox/src -o detector sand.o policy_print.o ./libsandbox/libsandbox.a
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 --static -o 223 223.c
./detect.sh
Detecting syscalls...
INIT_SYSCALLS: 122, 45, 45, 243, 45, 45,
ALLOWED_SYSCALLS: 197, 54, 192, 3, 91, 4, 252,
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 -D SANDBOX -D NDEBUG -D WITH_NATIVE_TRACE R -D WITHOUT_TSC_COUNTER -I ./libsandbox/src -c policy.c
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 -D SANDBOX -D NDEBUG -D WITH_NATIVE_TRACE R -D WITHOUT_TSC_COUNTER -I ./libsandbox/src -o sand sand.o policy.o ./libsandb ox/libsandbox.a
./runtest.sh 1 stdin_test < /dev/null
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 --static -o stdout_test testcase/stdout.c
./runtest.sh 1 stdout_test > /dev/null
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 --static -o fork_test testcase/fork.c
./runtest.sh 2 fork_test
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 --static -o open_test testcase/open.c
./runtest.sh 2 open_test
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 --static -o memlimit_test testcase/memlim it.c
./runtest.sh 3 -l memory=1048576 memlimit_test
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 --static -o cpulimit_test testcase/cpulim it.c
./runtest.sh 5 -l cpu=1000 cpulimit_test
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 --static -o sigsegv_test testcase/sigsegv .c
./runtest.sh 6 sigsegv_test > /dev/null
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 --static -o return1_test testcase/return1 .c
./runtest.sh 7 return1_test
All testcases are OK
make -C libsandbox clean
make[1]: Entering directory /usr/local/apache/htdocs/moodle/local/onlinejudge/j udge/sandbox/sand/libsandbox' rm -rf doc rm -f src/platform.o src/sandbox.o src/symbols.o libsandbox.a libsandbox.so \ libsandbox.so.0.2.18 make[1]: Leaving directory/usr/local/apache/htdocs/moodle/local/onlinejudge/ju dge/sandbox/sand/libsandbox'
rm -f *.o *_test detector 223 policy.c

from moodle-local_onlinejudge.

zgjava avatar zgjava commented on May 25, 2024

[root@localhost cli]# ps -FC php
UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
apache 3322 1 0 53854 54564 0 18:23 ? 00:00:08 php judged.php
apache 12783 1 0 52975 52348 0 21:18 ? 00:00:00 php judged.php
apache 12793 1 0 52085 47188 1 21:18 ? 00:00:00 php judged.php
[root@localhost cli]# kill 3322
[root@localhost cli]# ps -FC php
UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
apache 12783 1 0 52975 52348 1 21:18 ? 00:00:00 php judged.php
apache 12793 1 0 52085 47188 0 21:18 ? 00:00:00 php judged.php
[root@localhost cli]# kill 12783
[root@localhost cli]# ps -FC php
UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
apache 12793 1 0 52085 47188 0 21:18 ? 00:00:00 php judged.php
[root@localhost cli]# kill 12793
[root@localhost cli]# ps -FC php
UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
[root@localhost cli]# sudo -u apache php judged.php
Judge daemon successfully created. PID = 12985
[root@localhost cli]# Judged inner level exception handler: 沙箱错误:255 Debug:

  • line 146 of /local/onlinejudge/judge/sandbox/lib.php: onlinejudge_exception th rown
  • line 95 of /local/onlinejudge/judge/sandbox/lib.php: call to judge_sandbox->ru n_in_sandbox()
  • line 358 of /local/onlinejudge/judgelib.php: call to judge_sandbox->judge()
  • line 171 of /local/onlinejudge/cli/judged.php: call to onlinejudge_judge()
  • line 120 of /local/onlinejudge/cli/judged.php: call to judge_all_unjudged()

Judged inner level exception handler: 沙箱错误:255 Debug:

  • line 146 of /local/onlinejudge/judge/sandbox/lib.php: onlinejudge_exception th rown
  • line 95 of /local/onlinejudge/judge/sandbox/lib.php: call to judge_sandbox->ru n_in_sandbox()
  • line 358 of /local/onlinejudge/judgelib.php: call to judge_sandbox->judge()
  • line 171 of /local/onlinejudge/cli/judged.php: call to onlinejudge_judge()
  • line 120 of /local/onlinejudge/cli/judged.php: call to judge_all_unjudged()

from moodle-local_onlinejudge.

sunner avatar sunner commented on May 25, 2024

I don't know why. Perhaps some libs are broken during changing version of gcc.

Usually, getting All testcases are ok during make means no 255 error should throw.

from moodle-local_onlinejudge.

zgjava avatar zgjava commented on May 25, 2024

升级后,能在shell中运行gcc编译,运行C程序,证明gcc 升级成功的啊

from moodle-local_onlinejudge.

sunner avatar sunner commented on May 25, 2024

这样测试一下吧。弄一个简单的但是255的程序,比如hello.c,然后到命令行这样编译:

gcc -m32 -D_MOODLE_ONLINE_JUDGE_ -Wall -Werror -static -o hello hello.c -lm

然后到sand目录下,运行

./sand /path/to/hello
echo $?

假如最后的输出是255或-1,那么把你的sand和hello都发给我。否则,暂时还想不出什么办法……

from moodle-local_onlinejudge.

zgjava avatar zgjava commented on May 25, 2024

我终于找到原因所在,前段时间为了安全起见,我设置了php.ini的disable_functions=phpinfo,passthru,exec,system,chroot,
scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,今天忽然想起,删掉disable_functions=后的设置即可!kill judge,再重启judge,一切OK!,太高兴了!

from moodle-local_onlinejudge.

sunner avatar sunner commented on May 25, 2024

原来如此。
这里有些moodle自身也要用到的。

from moodle-local_onlinejudge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.