JDK-8215247 : SA: Further robustize the attach mechanism
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 9,10,11,12
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2018-12-12
  • Updated: 2020-03-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
JDK-8202884 proposes to robustize the SA attach mechanism to some extent. But there would still remain windows where threads would terminate before SA gets  a chance to attach to them. To further reduce this window, we need to try to attach to the thread as soon as the thread gets discovered (instead of first adding it to a thread list, and later iterating through it to invoke ptrace attach). This would reduce the window where the thread can exit. 
 Moreover, we need to deal with windows where new threads are getting created and SA is not attaching to them. This could be an issue since this means that some threads could still be running while SA is attached to the process. For this, we need to go through multiple iterations of discovering new threads (to capture the new threads which might have gotten spawned in between discovery and actual attach). This technique of multiple iterations is followed in other debuggers like gdb. Though JDK-8202884 was Linux specific, this would include the attach mechanism on various platforms.