-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sandbox错误:255 #38
Comments
[root@localhost bin]# g++ -v [root@localhost bin]# gcc -v |
Do all kinds of program get the same result? |
yes,all kinds of program |
But OJ should never print the string "内部错误!sandbox错误255". What exactly it looks like? |
状态: 内部错误
|
问题起初是因为升级gcc从4.1.2到gcc4.4.7,发现不能用。现在还原为gcc4.1.2,就出现这个情况 |
Try rerun judged.php . If still the problem, post output of |
[root@localhost cli]# sudo -u apache php judged.php |
Rerun means you should kill all old judged first |
yes,but yet error |
[root@localhost judge]# cd sandbox/sand && make |
[root@localhost cli]# ps -FC php
Judged inner level exception handler: 沙箱错误:255 Debug:
|
I don't know why. Perhaps some libs are broken during changing version of gcc. Usually, getting |
升级后,能在shell中运行gcc编译,运行C程序,证明gcc 升级成功的啊 |
这样测试一下吧。弄一个简单的但是255的程序,比如hello.c,然后到命令行这样编译:
然后到sand目录下,运行 ./sand /path/to/hello
echo $? 假如最后的输出是255或-1,那么把你的sand和hello都发给我。否则,暂时还想不出什么办法…… |
我终于找到原因所在,前段时间为了安全起见,我设置了php.ini的disable_functions=phpinfo,passthru,exec,system,chroot, |
原来如此。 |
程序提交后显示:内部错误!sandbox错误255
uname -a
Linux localhost 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:22:04 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
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-50)
cd /usr/local/apache/htdocs/moodle
[root@localhost moodle]# cd local/onlinejudge
[root@localhost onlinejudge]# cd judge
[root@localhost judge]# cd sandbox
[root@localhost sandbox]# cd sand
[root@localhost sand]# uname -a
Linux localhost 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:22:04 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost sand]# 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-50)
[root@localhost sand]# make clean
make -C libsandbox clean
make[1]: Entering directory
/usr/local/apache/htdocs/moodle/local/onlinejudge/judge/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/judge/sandbox/sand/libsandbox'rm -f *.o *_test detector 223 policy.c
rm -f sand
[root@localhost 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/judge/sandbox/sand/libsandbox' cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 -shared -fPIC -pthread -D SANDBOX -D NDEBUG -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 NDEBUG -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 NDEBUG -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/judge/sandbox/sand/libsandbox'cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 -D SANDBOX -D NDEBUG -D WITH_NATIVE_TRACER -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_TRACER -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_TRACER -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_TRACER -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_TRACER -D WITHOUT_TSC_COUNTER -I ./libsandbox/src -o sand sand.o policy.o ./libsandbox/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/memlimit.c
./runtest.sh 3 -l memory=1048576 memlimit_test
cc -m32 -Wall -ansi -std=gnu99 -g0 -O3 --static -o cpulimit_test testcase/cpulimit.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/judge/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/judge/sandbox/sand/libsandbox'rm -f *.o *_test detector 223 policy.c
The text was updated successfully, but these errors were encountered: