Reputation: 101
I faced with issue that conditional break point doesn't work on my PC. I use following code:
package test;
public class Main {
public static class C1 {
public static C1 c = new C1();
public Boolean b = null;
private boolean isB() {
if (b == null) {
b = Boolean.TRUE;
}
return b; //USE BREAKPOINT HERE
}
}
public static void main(String[] args) throws Exception {
Thread[] threads = new Thread[100];
for (int i = 0; i < 100; i++) {
Thread t = new Thread(new Runnable() {
public void run() {
C1.c.isB();
}
});
threads[i] = t;
}
for (Thread t : threads) {
t.start();
}
}
}
The conditional breakpoint is set to "return b;" line and use "Boolean.TRUE.equals(b)" conditional. I reinstall Eclipse without any plugin and tried different versions of Java 8, but each time I get the same error, that says "Conditional breakpoint encountered runtime exception. Reason: java.lang.InternalError: Got MethodID of ReferenceType that is not a member of the ReferenceType occured retrieving stack frames."
I don't use any JRebel, DCEVM or some profiling tools.
What can be the reason? Could it be CPU related issue? I use Intel 6700K. Windows 10 + JDK8u111 + Neon.1a Release (4.6.1). Also doesn't work with Eclipse Mars.
Upvotes: 9
Views: 2205
Reputation: 14164
A bug was apparently fixed in Eclipse Photon that caused a race condition in lazy-initializing ReferenceTypeImpl.fMethodTable. This appears to have been particularly relevant to conditional breakpoints in multi-threaded code.
This was fixed in internal build: I20170731-2000 and should presumably be available in major releases subsequent to that date.
Upvotes: 0
Reputation: 6620
I've tested this with JDK 8 and 7 (both 64 bit) on Eclipse Photon 2018
Version: Photon Release (4.8.0) Build id: 20180619-1200
And the break point works fine.
I suspect this is down to your JDK or Eclipse version.
Upvotes: 1