Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 87144 - org.eclipse.jdi.TimeoutException when performing stepping operations rapidly with Variables view visible
Summary: org.eclipse.jdi.TimeoutException when performing stepping operations rapidly ...
Status: RESOLVED DUPLICATE of bug 83937
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Kevin Barnes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-04 10:04 EST by Kevin Lai CLA
Modified: 2005-04-04 15:38 EDT (History)
1 user (show)

See Also:


Attachments
Replacement jdt.debug plugin (1.21 MB, application/x-zip-compressed)
2005-03-08 14:00 EST, Kevin Barnes CLA
no flags Details
Error log for StepReturn in Eclipse I20050308-0835 (11.27 KB, text/plain)
2005-03-08 14:45 EST, Kevin Lai CLA
no flags Details
new plugin (1.21 MB, application/x-zip-compressed)
2005-03-08 15:29 EST, Kevin Barnes CLA
no flags Details
New Error log for step return on Eclipse I20050308-0835 (88.05 KB, text/plain)
2005-03-08 15:39 EST, Kevin Lai CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Lai CLA 2005-03-04 10:04:36 EST
This bug was discovered on Eclipse 3.1 M5a (I20050219-1500):

When debugging any Java application, if the variables view is open and visible,
doing stepping operations in rapid succession, such as by pressing and holding
the F6 key, would sometimes cause an error pop-up:

Exceptions occurred attempting to step over the frame
  org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet
2225 occurred creating step request.

After the error pops up for the first time, all stepping operations will no
longer work (it will give a similar org.eclipse.jdi.TimeoutException error each
time), the variables view will display the values of all variables as <unknown
value>, and sometimes Eclipse would freeze completely.

Below is the full error log entry:

!SESSION 2005-03-04 09:56:51.937 -----------------------------------------------
eclipse.buildId=I20050219-1500
java.version=1.4.2_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86

!ENTRY org.eclipse.debug.ui 4 5012 2005-03-04 09:56:51.937
!MESSAGE Exceptions occurred attempting to step over the frame
!SUBENTRY 1 org.eclipse.jdt.debug 4 5010 2005-03-04 09:56:51.937
!MESSAGE org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for
packet 2225 occurred creating step request.
!STACK 0
org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 2225
	at
org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:163)
	at
org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:172)
	at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:174)
	at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:192)
	at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:207)
	at
org.eclipse.jdi.internal.ObjectReferenceImpl.isCollected(ObjectReferenceImpl.java:388)
	at
org.eclipse.jdi.internal.request.EventRequestImpl.addStepFilter(EventRequestImpl.java:409)
	at
org.eclipse.jdi.internal.request.EventRequestManagerImpl.createStepRequest(EventRequestManagerImpl.java:195)
	at
org.eclipse.jdt.internal.debug.core.model.JDIThread$StepHandler.createStepRequest(JDIThread.java:1724)
	at
org.eclipse.jdt.internal.debug.core.model.JDIThread$StepHandler.step(JDIThread.java:1675)
	at
org.eclipse.jdt.internal.debug.core.model.JDIThread.stepOver(JDIThread.java:1215)
	at
org.eclipse.jdt.internal.debug.core.model.JDIStackFrame.stepOver(JDIStackFrame.java:415)
	at
org.eclipse.debug.internal.ui.actions.StepOverActionDelegate.stepAction(StepOverActionDelegate.java:30)
	at
org.eclipse.debug.internal.ui.actions.StepActionDelegate.doAction(StepActionDelegate.java:25)
	at
org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate$DebugRequestJob.run(AbstractDebugActionDelegate.java:97)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:67)
Comment 1 Darin Wright CLA 2005-03-07 10:48:51 EST
Is your target program also running on Sun's 1.4.2_05 VM?
Comment 2 Kevin Lai CLA 2005-03-07 11:17:40 EST
Yes, the target program is running on Sun's j2re1.4.2_05
Comment 3 Kevin Barnes CLA 2005-03-07 16:58:33 EST
Does reselecting the stack frame in the debug view allow you to step once again? Does this always 
happen using "Step Over" or do all the step actions have the same effect?
Comment 4 Kevin Lai CLA 2005-03-08 10:02:11 EST
Reselecting the stack frame does not allow me to step once again. All 3 
stepping operations (Step Into, Step Over, and Step Return) can cause this 
problem.

In order to reproduce this bug, there has to be several variables of sufficient 
complexity displayed in the variables view. Below is the code that I used and 
the steps to reproduce the bug:

import java.io.*;
public class Hello {

	private static int x=0;
	
	private static void f()
	{
		BufferedReader in = new BufferedReader(new
		InputStreamReader(System.in));
		int i=0;
		int j=0;
		x++;
		if(x<100)
			f();
	
		while(i<100)
		{
			j+=i;
			i++;
		}
	}

	public static void main(String[] args) {
		f();
	}

}

- Set a breakpoint at the while loop and remove it after the debug session 
starts.

- Expand the BufferedReader in the variables view so that at least some of its 
member variables are displayed

- Try the various stepping operations in quick succession by holding down onto 
their keyboard shortcuts


After causing this error for the first time. If I terminate the debug session,  
start a new one, and try stepping again, the following message gets printed to 
standard error:
Transport error, error code = -1

After that the debug session terminates because it got disconnected. The stack 
in the Debug View displays:
<disconnected> Hello at localhost:1304

There is no error log entry for the above error.
Comment 5 Darin Wright CLA 2005-03-08 10:16:41 EST
I am unable to reproduce the problem as shown. What version of Windows XP are 
you running? What sort of hardware are you using?
Comment 6 Kevin Lai CLA 2005-03-08 10:31:13 EST
My machine is an IA32 running Windows XP with Service Pack 2.
Comment 7 Kevin Barnes CLA 2005-03-08 13:50:26 EST
released change to PacketReceiveManager. Slightly changed the synchronization of getReply(), and 
made error message more detailed when a Timeout occurs.
Comment 8 Kevin Barnes CLA 2005-03-08 14:00:02 EST
Created attachment 18544 [details]
Replacement jdt.debug plugin

Kevin (L),
Is there any chance that you could run your test with today's I-Build and this
jdt.debug plugin? It may give us some more useful info in the error messages.
Comment 9 Kevin Lai CLA 2005-03-08 14:45:38 EST
Created attachment 18550 [details]
Error log for StepReturn in Eclipse I20050308-0835

This is the complete error log as I started Eclipse I20050308-0835, created the
test project, and then ran it. I tested the Step Return operation this time and
held down the F9 key.
Comment 10 Kevin Barnes CLA 2005-03-08 14:57:37 EST
What we really need is a trace from today's build with the attached jdt.debug plugin. To get this you'll 
need to unzip the plugin attached and copy/paste the unzipped plugin into the <eclipse_home>/
plugins directory on your machine. After doing this it's best to start eclipse with the -clean option to be 
sure that the new plugin is loaded properly (eclipse.exe -clean). Today's changes are not included in 
any build yet. Sorry for the confusion.
Comment 11 Kevin Lai CLA 2005-03-08 15:19:54 EST
Sorry, I forgot to mention that I overwrote the jdt.debug plugin in today's 
build with the one you supplied before I ran the tests. So the error log I 
attached should be correct.
Comment 12 Kevin Barnes CLA 2005-03-08 15:29:12 EST
Created attachment 18555 [details]
new plugin

ugh. I forgot to release changes to the properties file. Working on too many
machines at once. Sorry, please try this new plugin.
Comment 13 Kevin Lai CLA 2005-03-08 15:39:36 EST
Created attachment 18558 [details]
New Error log for step return on Eclipse I20050308-0835

Here's the new error log, using the new plugin. Hope it'll be useful.
Comment 14 Kevin Barnes CLA 2005-03-09 10:07:53 EST
These look like real timeouts. You can increase the timeout on the Preferences/Java/Debug page. 3 
seconds should be long enough though.
These timeouts are occuring in the UI thread. Should move host-target communication out of UI thread.
Comment 15 Kevin Barnes CLA 2005-03-09 10:18:45 EST
Kevin, Are you running ZoneLabs (or another firewall)? Could you disable it and run your test again. I'm 
wondering if there is something causing packet loss between the host and target.
Comment 16 Kevin Lai CLA 2005-03-09 10:55:58 EST
You're right. Turning off the firewall seems to solve the problem. I notice 
there's firewall activity whenever I perform stepping operations.

However, increasing the timeout setting seems to solve the problem too. Seems 
like the higher I set it, the lesser the chance the exception occurs... 

Maybe it's a performance problem, and has nothing to do with packet loss. 
Perhaps I'm just stressing out Eclipse too much by stepping so fast?
Comment 17 Kevin Barnes CLA 2005-03-09 11:38:41 EST
Good questions! How fast is your machine? My WinXP box is a P4 2.66 GHz with 768MB of RAM running 
ZoneLabs firewall. I don't get Timeouts when holding the F6 on it. 
I'm also on SP1 still. I'll try upgrading my machine to SP2
Does your firewall have a log file? Is there anything in it?
Comment 18 Kevin Lai CLA 2005-03-09 12:55:20 EST
My machine is a P4 3.2 GHz with 1.5 GB Ram running Windows XP with SP2

I'm also running Zone Labs, and I don't notice anything in the log file.

Actually the error seems to be occuring a lot less often now... Maybe I was 
just running too many programs last time, causing Eclipse to run slowly and 
generate those timeout exceptions.
Comment 19 Darin Wright CLA 2005-04-04 15:38:02 EDT

*** This bug has been marked as a duplicate of 83937 ***