Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only one step request allowed per thread error #120

Closed
rotemso opened this issue Nov 28, 2017 · 5 comments
Closed

Only one step request allowed per thread error #120

rotemso opened this issue Nov 28, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@rotemso
Copy link

rotemso commented Nov 28, 2017

When putting a breakpoint in some java file calling a constructor, and also putting a breakpoint inside the constructor (which is in another java file):
first step over - succeeded and we get 'stopped' event of reason 'breakpoint' as expected as it hit the breakpoint before completing the step operation (stack trace points to the breakpoint location inside the constructor).

With that, a second step over (to the second line in the constructor...) fails and the 'Only one step request allowed per thread' error message is returned.

Reference code:
[Main.java]
Person myPerson = new Person(12,"name1"); [ --> first breakpoint]

[Person.java]
public Person(int age,String name) {
this.name = name; [ --> second breakpoint]
this.age = age;
this.detail = new Detail();
}

Our setup:
We are using the debug.core code (without the plugin wrapping) and providing our own source provider and IDE (not VS Code).
The debugee application is a servlet, if it matters...

Request - Response communication (removed content length for readability):

[stopped at breakpoint - Main.java]

{"event":"stopped","body":{"threadId":15,"reason":"breakpoint","allThreadsStopped":false,"type":"stopped"},"seq":11,"type":"event"}

... [get stack trace, scopes, variables]

[step over request / response]

{"command":"next","type":"request","seq":"48","arguments":{"threadId":15}}

{"success":true,"request_seq":48,"command":"next","seq":53,"type":"response"}

[stopped at breakpoint - Person.java inside constructor]

{"event":"stopped","body":{"threadId":15,"reason":"breakpoint","allThreadsStopped":false,"type":"stopped"},"seq":55,"type":"event"}

... [get stack trace, scopes, variables]

[step over request / response]

{"command":"next","type":"request","seq":"90","arguments":{"threadId":15}}

{"success":false,"message":"Only one step request allowed per thread","request_seq":90,"command":"next","body":{"error":{"id":1000,"format":"Only one step request allowed per thread"}},"seq":97,"type":"response"}

(expected - success 'true' and get stopped event from 'step' reason at Person.java - in second line of constructor)

Exception:
com.sun.jdi.request.DuplicateRequestException: Only one step request allowed per thread
at com.sun.tools.jdi.EventRequestManagerImpl$StepRequestImpl.(EventRequestManagerImpl.java:591)
at com.sun.tools.jdi.EventRequestManagerImpl.createStepRequest(EventRequestManagerImpl.java:759)
at com.microsoft.java.debug.core.DebugUtility.step(DebugUtility.java:236)
at com.microsoft.java.debug.core.DebugUtility.stepOver(DebugUtility.java:201)
at com.microsoft.java.debug.core.adapter.handler.ThreadsRequestHandler.next(ThreadsRequestHandler.java:113)
at com.microsoft.java.debug.core.adapter.handler.ThreadsRequestHandler.handle(ThreadsRequestHandler.java:64)
at com.microsoft.java.debug.core.adapter.DebugAdapter.dispatchRequest(DebugAdapter.java:80)
at com.microsoft.java.debug.core.adapter.ProtocolServer.dispatchRequest(ProtocolServer.java:66)
at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.processData(AbstractProtocolServer.java:166)
at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.start(AbstractProtocolServer.java:80)
at com.microsoft.java.debug.core.adapter.ProtocolServer.start(ProtocolServer.java:53)

@testforstephen testforstephen self-assigned this Nov 29, 2017
@testforstephen
Copy link
Contributor

Need clean up stale step request when a breakpoint event occurs during stepping over.

@testforstephen
Copy link
Contributor

This bug should be fixed at PR https://github.com/Microsoft/java-debug/pull/106/files.
@rotemso Could you have a try?

@offer8
Copy link

offer8 commented Dec 8, 2017

Hi,

I'm from @rotemso team.
How do you want us to test it?
Does PR #106 is part of release you are going to do?

Regards,
Offer.

@testforstephen
Copy link
Contributor

Just ignore the PR, the code has been merged to the master branch. Using latest master branch is OK.
The code will be shipped with 0.5.0. Of course, you can verify after 0.5.0 is released.

@offer8
Copy link

offer8 commented Dec 18, 2017

Verified with master branch and the issue is now resolved for us.

@testforstephen testforstephen added this to the 0.5.0 milestone Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants