Questions tagged [jvmti]

JVMTI is the Java Virtual Machine Tool Interface, a native API by which authors can write JVM plugins to monitor or modify the execution of a Java Virtual Machine.

Documentation for the current JVMTI 1.2. Home page for JVMTI in JDK 7.

JVMTI was introduced in JDK 5. It replaces Java Virtual Machine Profiler Interface (JVMPI) and the Java Virtual Machine Debug Interface (JVMDI).

214 questions
0
votes
1 answer

Java JVMTI Agent crashes on GetEnv()

I'm at a total loss here. I'm trying to get a JVMTI agent library running but it keeps crashing for some reason. I've narrowed it down this line: (*jvm)->GetEnv(jvm, (void**)jvmti, JVMTI_VERSION_1_0); this is the full code of the agent lib (in…
0
votes
1 answer

JVMTI GetLocalVariableTable() always gives JVMTI_ERROR_ABSENT_INFORMATION

First of all, I have tried to find the solution to my problem for a while, but got nothing useful. Therefore, I want to have some suggestions from the experts. I'm using JVMTI to write an agent, in which I need to get local variable info of some…
Z Z
  • 11
  • 2
0
votes
0 answers

How to detect JVM compiler thread

A JVMTI agent using the JNI to call Java objects sometimes crashes the JVM with: guarantee(!thread->is_Compiler_thread()) failed: cannot make java calls from the compiler How can the agent best determine whether the current thread is a compiler…
glyn
  • 1,180
  • 8
  • 19
0
votes
6 answers

How to monitor exceptions or errors generated by other Java applications?

I want to find or develop an application that can run as a daemon, notify the administrator by email or sms when the Java applications running on a host get any exceptions or errors. I know JVMTI can achieve part of my goal, but it will impact…
0
votes
1 answer

JNI native static method interception

In my project i want to use a JNI-agent to intercept results of java-static-native methods. My basic approach is, at binding time, to rebind all the static methods to my interceptor method. The interceptor method would accept a variadic number of…
Aksim Elnik
  • 425
  • 6
  • 27
0
votes
0 answers

How to obtain the initial class file bytes

At some point in my program I need the initial class file bytes (the bytes describing the class before any transformations were applied). The methods I evaluated so far are: Using the corresponding classloader to get the resource and simply…
Haasip Satang
  • 457
  • 3
  • 17
0
votes
0 answers

jvmti : jni getobjectclass and sometimes getintfieldcrashes crashes

I am writing a jvmti agent for java programs.I am trying to read objects on the stack.Using jnienv pointer received on VMinit/vmstart event. I succeeded in reading objects upon methodexit event using the foll: get varaible (slot) from…
Debugger
  • 21
  • 4
0
votes
1 answer

Invalid Slot Error When trying to access value of Exception and Thread Objects Using jvmti

I have the following java Program using which i am trying to capture the state of the variables inside the method when an exception occurs using JVMTI, public class SimpleThread{ static MyThread t; String thisThread = "this Thread"; …
kumarD
  • 574
  • 2
  • 9
  • 23
0
votes
1 answer

How to access method variable values and values of User defined object variables inside a method using ASM library?

I am trying to record the state of the application when an Exception occurs within the application, i am specifically interested with the method local variable values(Both Primitive and User Defined)? i have gone through the documentation of ASM…
kumarD
  • 574
  • 2
  • 9
  • 23
0
votes
1 answer

How to get the class in which the method is declared using jmethod id via JVMTI interface

I am writing a custom debugger for JVM using the JVMTI interface's APIs and i need to get the class name in which the method is declared, i get the method id of the method using error =…
kumarD
  • 574
  • 2
  • 9
  • 23
0
votes
0 answers

JVM ti agent: How to read reference (object) types using jvm ti?

I want to read values of objects on current method frame (on method exit event). But I am unable to find functions to do so in JVM ti. There are functions to read primitive types eg. getlocalfloat, but once we get a jobject using get local…
Debugger
  • 21
  • 4
0
votes
0 answers

Performance of passing the current thread explicitly vs. implicitly (NULL jthread) to JVMTI

The JVM Tool Interface has several call-stack related functions (e.g., GetStackTrace, GetFrameCount, or GetLocalInstance) which take a jthread as argument to determine the affected thread. All of them take a NULL argument to mean “the current…
Andreas Sewe
  • 1,558
  • 9
  • 18
0
votes
1 answer

Notification of any String object construction in Java 8 HotSpot VM

Is there a way to get notified on all invocations to constructor of String class (either directly or using reflection) without weaving or instrumenting rt.jar? Further is it possible to filter these notifications only for calls within a specific…
Harish
  • 7,589
  • 10
  • 36
  • 47
0
votes
1 answer

JMVTI:Could not find agent library

I wrote an agent for Java which does nothing just exports two methods, just to check if it loaded on JVM start or not. Built it with mingw-w64 4.8.4 (using JetBrains CLion). Windows 7 x64. JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char…
Ed Pavlov
  • 2,353
  • 2
  • 19
  • 25
0
votes
0 answers

Enforcing an application Whitelist using JVMTI

I am looking into possible ways to restrict the execution of all java applications on my JVM except for those on a whitelist. Would a JVMTI agent be capable of analyzing an application within the JVM when it first attempts to load at startup and…
DGWelsh
  • 11
  • 1