Giter VIP home page Giter VIP logo

java_jail's People

Contributors

daveagp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java_jail's Issues

VMStartException when running the main method from InMemory

I am getting the following error when running the main method from InMemory and inputting the text from test-input.txt.

image

I notice if I remove the highlighted line, I get output similar to the expected output, but it differs in the that there is an exception message as shown below.

image

I have tried changing the classpath manually in the program to a few things, but not much changes. I am not very experienced in programming, so this may be a small error I don't see.

Visualizer freezing

Hi Dave, amazing work on the visualizer!

My problem is that after installation on Ubuntu server (Vbox) and connecting through browser on host the Visualizer freezes after clicking "Visualize Execution".

Can you help?

image

Java Visualizer not working

Hi,
I followed all the steps on my RHEL 7 64 bit OS to install Java Visualizer, but still it is not working.
safeexec is working properly.
In Java jail when I execute below command ,

./java/bin/java -cp .:cp:cp/javax.json-1.0.jar:java/lib/tools.jar traceprinter.InMemory < cp/traceprinter/test-input.txt
it gives me below output.

{"code":"public class Test { public static void main(String[] args) { int x = 3; x += x; } }","stdin":"","trace":[{"stdout":"","event":"call","line":1,"stack_to_render":[{"func_name":"main:1","encoded_locals":{},"ordered_varnames":[],"parent_frame_id_list":[],"is_highlighted":true,"is_zombie":false,"is_parent":false,"unique_hash":"1","frame_id":1}],"globals":{},"ordered_globals":[],"func_name":"main","heap":{}},{"stdout":"","event":"step_line","line":1,"stack_to_render":[{"func_name":"main:1","encoded_locals":{},"ordered_varnames":[],"parent_frame_id_list":[],"is_highlighted":true,"is_zombie":false,"is_parent":false,"unique_hash":"2","frame_id":2}],"globals":{},"ordered_globals":[],"func_name":"main","heap":{}},{"stdout":"","event":"step_line","line":1,"stack_to_render":[{"func_name":"main:1","encoded_locals":{"x":3},"ordered_varnames":["x"],"parent_frame_id_list":[],"is_highlighted":true,"is_zombie":false,"is_parent":false,"unique_hash":"4","frame_id":4}],"globals":{},"ordered_globals":[],"func_name":"main","heap":{}},{"stdout":"","event":"step_line","line":1,"stack_to_render":[{"func_name":"main:1","encoded_locals":{"x":6},"ordered_varnames":["x"],"parent_frame_id_list":[],"is_highlighted":true,"is_zombie":false,"is_parent":false,"unique_hash":"8","frame_id":8}],"globals":{},"ordered_globals":[],"func_name":"main","heap":{}},{"stdout":"","event":"return","line":1,"stack_to_render":[{"func_name":"main:1","encoded_locals":{"x":6,"return":["VOID"]},"ordered_varnames":["x","return"],"parent_frame_id_list":[],"is_highlighted":true,"is_zombie":false,"is_parent":false,"unique_hash":"9","frame_id":9}],"globals":{},"ordered_globals":[],"func_name":"main","heap":{}}],"userlog":"Debugger VM maxMemory: 3513M\n"}

everything is blank inside {}.

I also tried accessing Java Visualizer by http://localhost/java_visualize. but its not working.

Please help.

Thanks.

java_jail Not working in my linux machine

Hi,
I am using java_jail to install on my linux 64bit machine having cent OS 5.0 version
I used the same procedure which is given in readme file. just not added iptable
entry and It fails in both the cases when
1>run the java class InMemory by given java file as input parameter it gives null pointer exception.I think in run method of the "JSONTracingThread" JVM doesnt starts
2>in compile file given in java_jail/cp/traceprinter it is written that for testing use
following command "java traceprinter.JSONTrace Filename" but on running this it shows exception of class not found JSONTrace.
3>I have used safeexec and followed the same procedure what was given but after run it gives exception of file not found execve error

I did the same thing except one thing of IPTABLES setting.
so I want to ask
is it showing null pointer exception because of blocking of port which JVM is using while running
OR other reason?

thanks

Java Jail not working with safeexec on CentOS

Hi,
I am having an issue with safeexec and java_jail. I'm on CentOS release 5.8 (Final)

When I try this command from java_jail (i.e. without chroot):
/home/ssad1/safeexec/safeexec --share_newnet --nproc 50 --mem 30000000 --nfile 30 --env_vars CLASSPATH=./cp/:./cp/javax.json-1.0.jar:./java/lib/tools.jar --exec ./java/bin/java traceprinter.InMemory < cp/traceprinter/test-input.txt

Output is:
Exception in thread "event-handler" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:714)
at traceprinter.JSONTracingThread.handleEvent(JSONTracingThread.java:221)
at traceprinter.JSONTracingThread.run(JSONTracingThread.java:136)
OK
elapsed time: 2 seconds
memory usage: 5092524 kbytes
cpu usage: 1.585 seconds

When I run this:
/home/ssad1/safeexec/safeexec --chroot_dir . --exec_dir / --share_newnet --nproc 50 --mem 3000000 --nfile 30 --env_vars CLASSPATH=/cp/:/cp/javax.json-1.0.jar:/java/lib/tools.jar --exec /java/bin/java traceprinter.InMemory < cp/traceprinter/test-input.txt

Output is:
Error occurred during initialization of VM
Could not allocate metaspace: 1073741824 bytes
Command exited with non-zero status (1)
elapsed time: 0 seconds
memory usage: 0 kbytes
cpu usage: 0.000 seconds

When I subsequently increase --mem, here is what i get:
1. 4000000
/home/ssad1/safeexec/safeexec --chroot_dir . --exec_dir / --share_newnet --nproc 50 --mem 4000000 --nfile 30 --env_vars CLASSPATH=/cp/:./cp/javax.json-1.0.jar:/java/lib/tools.jar --exec /java/bin/java traceprinter.InMemory < cp/traceprinter/test-input.txt

Error occurred during initialization of VM
Could not allocate metaspace: 1073741824 bytes
Command exited with non-zero status (1)
elapsed time: 0 seconds
memory usage: 0 kbytes
cpu usage: 0.004 seconds

2. 5000000

/home/ssad1/safeexec/safeexec --chroot_dir . --exec_dir / --share_newnet --nproc 50 --mem 5000000 --nfile 30 --env_vars CLASSPATH=/cp/:./cp/javax.json-1.0.jar:/java/lib/tools.jar --exec /java/bin/java traceprinter.InMemory < cp/traceprinter/test-input.txt
#

There is insufficient memory for the Java Runtime Environment to continue.

pthread_getattr_np

[thread 139926425515776 also had an error]

An error report file with more information is saved as:

//hs_err_pid10797.log

Command exited with non-zero status (1)
elapsed time: 1 seconds
memory usage: 4824000 kbytes
cpu usage: 1.353 seconds

3. 6000000
/home/ssad1/safeexec/safeexec --chroot_dir . --exec_dir / --share_newnet --nproc 50 --mem 6000000 --nfile 30 --env_vars CLASSPATH=/cp/:./cp/javax.json-1.0.jar:/java/lib/tools.jar --exec /java/bin/java traceprinter.InMemory < cp/traceprinter/test-input.txt
Exception in thread "event-handler" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:714)
at traceprinter.JSONTracingThread.handleEvent(JSONTracingThread.java:221)
at traceprinter.JSONTracingThread.run(JSONTracingThread.java:136)
OK
elapsed time: 2 seconds
memory usage: 5092532 kbytes
cpu usage: 1.482 seconds

Going above 6000000 produces the same result over and over again

Unable to run using safeexec

(1) Run this command (from java_jail):
./java/bin/java -cp .:cp:cp/javax.json-1.0.jar:java/lib/tools.jar traceprinter.InMemory < cp/traceprinter/test-input.txt

(2) Try with safeexec (from java_jail):
/path/to/safeexec --chroot_dir . --exec_dir / --share_newnet --nproc 50 --mem 3000000 --nfile 30 --env_vars CLASSPATH=/cp/:/cp/javax.json-1.0.jar:/java/lib/tools.jar --exec /java/bin/java traceprinter.InMemory < cp/traceprinter/test-input.txt

(1) working fine but when i am running safexec i am getting below error. unable to debug it.

error 2 (No such file or directory): execve error

Command exited with non-zero status (1)
elapsed time: 0 seconds
memory usage: 0 kbytes
cpu usage: 0.000 seconds

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.