newcastlecy / hustoj

Automatically exported from code.google.com/p/hustoj
0 stars 0 forks source link

Java RTE #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Java RuntimeError for correct Java code.
But it works well with C++ and Pascal code.

System Version: Ubuntu 9.10
Java Version: Sun Jdk 1.6.0_20

The code is newly downloaded and compiled.
When I run the command:
-----------------------------------------------------------------
$sudo judged debug
<<=sid=22931===clientid=0==>>

time: 4 mem: 943
judging 
starting 
[ERROR] A Not allowed system call: runid:22931 callid:221

sig=9
MLE:256jvm:256result: 10
Judging solution 22933
-----------------------------------------------------------------

Below is the problem and data I test.

Original issue reported on code.google.com by immoz...@gmail.com on 4 Aug 2010 at 1:34

Attachments:

GoogleCodeExporter commented 9 years ago
please post your java answer

Original comment by newsc...@gmail.com on 4 Aug 2010 at 10:40

GoogleCodeExporter commented 9 years ago
and check your settings for java
i can't reproduce this problem on my laptop
$ cat /home/judge/etc/java0.policy 

grant {
    permission java.io.FilePermission "./*", "read";
    permission java.io.FilePermission "./*", "write";
};

Original comment by newsc...@gmail.com on 4 Aug 2010 at 11:43

GoogleCodeExporter commented 9 years ago
I submit this code:

import java.io.*;
import java.util.*;
public class Main
{
            public static void main(String args[]) throws Exception
            {
                    Scanner cin=new Scanner(System.in);
                    int a=cin.nextInt(),b=cin.nextInt();
                    System.out.println(a+b);
            }
}

And I think the java0.policy is the same as yours.

grant {
    permission java.io.FilePermission "./*", "read";
    permission java.io.FilePermission "./*", "write";
}

Original comment by immoz...@gmail.com on 5 Aug 2010 at 12:39

GoogleCodeExporter commented 9 years ago
that's strange ,it says AC on my lap.
and works on acm.ajou.ac.kr
http://acm.ajou.ac.kr/JudgeOnline/problem.php?id=1000

are you using and 64bit's system like AMD-64 and ubuntu for 64bits

Original comment by newsc...@gmail.com on 5 Aug 2010 at 2:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
if you are setting up a new server, i suggest you try the [HUSTOJ_LiveCD] ,and 
install to hard driver by using the GUI interface
run this in the LiveCD system
sudo ubiquity

Original comment by newsc...@gmail.com on 5 Aug 2010 at 2:44

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/hustoj/wiki/HUSTOJ_LiveCD

Original comment by newsc...@gmail.com on 5 Aug 2010 at 2:45

GoogleCodeExporter commented 9 years ago
Thanks for your rapid replies.
I check my system with
----------
$uname -m
i686
----------
And it seems to be 32bit's.

I have tried hustoj_livecd on my virtual machine. And It works well with C++ 
and Java. But there is a problem: the memory used for Java is quite high: 
408944kb for an 'A+B' solution. Is that a bug?

Original comment by immoz...@gmail.com on 5 Aug 2010 at 5:06

GoogleCodeExporter commented 9 years ago
that can be regarded as a "bug", that's the virtual memory accessed by JVM

because JVM's heap / garbage model, a lot of memory is used for the j2se 
framework

in some way,it is a bug, the memory showed is not only the program's memory, 
but also JVM's as the JVM init heapsize is included

that bug might can be fixed by using jdb-tools, but not on our schedule.

any way, Java is designed for after 1GB times,you can compare LiveCD with your 
own system.

Original comment by newsc...@gmail.com on 5 Aug 2010 at 6:17

GoogleCodeExporter commented 9 years ago
I see.
I compared the 'judged','judge_client' and files under /home/judge.
But they seems to be the same.
Does it come with the difference of java version?
Java Version in virtual machine is 1.6.0_15 .

Anyway, I think I will try the LIVE_CD on a "real" computer later.
Then I may be back with new problems :)

Original comment by immoz...@gmail.com on 5 Aug 2010 at 12:06

GoogleCodeExporter commented 9 years ago
i've tested it with ubuntu10.4+sunjdk1.6.0_20,still AC.

if you try LiveCD, r301 is recommanded,r288 might has some bugs.

Original comment by newsc...@gmail.com on 6 Aug 2010 at 12:26

GoogleCodeExporter commented 9 years ago
what's your OJ_RUNNING value in /home/judge/etc/judge.conf

it seems running more than one judge_client for java may cause similiar error 
of syscall 221

Original comment by newsc...@gmail.com on 9 Sep 2010 at 4:27

GoogleCodeExporter commented 9 years ago
and how much memory do you have?

Original comment by newsc...@gmail.com on 10 Sep 2010 at 5:39

GoogleCodeExporter commented 9 years ago
should by fixed by r358 
unbelievable, we limited thread number even for JAVA, jvm need a lot of threads

Original comment by newsc...@gmail.com on 10 Sep 2010 at 2:33

GoogleCodeExporter commented 9 years ago
I have download the r358 and reinstall the whole project. But it doesn't work.

Here is the judge.conf:
OJ_HOST_NAME=localhost
OJ_USER_NAME=root
OJ_PASSWORD=root
OJ_DB_NAME=jol
OJ_PORT_NUMBER=3306
OJ_RUNNING=1
OJ_SLEEP_TIME=5
OJ_TOTAL=1
OJ_MOD=

Original comment by immoz...@gmail.com on 12 Sep 2010 at 1:47

Attachments:

GoogleCodeExporter commented 9 years ago
how much memory do you have
post "free" output,please

Original comment by newsc...@gmail.com on 13 Sep 2010 at 2:41

GoogleCodeExporter commented 9 years ago
             total       used       free     shared    buffers     cached
Mem:       2060048     485704    1574344          0      43892     220596
-/+ buffers/cache:     221216    1838832
Swap:      1464312          0    1464312

Original comment by immoz...@gmail.com on 13 Sep 2010 at 7:58

GoogleCodeExporter commented 9 years ago
it seems you have too much memory :P
let's try r374. only judge_client.cc need update && complie.
core/make.sh can be used with sudo/root

Original comment by newsc...@gmail.com on 14 Sep 2010 at 3:03

GoogleCodeExporter commented 9 years ago
I will try to remove my memories sometime :)
I have compiled r374 ,put it in /usr/bin/ and re-run it.
RE still.

Original comment by immoz...@gmail.com on 14 Sep 2010 at 11:40

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
what would it say if you using a debug mode like 

#sudo pkill judged
#sudo judged d
and rejudge

and by the way where is you java (bin) ? like

#which java

Original comment by newsc...@gmail.com on 14 Sep 2010 at 1:25

GoogleCodeExporter commented 9 years ago

Original comment by newsc...@gmail.com on 27 Sep 2010 at 5:14

GoogleCodeExporter commented 9 years ago
fixed on r490

Original comment by newsc...@gmail.com on 1 Nov 2010 at 5:56

GoogleCodeExporter commented 9 years ago
Issue 26 has been merged into this issue.

Original comment by newsc...@gmail.com on 1 Nov 2010 at 5:57

GoogleCodeExporter commented 9 years ago
take a note here

strace java Main 2>&1|awk -F\( '{print $1}'|sort -u

helps to determine what syscalls made by jvm

Original comment by newsc...@gmail.com on 7 Nov 2010 at 10:49

GoogleCodeExporter commented 9 years ago

Original comment by newsc...@gmail.com on 13 Jan 2011 at 2:10