Bug 217078 - [compiler] compiler.regression.RuntimeTests#test0001_memory_exhaustion failing when using IBM JRE
Summary: [compiler] compiler.regression.RuntimeTests#test0001_memory_exhaustion failin...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.4 M7   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-30 07:09 EST by Eric Jodet CLA
Modified: 2008-04-28 07:18 EDT (History)
5 users (show)

See Also:
kent_johnson: review+


Attachments
IBM JRE's details (400 bytes, text/file)
2008-01-30 07:09 EST, Eric Jodet CLA
no flags Details
Test results using 1.5 JRE (14.81 KB, text/file)
2008-01-30 07:10 EST, Eric Jodet CLA
no flags Details
Dumps produced using 1.5 JRE (113.29 KB, application/x-zip-compressed)
2008-01-30 07:11 EST, Eric Jodet CLA
no flags Details
Test results using 1.6 JRE (19.81 KB, text/file)
2008-01-30 07:11 EST, Eric Jodet CLA
no flags Details
Dumps produced using 1.6 JRE (116.62 KB, application/x-zip-compressed)
2008-01-30 07:12 EST, Eric Jodet CLA
no flags Details
Fix (test cases only indeed) (15.37 KB, patch)
2008-04-01 05:12 EDT, Maxime Daniel CLA
no flags Details | Diff
Fix (test cases tunin) (16.78 KB, patch)
2008-04-01 07:29 EDT, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Jodet CLA 2008-01-30 07:09:12 EST
Created attachment 88259 [details]
IBM JRE's details

Version: 3.4.0
Build id: I20080129-1400

RuntimeTests#test0001_memory_exhaustion fails when using IBM JRE 1.5 or 6.0

I'll attach:
- both JRE details
- failing test details
- dumps produced while test failed

These tests are OK when using a Sun JRE
Comment 1 Eric Jodet CLA 2008-01-30 07:10:15 EST
Created attachment 88260 [details]
Test results using 1.5 JRE
Comment 2 Eric Jodet CLA 2008-01-30 07:11:03 EST
Created attachment 88261 [details]
Dumps produced using 1.5 JRE
Comment 3 Eric Jodet CLA 2008-01-30 07:11:32 EST
Created attachment 88262 [details]
Test results using 1.6 JRE
Comment 4 Eric Jodet CLA 2008-01-30 07:12:05 EST
Created attachment 88263 [details]
Dumps produced using 1.6 JRE
Comment 5 Corey Ashford CLA 2008-03-20 14:38:53 EDT
This problem happens on linux-gtk-x86 as well as linux-gtk-ppc.  On ppc (POWER) the eclipse.org recommended JRE is the IBM one (there is no Sun JRE for POWER).

Since 3.4M5 came out, I've been seeing this error.

When I run the test code (X.class) on the command line using the IBM JRE, I see the following output:

JVMDUMP006I Processing Dump Event "systhrow", detail "java/lang/OutOfMemoryError" - Please Wait.
JVMDUMP007I JVM Requesting Snap Dump using '/home/corey/eclipse-SDK-3.4M5-linux-gtk-ppc/workspace_3.4M5/scratchpad/bin/Snap.20080320.113421.26270.0001.trc'
JVMDUMP010I Snap Dump written to /home/corey/eclipse-SDK-3.4M5-linux-gtk-ppc/workspace_3.4M5/scratchpad/bin/Snap.20080320.113421.26270.0001.trc
JVMDUMP007I JVM Requesting Heap Dump using '/home/corey/eclipse-SDK-3.4M5-linux-gtk-ppc/workspace_3.4M5/scratchpad/bin/heapdump.20080320.113421.26270.0002.phd'
JVMDUMP010I Heap Dump written to /home/corey/eclipse-SDK-3.4M5-linux-gtk-ppc/workspace_3.4M5/scratchpad/bin/heapdump.20080320.113421.26270.0002.phd
JVMDUMP007I JVM Requesting Java Dump using '/home/corey/eclipse-SDK-3.4M5-linux-gtk-ppc/workspace_3.4M5/scratchpad/bin/javacore.20080320.113421.26270.0003.txt'
JVMDUMP010I Java Dump written to /home/corey/eclipse-SDK-3.4M5-linux-gtk-ppc/workspace_3.4M5/scratchpad/bin/javacore.20080320.113421.26270.0003.txt
JVMDUMP013I Processed Dump Event "systhrow", detail "java/lang/OutOfMemoryError".
SUCCESS


Note that the test does succeed, but there is extra dump narrative info that comes out on stderr.  The SUCCESS message comes out to stdout.

One possible solution to this problem, then, would be to have the test harness discriminate between output going to stderr and that going to stdout.

I did look through the options to the IBM JRE and didn't find any switches related to suppressing the info going to stderr, but there might be such a switch somewhere.
Comment 6 Corey Ashford CLA 2008-03-24 15:19:31 EDT
I looked into the handling of stderr in the test harness in more detail, and found the following code in TestVerifier.java:

private boolean checkBuffers(String errorString, String outputString, String sourceFileName, String expectedSuccessOutputString) {

	if (errorString.trim().length() > 0) {
		this.failureReason =
			"Unexpected target error running resulting class file for "
				+ sourceFileName
				+ ":\n"
				+ errorString;
		return false;
	}
	String platformIndependantOutputString = Util.convertToIndependantLineDelimiter(outputString.trim());
	if (expectedSuccessOutputString != null && !Util.convertToIndependantLineDelimiter(expectedSuccessOutputString).equals(platformIndependantOutputString)) {
		System.out.println(Util.displayString(platformIndependantOutputString, 2));
		this.failureReason =
			"Unexpected output running resulting class file for "
				+ sourceFileName
				+ ":\n"
				+ "--[START]--\n"
				+ outputString
				+ "---[END]---\n";
		return false;
	}
	
	return true;
}


So the test harness is actually discriminating between output from stderr and that from stdout, but it's expecting stderr to be completely empty, rather than contain some narrative as it does when using the IBM JRE.

So one solution would be to add a boolean that says, essentially, "ignore the output of stderr as long as the output of stdout is correct".

This would only have to be set to true for these memory exhaustion tests, as none of the other tests, at least for now, cause any output on stderr.

The danger of getting a "false pass" because of this change would be small, I think, because the "SUCCESS" string would still be necessary.
Comment 7 Philipe Mulet CLA 2008-03-25 08:00:07 EDT
Or maybe only warn about stderr contents... like we do in other places in our tests.

As long as the output is correct, the test should pass.

BTW - do we know why we get these out of memories ? This could indicate a bug elsewhere...
Comment 8 Corey Ashford CLA 2008-03-25 13:42:11 EDT
(In reply to comment #7)
> Or maybe only warn about stderr contents... like we do in other places in our
> tests.
> 
> As long as the output is correct, the test should pass.
> 
> BTW - do we know why we get these out of memories ? This could indicate a bug
> elsewhere...
> 

Yes, the three failing tests intentionally cause an memory exhaustion exception to make sure the compiler and runtime handles it correctly.
Comment 9 Maxime Daniel CLA 2008-03-26 04:39:06 EDT
Sounds familiar. I'll take care of this.
Comment 10 Maxime Daniel CLA 2008-04-01 05:12:34 EDT
Created attachment 94335 [details]
Fix (test cases only indeed)
Comment 11 Maxime Daniel CLA 2008-04-01 07:29:11 EDT
Created attachment 94341 [details]
Fix (test cases tunin)
Comment 12 Maxime Daniel CLA 2008-04-01 08:09:08 EDT
Kent, would you please let me know what you think?
Comment 13 Maxime Daniel CLA 2008-04-02 07:29:55 EDT
Released for 3.4 M7.
Comment 14 Corey Ashford CLA 2008-04-02 12:54:52 EDT
Thanks.  It will be nice to see a clean pass on this test suite.
Comment 15 Maxime Daniel CLA 2008-04-17 10:48:45 EDT
Other users got impacted (in other streams). Reopening to solve in all affected streams.

Moreover, discussing the topic with Philippe we agreed that this test had potential negative impacts for other tests, while having moderate benefits if any in the compiler realm. Decision is to invalidate the test.
Comment 16 Maxime Daniel CLA 2008-04-17 10:53:37 EDT
Released for 3.4 M7 (again - test is disabled).
Comment 17 Maxime Daniel CLA 2008-04-17 10:58:43 EDT
Released in R3_3_maintenance.
Comment 18 Maxime Daniel CLA 2008-04-17 11:18:02 EDT
Released in R3_2_maintenance and R3_2_1_maintenance branches.
Comment 19 David Audel CLA 2008-04-28 07:18:48 EDT
Verified for 3.4M7 using I20080427-2000.