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

Bug 196067

Summary: Attaching to TI/PI agent on Linux hangs after executing is complete
Product: z_Archived Reporter: Paul Klicnik <pklicnik>
Component: TPTPAssignee: Igor Alelekov <igor.alelekov>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P1 CC: igor.alelekov, jkubasta
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Paul Klicnik CLA 2007-07-10 16:25:57 EDT
Build ID: TPTP-4.4.0.1-200707090100

Steps To Reproduce:
1. Start to profile a class with JVMTI (eg  java '-agentlib:JPIBootLoader=JPIAgent:server=controlled;CGProf' InOut)
2. Attach to the agent from the workbench
3. When the class finishes executing, the terminal window hangs and doesn't return to a bash prompt. The workbench still thinks the class is executing and is still 'Attached' although no data is being collected. 


More information:
This problem only seems to occur on Linux EM64T. This is a strange bug in that it is not always reproducible. I have seen this work without problems a few times, but it hangs a large majority of the time. 

This is a major defect because Ctrl-C on the process does not kill the agent - the only way you can get the terminal to become responsive again is to kill the ACServer.
Comment 1 Samson Wai CLA 2007-08-20 13:04:20 EDT
This happend to the PI agent as well. The java process becomes "defunct" upon program termination. Stopping the AC will release the defunct process.

Since PI and TI are completely separete code base I think this is an AC bug instead.
Comment 2 Samson Wai CLA 2007-08-21 14:32:20 EDT
Hi Igor. Do you know where in the AC code is closing the agent named pipe after it finishes sending messages to the agent?
Comment 3 Igor Alelekov CLA 2007-08-22 03:36:24 EDT
Hi Samson,
It depends on the agent's API - RAC/AC.

For TI - in NamedPipeListene.c (transport/namedPipeTL).
For PI - in ACTL (transport/TPTPAgentCompTL).

Comment 4 Samson Wai CLA 2007-08-23 11:04:21 EDT
One important note:
For 32-bit: The hang occurs on Fedora Core 6 running on SMP Pentium 3
For 64-bit: The hang occurs on Fedora Core 6 running on dual-core Pentium D

It seems like it only occurs under a very specific configuration: multi-cpu/core with FC6.
Comment 5 Samson Wai CLA 2007-08-23 14:36:36 EDT
Further investigation shows that this is a Fedora Core 6 only problem.

I have tested the program multiple times on our second Linux/EM64T (RHEL4 running multi-core EM64T) and it does not hang.

Decreasing severity and not going to fix for 4.4.1.
Comment 6 Samson Wai CLA 2007-11-27 09:30:29 EST
Hi Bing. I have transferred my bugs to you for triage. Thanks.
Comment 7 Bing Xu CLA 2008-01-24 11:08:51 EST
Hi Jonathan, this is on native side.   Can you take a look.
Comment 8 Igor Alelekov CLA 2008-04-02 09:38:33 EDT

*** This bug has been marked as a duplicate of bug 224912 ***
Comment 9 Paul Klicnik CLA 2010-06-10 14:12:52 EDT
Closing