Search code examples
btrace

com.sun.btrace.VerifierException: Unsafe mode, requested by the script, not allowed


ubuntu 13.10

btrace 1.2.4

i have edit -Dcom.sun.btrace.unsafe=true param and assigned @BTrace( unsafe = true )

but when i run btrace script, it throw a exception:

btrace 1625 ProductRPCNewBtrace.java

DEBUG: btrace debug mode is set

DEBUG: btrace unsafe mode is set

DEBUG: assuming default port 2020

DEBUG: assuming default classpath '.'

DEBUG: compiling ProductRPCNewBtrace.java DEBUG: compiled ProductRPCNewBtrace.java

DEBUG: attaching to 1625

DEBUG: checking port availability: 2020

DEBUG: attached to 1625

DEBUG: loading /export/servers/btrace/build/btrace-agent.jar

DEBUG: agent args:

port=2020,debug=true,unsafe=true,systemClassPath=/export/servers/jdk1.6.0_25/lib/tools.jar,probeDescPath=.

DEBUG: loaded /export/servers/btrace/build/btrace-agent.jar

DEBUG: registering shutdown hook

DEBUG: registering signal handler for SIGINT

DEBUG: submitting the BTrace program

DEBUG: opening socket to 2020

DEBUG: sending instrument command

DEBUG: entering into command loop

DEBUG: received com.sun.btrace.comm.ErrorCommand@3c24c4a3

com.sun.btrace.VerifierException: Unsafe mode, requested by the script, not allowed at com.sun.btrace.runtime.Verifier.reportError(Verifier.java:385) at com.sun.btrace.runtime.Verifier.reportError(Verifier.java:376) at com.sun.btrace.runtime.Verifier$1.visit(Verifier.java:141) at com.sun.btrace.org.objectweb.asm.ClassReader.a(Unknown Source) at com.sun.btrace.org.objectweb.asm.ClassReader.a(Unknown Source) at com.sun.btrace.org.objectweb.asm.ClassReader.accept(Unknown Source) at com.sun.btrace.org.objectweb.asm.ClassReader.accept(Unknown Source) at com.sun.btrace.runtime.InstrumentUtils.accept(InstrumentUtils.java:66) at com.sun.btrace.runtime.InstrumentUtils.accept(InstrumentUtils.java:62) at com.sun.btrace.agent.Client.verify(Client.java:397) at com.sun.btrace.agent.Client.loadClass(Client.java:224) at com.sun.btrace.agent.RemoteClient.(RemoteClient.java:59) at com.sun.btrace.agent.Main.startServer(Main.java:379) at com.sun.btrace.agent.Main.access$000(Main.java:65) at com.sun.btrace.agent.Main$3.run(Main.java:166) at java.lang.Thread.run(Thread.java:662)

DEBUG: received com.sun.btrace.comm.ExitCommand@11e9c82e

i open the debug mode, and we can see that i have open the unsafe mode.but why still not support unsafe mode??


Solution

  • i fixed it after restarting the application.

    and i have proved it by changing -Dcom.sun.btrace.unsafe=false,and still can run in the unsafe mode. and then restart the application, run the same btrace script again,the same exception thrown.