daveagp / java_jail Goto Github PK
View Code? Open in Web Editor NEWchroot java jail, and JSON java trace printer
License: GNU Affero General Public License v3.0
chroot java jail, and JSON java trace printer
License: GNU Affero General Public License v3.0
I am getting the following error when running the main method from InMemory and inputting the text from test-input.txt.
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.
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.
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.
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
While debugging the java program , VMDisconnectedException happening frequently Even before the program getting started to debugged.
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
#
[thread 139926425515776 also had an error]
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
(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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.