devel/jdk/1.8: cannot use debugger

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

devel/jdk/1.8: cannot use debugger

Caspar Schutijser
Hi,

I attempted to debug a Java application.  However, as is shown below,
debugging does not work currently (presumably since the jdk was updated
recently).  I found a FreeBSD bug report which reports the same
problem [1].  They fixed the problem with a patch [2].  I have not tried
the patch yet but I assume it would fix the problem for OpenBSD as well.
I'm not sending a diff since I'm not sure you can use it, given the
whole CLA thing.

Thanks,
Caspar Schutijser


[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234674
[2] https://svnweb.freebsd.org/ports?view=revision&revision=492485


$ cat Test.java
public class Test {
        public static void main(String[] args) {
                System.out.println("Hello world\n");
        }
}
$ javac Test.java
$ jdb Test
Initializing jdb ...
> run
run Test
FJADTWAPL  eExRiRt errOor JVMTI_ERROR_OUT_OF_MEMORY(110): Can't allocate jvmti memory [util.c:1799]
R in native method: JDWP Can't allocate jvmti memory, jvmtiError=JVMTI_ERROR_OUT_OF_MEMORY(110)
Internal exception:
com.sun.jdi.VMDisconnectedException
        at com.sun.tools.jdi.TargetVM.waitForReply(TargetVM.java:307)
        at com.sun.tools.jdi.VirtualMachineImpl.waitForTargetReply(VirtualMachineImpl.java:1030)
        at com.sun.tools.jdi.PacketStream.waitForReply(PacketStream.java:69)
        at com.sun.tools.jdi.JDWP$EventRequest$Set.waitForReply(JDWP.java:6910)
        at com.sun.tools.jdi.JDWP$EventRequest$Set.process(JDWP.java:6875)
        at com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.set(EventRequestManagerImpl.java:201)
        at com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.setEnabled(EventRequestManagerImpl.java:166)
        at com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.enable(EventRequestManagerImpl.java:151)
        at com.sun.tools.example.debug.tty.EventRequestSpec.resolveEagerly(EventRequestSpec.java:139)
        at com.sun.tools.example.debug.tty.EventRequestSpecList.addEagerlyResolve(EventRequestSpecList.java:98)
        at com.sun.tools.example.debug.tty.Commands.resolveNow(Commands.java:1125)
        at com.sun.tools.example.debug.tty.Commands.commandCatchException(Commands.java:810)
        at com.sun.tools.example.debug.tty.VMConnection.setEventRequests(VMConnection.java:427)
        at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:337)
        at com.sun.tools.example.debug.tty.Commands.commandRun(Commands.java:559)
        at com.sun.tools.example.debug.tty.TTY.executeCommand(TTY.java:501)
        at com.sun.tools.example.debug.tty.TTY.<init>(TTY.java:781)
        at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1083)
> Exception in thread "JDI Internal Event Handler" java.lang.UnsupportedOperationException: JDWP: ID size not supported: 134217728
        at com.sun.tools.jdi.PacketStream.readID(PacketStream.java:410)
        at com.sun.tools.jdi.PacketStream.readObjectRef(PacketStream.java:418)
        at com.sun.tools.jdi.PacketStream.readThreadReference(PacketStream.java:445)
        at com.sun.tools.jdi.JDWP$Event$Composite$Events$VMStart.<init>(JDWP.java:7613)
        at com.sun.tools.jdi.JDWP$Event$Composite$Events.<init>(JDWP.java:7526)
        at com.sun.tools.jdi.JDWP$Event$Composite.<init>(JDWP.java:8594)
        at com.sun.tools.jdi.EventSetImpl.build(EventSetImpl.java:608)
        at com.sun.tools.jdi.EventQueueImpl.removeUnfiltered(EventQueueImpl.java:211)
        at com.sun.tools.jdi.EventQueueImpl.removeInternal(EventQueueImpl.java:124)
        at com.sun.tools.jdi.InternalEventHandler.run(InternalEventHandler.java:54)
        at java.lang.Thread.run(Thread.java:748)

Reply | Threaded
Open this post in threaded view
|

Re: devel/jdk/1.8: cannot use debugger

Kurt Miller-4
Hi Caspar,

Thank you for looking into this. Yea the jdk has some uses of
the _LITTLE_ENDIAN and _BIG_ENDIAN defines that conflict with
the BSD's use of them. I'll review jdk8's use of them again
and include this correction in the 8u202 update.

-Kurt

On Sat, 2019-03-02 at 11:27 +0100, Caspar Schutijser wrote:

> Hi,
> > I attempted to debug a Java application.  However, as is shown below,
> debugging does not work currently (presumably since the jdk was updated
> recently).  I found a FreeBSD bug report which reports the same
> problem [1].  They fixed the problem with a patch [2].  I have not tried
> the patch yet but I assume it would fix the problem for OpenBSD as well.
> I'm not sending a diff since I'm not sure you can use it, given the
> whole CLA thing.
> > Thanks,
> Caspar Schutijser
> > > [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234674
> [2] https://svnweb.freebsd.org/ports?view=revision&revision=492485
> > > $ cat Test.java
> public class Test {
> public static void main(String[] args) {
> System.out.println("Hello world\n");
> }
> }
> $ javac Test.java
> $ jdb Test
> Initializing jdb ...
> >
> > run
> run Test
> FJADTWAPL  eExRiRt errOor JVMTI_ERROR_OUT_OF_MEMORY(110): Can't allocate jvmti memory [util.c:1799]
> R in native method: JDWP Can't allocate jvmti memory, jvmtiError=JVMTI_ERROR_OUT_OF_MEMORY(110)
> Internal exception:
> com.sun.jdi.VMDisconnectedException
>         at com.sun.tools.jdi.TargetVM.waitForReply(TargetVM.java:307)
>         at com.sun.tools.jdi.VirtualMachineImpl.waitForTargetReply(VirtualMachineImpl.java:1030)
>         at com.sun.tools.jdi.PacketStream.waitForReply(PacketStream.java:69)
>         at com.sun.tools.jdi.JDWP$EventRequest$Set.waitForReply(JDWP.java:6910)
>         at com.sun.tools.jdi.JDWP$EventRequest$Set.process(JDWP.java:6875)
>         at com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.set(EventRequestManagerImpl.java:201)
>         at com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.setEnabled(EventRequestManagerImpl.java:166)
>         at com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.enable(EventRequestManagerImpl.java:151)
>         at com.sun.tools.example.debug.tty.EventRequestSpec.resolveEagerly(EventRequestSpec.java:139)
>         at com.sun.tools.example.debug.tty.EventRequestSpecList.addEagerlyResolve(EventRequestSpecList.java:98)
>         at com.sun.tools.example.debug.tty.Commands.resolveNow(Commands.java:1125)
>         at com.sun.tools.example.debug.tty.Commands.commandCatchException(Commands.java:810)
>         at com.sun.tools.example.debug.tty.VMConnection.setEventRequests(VMConnection.java:427)
>         at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:337)
>         at com.sun.tools.example.debug.tty.Commands.commandRun(Commands.java:559)
>         at com.sun.tools.example.debug.tty.TTY.executeCommand(TTY.java:501)
>         at com.sun.tools.example.debug.tty.TTY.<init>(TTY.java:781)
>         at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1083)
> >
> > Exception in thread "JDI Internal Event Handler" java.lang.UnsupportedOperationException: JDWP: ID size not
> > supported: 134217728
>         at com.sun.tools.jdi.PacketStream.readID(PacketStream.java:410)
>         at com.sun.tools.jdi.PacketStream.readObjectRef(PacketStream.java:418)
>         at com.sun.tools.jdi.PacketStream.readThreadReference(PacketStream.java:445)
>         at com.sun.tools.jdi.JDWP$Event$Composite$Events$VMStart.<init>(JDWP.java:7613)
>         at com.sun.tools.jdi.JDWP$Event$Composite$Events.<init>(JDWP.java:7526)
>         at com.sun.tools.jdi.JDWP$Event$Composite.<init>(JDWP.java:8594)
>         at com.sun.tools.jdi.EventSetImpl.build(EventSetImpl.java:608)
>         at com.sun.tools.jdi.EventQueueImpl.removeUnfiltered(EventQueueImpl.java:211)
>         at com.sun.tools.jdi.EventQueueImpl.removeInternal(EventQueueImpl.java:124)
>         at com.sun.tools.jdi.InternalEventHandler.run(InternalEventHandler.java:54)
>         at java.lang.Thread.run(Thread.java:748)