riverstore / hustoj

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

judge_client.cc problem! #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
amir@amir-laptop:~/Desktop/install/hustoj-read-only/core/judge_client$ make
g++ -c -I/usr/local/mysql/include/mysql judge_client.cc
In file included from judge_client.cc:27:
okcalls.h:4: error: ‘SYS_ugetrlimit’ was not declared in this scope
okcalls.h:4: error: ‘SYS_mmap2’ was not declared in this scope
okcalls.h:4: error: ‘SYS_stat64’ was not declared in this scope
In file included from judge_client.cc:27:
okcalls.h:4: error: ‘SYS_sigprocmask’ was not declared in this scope
okcalls.h:4: error: ‘SYS_fstat64’ was not declared in this scope
okcalls.h:4: error: ‘SYS_getuid32’ was not declared in this scope
okcalls.h:4: error: ‘SYS_getgid32’ was not declared in this scope
okcalls.h:4: error: ‘SYS_geteuid32’ was not declared in this scope
okcalls.h:4: error: ‘SYS_getegid32’ was not declared in this scope
okcalls.h:7: error: ‘SYS_mmap2’ was not declared in this scope
okcalls.h:7: error: ‘SYS_fstat64’ was not declared in this scope
judge_client.cc: In function ‘int main(int, char**)’:
judge_client.cc:721: error: ‘struct user_regs_struct’ has no member named 
‘orig_eax’
judge_client.cc:723: error: ‘struct user_regs_struct’ has no member named 
‘orig_eax’
judge_client.cc:726: error: ‘struct user_regs_struct’ has no member named 
‘orig_eax’
make: *** [all] Error 1

Ubuntu 10.10 64 bit

Original issue reported on code.google.com by s.scrip...@gmail.com on 26 Oct 2010 at 10:22

GoogleCodeExporter commented 8 years ago
the original hustoj is designed on 32bits system and for 32bits system only.
i never got a chance to try hustoj on a 64bits system.
so far i can tell is just making a guess.
64bits system has difference on syscalls, because hustoj is judging abnormal 
operation based on sys-calls, these differences can cause compiling error.

you can check these apis ,find the replacement in 64bits.
or just comment out all related code in judge_client.cc
that should go through make and working
but you'll lost corresponding safety assurance

i'll try to find a 64bits system to help this issue out.

Original comment by newsc...@gmail.com on 26 Oct 2010 at 1:30

GoogleCodeExporter commented 8 years ago
compile an A+B sample solution to main.

strace ./main 2>&1|awk -F\( '{print $1}'|sort -u

will help you to determine which syscalls is needed on the system.

replace them into the okcalls.h

that should helps you port HUSTOJ on 64bits system.

Original comment by newsc...@gmail.com on 7 Nov 2010 at 1:05

GoogleCodeExporter commented 8 years ago
The easyest way to solve the problem:
Comment lines 821-831(the if-else block)

Ps:these lines are the security mode,so you should be aware of the affereffect 
before u take action

Original comment by johnny...@gmail.com on 14 Nov 2010 at 3:54

GoogleCodeExporter commented 8 years ago
johnnychq's suggestion is not recommanded for productive system.
and you also have to delete associated SYS_xxxx in okcalls.h.

anyone have 64bit's system can make his own okcalls.h with some test of strace 
-c .

a patch of this issue is welcomed.

Original comment by newsc...@gmail.com on 14 Nov 2010 at 7:13

GoogleCodeExporter commented 8 years ago
thanks to johnnychq's ssh on 64bits VM.
r520 is the beta version of 64bits support

Original comment by newsc...@gmail.com on 16 Nov 2010 at 2:08

GoogleCodeExporter commented 8 years ago

Original comment by newsc...@gmail.com on 16 Jul 2011 at 3:06