8143911: java/lang/StackWalker tests fail on Solaris with IllegalStateException

Mandy Chung mandy.chung at oracle.com
Wed Nov 25 03:15:26 UTC 2015


> On Nov 24, 2015, at 6:28 PM, David Holmes <david.holmes at oracle.com> wrote:
> 
> Hi Mandy,
> 
> Seems okay.
> 
> I presume when you say the anchor is unsigned, you mean it represents an external unsigned value? So -1 is the only sentinel value being used?

Anchor is an internal unsigned value.  It’s a native address (VM StackFrameAnchor created when the stack walking begins) and then get cleared when the stack walking is done.

I want to rethink a little bit as a follow up whether anchor could be something different. 

The patch is on its way to hs-rt and so the commit message can’t add you as the reviewer, sorry for that David.  Thanks for the review.

Mandy

> 
> Thanks,
> David
> 
> On 25/11/2015 8:37 AM, Mandy Chung wrote:
>> 
>>> On Nov 24, 2015, at 2:20 PM, Daniel D. Daugherty <daniel.daugherty at oracle.com> wrote:
>>> 
>>> You use both 'this.anchor' and 'anchor'. Seems inconsistent.
>> 
>> 
>> Oh yeah.  I took out “this.” from it.
>> 
>> diff --git a/src/java.base/share/classes/java/lang/StackStreamFactory.java b/src/java.base/share/classes/java/lang/StackStreamFactory.java
>> --- a/src/java.base/share/classes/java/lang/StackStreamFactory.java
>> +++ b/src/java.base/share/classes/java/lang/StackStreamFactory.java
>> @@ -225,17 +225,17 @@
>>              }
>>              switch (state) {
>>                  case NEW:
>> -                    if (this.anchor != 0) {
>> +                    if (anchor != 0) {
>>                          throw new IllegalStateException("This stack stream is being reused.");
>>                      }
>>                      break;
>>                  case OPEN:
>> -                    if (this.anchor <= 0) {
>> -                        throw new IllegalStateException("This stack stream is not valid for walking");
>> +                    if (anchor == 0 || anchor == -1L) {
>> +                        throw new IllegalStateException("This stack stream is not valid for walking: " + anchor);
>>                      }
>>                      break;
>>                  case CLOSED:
>> -                    if (this.anchor != -1L) {
>> +                    if (anchor != -1L) {
>>                          throw new IllegalStateException("This stack stream is not closed.");
>>                      }
>>              }
>> 
>> Mandy
>> 




More information about the core-libs-dev mailing list