JDK-6392604 : JVMTI spec: add error codes for GetThreadListStackTraces
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-03-01
  • Updated: 2017-05-16
  • Resolved: 2006-07-31
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.
JDK 6
6 b79Fixed
Description
Two new error code have to be specified for GetThreadListStackTraces:
  JVMTI_ERROR_INVALID_THREAD

The details are discussed below:

> Spec questions for GetThreadListStackTraces:
> Q1: Does it make sense to specify that the GetThreadListStackTraces()
>     also returns JVMTI_ERROR_INVALID_THREAD ?
>     The function has to return some error code if any element of the
>     thread_list array is invalid.
>     None of the universal errors matches this semantics.

Good point.  Oh boy, a new spec bug.  Do you want to file it?

>
> Q2: Does the function returns stack traces if a thread is not alive?
>     The passes jthread ID can be valid in this case.
>     Should we specify that the function returns JVMTI_ERROR_THREAD_NOT_ALIVE.
>     BTW, the GetStackTrace may return both:
>       JVMTI_ERROR_INVALID_THREAD and JVMTI_ERROR_THREAD_NOT_ALIVE.

I think not, see this from the spec:

    If a thread terminates before the stack information is collected, a zero length stack (jvmtiStackInfo.frame_count will be zero) will be returned and the thread jvmtiStackInfo.state can be checked.

Probably should add if it hasn't started yet.

Thanks,
Robert

Comments
EVALUATION Need to add the invalid thread error code and clarify that not yet started threads are handled the same as terminated threads.
17-03-2006