RFR: 8029630: Print thread id hex representation in error messages.

Max Ockner max.ockner at oracle.com
Thu Apr 16 14:15:05 UTC 2015


Ok, I will commit this. Thanks to David, Harold, Thomas, and Staffan for 
your help.

Max

On 4/15/2015 10:35 PM, David Holmes wrote:
> Thumbs up!
>
> Thanks,
> David
>
> On 15/04/2015 11:50 PM, Max Ockner wrote:
>> I had a few things mixed up in the last webrev. Either way, I have
>> changed this, hopefully for the last time. vmError.cpp now uses
>> INTPTR_FORMAT.
>>
>> webrev:  http://cr.openjdk.java.net/~mockner/8029630.final/
>>
>> tested with jprt.
>>
>>
>> Thanks,
>> Max
>>
>> On 4/13/2015 6:56 PM, David Holmes wrote:
>>> Hi Max,
>>>
>>> On 14/04/2015 6:25 AM, Max Ockner wrote:
>>>> Hello,
>>>>
>>>> Modified this again. I defined TID_FORMAT to make it a better semantic
>>>> match.
>>>
>>> Not sure that actually improves anything. There is no "tid" type.
>>> Primarily what we have is a function returning intx and we want to
>>> print it as hex. I still think INTPTR_FORMAT suffices. Otherwise
>>> INTX_HEX_FORMAT is you really want to introduce something new - but I
>>> don't suggest doing that.
>>>
>>>> Webrev: http://cr.openjdk.java.net/~mockner/8029630.8/
>>>
>>> I still see vmError.cpp using PTR_FORMAT ??
>>>
>>> Sorry.
>>>
>>> David
>>>
>>>> Tested with jprt
>>>>
>>>> Thanks,
>>>> Max
>>>>
>>>> On 4/9/2015 9:48 PM, David Holmes wrote:
>>>>> Hi Max,
>>>>>
>>>>> On 10/04/2015 5:11 AM, Max Ockner wrote:
>>>>>> Hi again,
>>>>>> After working past some build issues, I have a new webrev. I've
>>>>>> changed
>>>>>> %x to PTR_FORMAT, and I've removed the modification to thread.cpp
>>>>>>
>>>>>> New webrev: http://cr.openjdk.java.net/~mockner/8029630.4/
>>>>>
>>>>> I think INTPTR_FORMAT would be more of a semantic match as the thread
>>>>> id is not a pointer type.
>>>>>
>>>>> David
>>>>>
>>>>>> Thanks,
>>>>>> Max
>>>>>>
>>>>>> On 4/6/2015 9:10 PM, David Holmes wrote:
>>>>>>> Hi Max,
>>>>>>>
>>>>>>> On 3/04/2015 5:38 AM, Max Ockner wrote:
>>>>>>>> Hello,
>>>>>>>> Please review this change:
>>>>>>>>
>>>>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8029630
>>>>>>>> Webrev: http://cr.openjdk.java.net/~mockner/8029630.2/
>>>>>>>> Summary: Existing error messages for vm crashes print the decimal
>>>>>>>> representation of the current thread id. The message format has 
>>>>>>>> been
>>>>>>>> changed to print the hex value of the thread id.
>>>>>>>
>>>>>>> src/share/vm/runtime/thread.cpp
>>>>>>>
>>>>>>> The change is incorrect and unnecessary. 'this' is a pointer 
>>>>>>> type so
>>>>>>> INTPTR_FORMAT seems correct (though it may need p2i(this)?) 
>>>>>>> while %x
>>>>>>> assumes 'this' is always 32-bit. Further INTPTR_FORMAT is 
>>>>>>> already hex
>>>>>>> not decimal.
>>>>>>>
>>>>>>> src/share/vm/utilities/vmError.cpp
>>>>>>>
>>>>>>> As Thomas pointed out%x assumes 32-bit and so is incorrect for intx
>>>>>>> type. As intx is a typedef for intptr_t then INTPTR_FORMAT 
>>>>>>> should be
>>>>>>> usable here as well.
>>>>>>>
>>>>>>> David
>>>>>>>
>>>>>>>> Tested with jtreg runtime to make sure nothing was broken. I 
>>>>>>>> tested
>>>>>>>> the
>>>>>>>> new functionality separately. I crashed the vm and examined the
>>>>>>>> debugger
>>>>>>>> output to make sure the hexadecimal thread id printed in the error
>>>>>>>> message matched one of the threads listed by the debugger.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Max
>>>>>>
>>>>
>>



More information about the hotspot-dev mailing list