Hi Gary,
Unfortunately GetStackTrace() returns the top frame as the first frame in the array. Thus if the thread is not suspended and later you call GetFrameLocation() for some depth, there's no way to make sure the frame at that depth is the same frame at that depth in the array returned by GetStackTrace() unless you first suspend the frame before calling GetFrameLocation(). You would also need to call GetFrameCount() while suspended, compare that with the number of frames returned by GetStackTrace(), and make any needed depth adjustments. But since I think the intent is to not suspend the thread here, it probably does not make sense to do that, and instead accept that there might be some errors as you have done. One improvement I would like to see for your fix is to only ignore JVMTI_ERROR_NO_MORE_FRAMES rather than ignore all failures when suspended == NSK_TRUE. Also, I don't think you want the suspended check here: 348 /* check if expected method frame found */ 349 if ((suspended == NSK_TRUE) && (found <= 0)) { The check for finding the method is: 341 if (frameStack[j].method == threadsDesc[i].method) { Since frameStack[] is returned by GetStackTrace(), it is not impacted when not suspended, and the expected method should always be in frameStack[] somewhere. The issue is only with using GetFrameLocation() to correlate what is in the result of GetStackTrace(). thanks, Chris On 12/13/18 5:25 AM, Gary Adams wrote: While testing I ran into another of the related failures that were
|
- RFR: JDK-8051349: nsk/jvmti/scenarios/sampling/... Gary Adams
- Re: RFR: JDK-8051349: nsk/jvmti/scenarios/... Chris Plummer
- Re: RFR: JDK-8051349: nsk/jvmti/scenarios/... serguei.spit...@oracle.com
- Re: RFR: JDK-8051349: nsk/jvmti/scenarios/... Gary Adams
- Re: RFR: JDK-8051349: nsk/jvmti/scenar... Chris Plummer
- Re: RFR: JDK-8051349: nsk/jvmti/sc... Gary Adams
- Re: RFR: JDK-8051349: nsk/jvmt... Chris Plummer
- Re: RFR: JDK-8051349: nsk... gary.ad...@oracle.com
- Re: RFR: JDK-8051349:... gary.ad...@oracle.com
- Re: RFR: JDK-8051... serguei.spit...@oracle.com
- Re: RFR: JDK-8051... Chris Plummer
- Re: RFR: JDK-8051... David Holmes
- Re: RFR: JDK-8051... Chris Plummer
- Re: RFR: JDK-8051349: nsk/jvmt... David Holmes