9

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.

  • Interesting question; but I doubt that you will receive much helpful feedback. – GhostCat Dec 14 '16 at 15:38
  • I'm also think so, but maybe someone tries this code on his own PC and will have the same problem, then we could find some similar hardware/ software settings. – Marat Kamalov Dec 14 '16 at 15:44
  • I've just managed to reproduce it. (Windows 10 SurfaceBook, Version: Mars.2 Release (4.5.2)) – Jon Skeet Dec 14 '16 at 15:47
  • Nice, I'm not alone :) – Marat Kamalov Dec 14 '16 at 15:54
  • it is probably Thread related - could reproduce it, but does not occur on the first call, only on subsequent calls. Also, if you do not call it in Threads, there is no error. – user85421 Dec 14 '16 at 15:57
  • Yes you are right, It is thread related. Could you share you CPU OS and Java/Eclipse versions please? – Marat Kamalov Dec 14 '16 at 15:59
  • 4
    Possibly Eclipse bug [413848](https://bugs.eclipse.org/bugs/show_bug.cgi?id=413848) which isn't resolved. – greg-449 Dec 14 '16 at 16:03
  • This ticket doesn't have steps to reproduce. I can't update this ticket because I didn't receive approve from webmaster@eclipse.org. – Marat Kamalov Dec 14 '16 at 16:07
  • I have added a link to this topic to [Bug 413848](https://bugs.eclipse.org/bugs/show_bug.cgi?id=413848) along with instructions on how to reproduce. I cannot reproduce this on a current Photon Milestone of Eclipse. If anyone can reproduce with Photon, please post a comment in the Eclipse Bugzilla. – Stefan Winkler Apr 13 '18 at 11:32
  • Whell, can't reproduce, but if this is a multi-thread class, why you do not synchronize isB method? – Beri Apr 19 '18 at 12:37
  • 1
    Hello, I don't have such issue, if it helps, I use Version: Oxygen.2 Release (4.7.2) – Leo Apr 22 '18 at 10:58

2 Answers2

1

Eclipse Photon 2018

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.

jeff porter
  • 6,560
  • 13
  • 65
  • 123
0

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.

Thomas W
  • 13,940
  • 4
  • 58
  • 76