# eclipse 4.6, Java debugging stopped working after FreeBSD upgrade to 12.0-RELEASE



## D-FENS (Jan 9, 2019)

I upgraded my OS from 11.2-RELEASE to 12.0-RELEASE. During the upgrade process I upgraded all packages, Eclipse 4.6 was also reinstalled because of major version upgrade.

After that, Java debugging stopped working. When I start debug mode, the following exception occurs:


```
An internal error occurred during: "Launching MyClassTest".
java.lang.NegativeArraySizeException
    at org.eclipse.jdi.internal.jdwp.JdwpString.read(JdwpString.java:30)
    at org.eclipse.jdi.internal.MirrorImpl.readString(MirrorImpl.java:452)
    at org.eclipse.jdi.internal.VirtualMachineImpl.getVersionInfo(VirtualMachineImpl.java:1014)
    at org.eclipse.jdi.internal.VirtualMachineImpl.name(VirtualMachineImpl.java:930)
    at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.initializeState(JDIDebugTarget.java:569)
    at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.initialize(JDIDebugTarget.java:536)
    at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.<init>(JDIDebugTarget.java:359)
    at org.eclipse.jdt.debug.core.JDIDebugModel$1.run(JDIDebugModel.java:193)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
    at org.eclipse.jdt.debug.core.JDIDebugModel.newDebugTarget(JDIDebugModel.java:197)
    at org.eclipse.jdt.internal.launching.StandardVMDebugger.createDebugTarget(StandardVMDebugger.java:480)
    at org.eclipse.jdt.internal.launching.StandardVMDebugger.run(StandardVMDebugger.java:350)
    at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:172)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
```

Session data:

```
eclipse.buildId=4.6.0.I20160606-1100
java.version=1.8.0_192
java.vendor=Oracle Corporation
BootLoader constants: OS=freebsd, ARCH=x86_64, WS=gtk, NL=bg_BG
Command-line arguments:  -os freebsd -ws gtk -arch x86_64
```

I dug into the plugin code. It seems when asking the VM for version information the buffer returns a structure with a negative size for a string.

I cannot find any differences between the port in my last snapshot before the upgrade and the current one, however, comparing the Eclipse plugins directory shows some differences. The package contents changed in the meantime probably.
It's possible also that it comes from the JDK?

Any help would be very much appreciated. Thanks.


----------



## D-FENS (Jan 9, 2019)

I have downgraded openjdk8 to revision 485094 (*8.181.13_1*) and this solved the debug issue.
Apparently OpenJDK *8.192.26_3* causes the debugging issue in Eclipse.


----------

