Bug 563005 - standard output from debug session different from normal run inside IDE (for java)
Summary: standard output from debug session different from normal run inside IDE (for ...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.16   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-09 22:02 EDT by NICOLAS COXON CLA
Modified: 2024-04-23 16:05 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NICOLAS COXON CLA 2020-05-09 22:02:19 EDT
I don't know how interested you are in this, but I have been seeing strange behaviour using Eclipse IDE for java development.

Summary:
I have a code base that outputs Strings (conjugated Spanish verbs) to stdout. I can run it in three ways:

(1) Export as a jar, and run in a normal Linux terminal
(2) run in the Eclipse debugger (without any breakpoints)
(3) run in the IDE *without* debugging.

The output for a particular input String is always the same and correct with (1) and (2).

The output for the same input String is kind of random with (3).

I switched using the Eclipse IDE auto-generated toString() method to check. Same behaviour.

This is the output in the three scenarios:

(1) Exported jar in terminal window

INF: decir  No of Present TIDS: 2
Conjugation [main=[diga, digas, diga, digamos, digáis, digan], alt1=null, alt2=null]

(2) Eclipse IDE when running in debug mode (without breakpoints)

INF: decir  No of Present TIDS: 2
Conjugation [main=[diga, digas, diga, digamos, digáis, digan], alt1=null, alt2=null]


(3) Eclipse IDE when running app directly -- i.e. not in debug mode

INF: decir  No of Present TIDS: 2
Conjugation [main=[e,ia, e,ias, e,ia, e,iamos, e,iáis, e,ian], alt1=null, alt2=null]


The last output (3) is incorrect. It should be like (1) and (2), which are correct. There is no different between the code in the three scenarios.

I can tell that in (3), it appears that the spurious data is an amalgamation of data read from a SAXParser object and static constant data.

But there is no reason any of it should appear. The toString() method of the Conjugation class (which is being printed) is as follows (auto generated by the IDE)

@Override
	public String toString() {
		return "Conjugation [main=" + main + ", alt1=" + alt1 + ", alt2=" + alt2 + "]";
	}


It's kind of spooky, and very annoying, that I have to run the application in debug mode to get it to work (or export it).

I can pass you a tarball of all the code if you are interested in tracking this down.

Cheers

-Huw
Comment 1 Sarika Sinha CLA 2020-05-12 00:50:49 EDT
This is strange, we have heard of cases other way around.
Can you add the jar which we can try to reproduce with Eclipse SDK.
Comment 2 Eclipse Genie CLA 2022-05-03 02:18:25 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 3 Eclipse Genie CLA 2024-04-23 16:05:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.