Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 168884

Summary: Test executions dump core on native call RemoteComponentSkeleton.deregister0()
Product: z_Archived Reporter: Joe Toomey <jptoomey>
Component: TPTPAssignee: Samson Wai <samwai>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P1 CC: jkubasta, kdsiefke, paulslau, samwai, thays, toddmm
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Debug DLL
none
Potential fix none

Description Joe Toomey CLA 2006-12-21 13:27:55 EST
I see this repeatedly for JUnit and AutoUI tests.  Have not seen it for Manual tests.  The following stack trace appears in the core dump on the main thread:

0SECTION       THREADS subcomponent dump routine
NULL           =================================
NULL            
1XMCURTHDINFO  Current Thread Details
NULL           ----------------------
3XMTHREADINFO      "Thread-1" (TID:0x22344B00, sys_thread_t:0x22E14E14, state:R, native ID:0x00000D98) prio=5
4XESTACKTRACE          at org/eclipse/hyades/internal/execution/remote/RemoteComponentSkeleton.deregister0(Native Method)
4XESTACKTRACE          at org/eclipse/hyades/internal/execution/remote/RemoteComponentSkeleton.deregister(RemoteComponentSkeleton.java:254)
4XESTACKTRACE          at org/eclipse/hyades/test/common/runner/HyadesRunner$1.run(HyadesRunner.java:245)

It's not clear to me if this is an AC issue or a test framework issue, but the core dump is happening in the native AC code shown above, and I'm not sure what we could be doing to cause it.  This problem only appears on Vista.

To reproduce:  Create a TPTP JUnit test, start the agent controller, run the JUnit test through TPTP, lookin system temp directory for core dump.  (On Vista, this appears to be C:\Users\<username>\AppData\Local\Temp)
Comment 1 Joe Toomey CLA 2006-12-22 12:15:55 EST
*** Bug 168931 has been marked as a duplicate of this bug. ***
Comment 2 Karla Callaghan CLA 2007-01-12 12:07:26 EST
Re-assigning to Platform.Execution for further investigation.  See similar bug 170274.
Comment 3 Karla Callaghan CLA 2007-01-22 13:46:04 EST
I incorrectly assigned to Igor. Reassigning to Joanna to find resource to investigate.
Comment 4 Samson Wai CLA 2007-01-25 10:54:09 EST
Hi Joe, have you start the AC as administrator when you encounter this problem?
Comment 5 Joe Toomey CLA 2007-01-25 11:04:52 EST
Yes.  AC always started with "Run As Administrator"
Comment 6 Samson Wai CLA 2007-01-25 13:44:38 EST
Hi Joe. I have installed the current 4.2.2 test pass driver (200701151346) but cannot reproduce the core dump. Is it possible for you to verify if the failure still occurs during your 4.2.2 testing? Thanks.
Comment 7 Joe Toomey CLA 2007-01-25 14:33:34 EST
Hi Samson.

I have verified that they are still happening.  I also see half a dozen small core dumps in your user temp directory on the machine, so maybe you didn't see them.  It is more noticable when you run an involved test that creates a large heap before the test is done, because then the test stopping takes a long time (because it takes a long time to write out the heap dump.)

Your core files are in C:\Users\samwai\AppData\Local\Temp\samwai.
Comment 8 Samson Wai CLA 2007-01-25 15:31:59 EST
Created attachment 57543 [details]
Debug DLL

Here is the debug version of the java agent binding.
Comment 9 Samson Wai CLA 2007-01-25 16:53:17 EST
Created attachment 57550 [details]
Potential fix

The problem is caused by the java agent binding trying to free a piece of memory which it does not allocate (that memory is passed to the agent binding by the JVM). Commenting out the free() function makes the problem go away.
Comment 10 Samson Wai CLA 2007-01-25 16:53:56 EST
Comment on attachment 57543 [details]
Debug DLL

No need to use this DLL.
Comment 11 Samson Wai CLA 2007-01-26 09:47:15 EST
*** Bug 170274 has been marked as a duplicate of this bug. ***
Comment 12 Samson Wai CLA 2007-01-26 14:13:30 EST
Investigation does not pin point where the failure in the native code really is. I will continue to work on this but getting this into 4.2.2 is not optimistic. Retarget this to 4.4 i1.
Comment 13 Samson Wai CLA 2007-01-31 16:09:41 EST
Set priority to P1 for 4.4 plan closure.
Comment 14 Samson Wai CLA 2007-02-01 12:13:46 EST
I have a freshly installed Vista Ultimate and found out that I cannot use IBM JRE 1.5.0 SR3 due to a missing "MSVCR71.DLL" Microsoft runtime library. I therefore switch to use Sun JDK 1.5.0_11. The reported problem can be reproduced but the attached patch fixed the problem using this JDK.

Joe, in the meantime could you try the attached patch with Sun JRE 1.5.0_11? I will chase down the IBM JRE problem which might eventually end up to be a JRE problem.
Comment 15 Samson Wai CLA 2007-02-01 15:03:23 EST
Just found a workaround for the missing MSVCR71.DLL problem - by adding IBM JDK's "jre/bin" directory to the PATH before starting the AC.

With the above workaround and the patched DLL I can run a AGR test successfully without any core dump being generated. I am using the TPTP-4.2.2-200701291553 driver.
Comment 16 Samson Wai CLA 2007-02-22 10:30:01 EST
*** Bug 170339 has been marked as a duplicate of this bug. ***
Comment 17 Samson Wai CLA 2007-03-08 14:31:01 EST
Fix checked into CVS 2007/03/08 14:23 EST.
Comment 18 Joe Toomey CLA 2007-07-10 16:06:17 EDT
Verified in 4.4.  Closing.