Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » different results between debug mode and run mode of Eclipse JDT
different results between debug mode and run mode of Eclipse JDT [message #647771] Sat, 08 January 2011 19:58 Go to next message
jiangfan shi is currently offline jiangfan shi
Messages: 4
Registered: January 2011
Junior Member
Hi,

When I set up a break point, in the debug mode the execution was
successful after my program stopped and continued from the break point. When
I cleared the break point, in the debug mode the execution of my program
threw an exception. When I ran my program in the normal run mode, my program threw a same exception. There are other scenarios, but I just want to put a
long story short, and make my question clear here.

Does anyone encounter such strange phenomenon before? Are there some
solutions? For me, I have changed the Eclipse from 3.6 to 3.5 with 4
versions, and the phenomenon is same. My OS is Ubuntu 10.10, the
latest version.

I have changed my current Sun JDK versions from 1.6.0.23 to 1.6.0.16, and to openjdk 6, and nothing is changed.

Any idea?

Thanks a lot and appreciate your help in advance!

Jiangfan
Re: different results between debug mode and run mode of Eclipse JDT [message #647784 is a reply to message #647771] Sat, 08 January 2011 23:48 Go to previous messageGo to next message
Walter Harley is currently offline Walter Harley
Messages: 847
Registered: July 2009
Senior Member
On 1/8/11 11:58 AM, jiangfan shi wrote:
> Hi,
>
> When I set up a break point, in the debug mode the execution was
> successful after my program stopped and continued from the break point.
> When
> I cleared the break point, in the debug mode the execution of my program
> threw an exception. When I ran my program in the normal run mode, my
> program threw a same exception.

Is your program multithreaded, or is it invoking something that has
multithreaded behavior? What you describe is very common when there are
race conditions. Stopping at the breakpoint changes the timing.
Re: different results between debug mode and run mode of Eclipse JDT [message #647788 is a reply to message #647784] Sun, 09 January 2011 02:12 Go to previous messageGo to next message
Stanimir Stamenkov is currently offline Stanimir Stamenkov
Messages: 254
Registered: July 2009
Senior Member
Sat, 08 Jan 2011 15:48:27 -0800, /Walter Harley/:
> On 1/8/11 11:58 AM, jiangfan shi wrote:
>
>> When I set up a break point, in the debug mode the execution was
>> successful after my program stopped and continued from the break
>> point. When I cleared the break point, in the debug mode the
>> execution of my program threw an exception. When I ran my program
>> in the normal run mode, my program threw a same exception.
>
> Is your program multithreaded, or is it invoking something that
> has multithreaded behavior? What you describe is very common when
> there are race conditions. Stopping at the breakpoint changes the
> timing.

One could set the breakpoint to suspend the VM (all threads) instead
of only the thread which hit the break. Then stepping over the
thread while the others are still stopped, one may be able to
reproduce the problem, but not guaranteed if more than two threads
are involved in the problem itself.

Also, I've once read about "printpoints" which could help in
debugging multithreaded applications:

http://www.eclipse-tips.com/tips/29-types-of-breakpoints-in- eclipse#Printpoint

--
Stanimir
Re: different results between debug mode and run mode of Eclipse JDT [message #647838 is a reply to message #647784] Sun, 09 January 2011 19:16 Go to previous messageGo to next message
jiangfan shi is currently offline jiangfan shi
Messages: 4
Registered: January 2011
Junior Member
Hi, Walter and Stanimir,

Thanks for your responses.

My program is not multi-thread program, and that is why I am very curious such phenomenon. Previously I have run my program for many times, and I never encountered such inconsistent program behaviour before. That is, the debug mode executes a different sequence of byte codes than the normal run mode, and from my observation, such sequence of debug mode is always shorter than the run mode.

I also found a link about a similar but different bug link of Eclipse, which is very old around 2004. https://bugs.eclipse.org/bugs/show_bug.cgi?id=53784

Stanimir, for your given link, I found field break points are very useful option for me. I have thought these will be techniques inside runtime monitoring, and did not expect it appears in the normal debug mode. But these options are indeed good techniques inside the debug. I will try these.

Any other hints ?

Best,

Jiangfan
Re: different results between debug mode and run mode of Eclipse JDT [message #647848 is a reply to message #647838] Mon, 10 January 2011 02:36 Go to previous message
jiangfan shi is currently offline jiangfan shi
Messages: 4
Registered: January 2011
Junior Member
Hi, Walter and Stanimir,

Though I did not find the bug, I did find a solution. Just reinstall my Ubuntu 10.10 OS, and everything else like Eclipse 3.6.1, Jdk 1.6.0_23. Then the debug mode is now stable again.

Best,

Jiangfan

Previous Topic:Terminating and ILaunch from a Plug-in - non-standard method required
Next Topic:i can't deploy process bpel in ode
Goto Forum:
  


Current Time: Fri Oct 24 07:20:38 GMT 2014

Powered by FUDForum. Page generated in 0.05889 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software