[OpenJDK 2D-Dev] [9]: RFR JDK-8023213 [macosx] closed/java/awt/FontClass/NaNTransform.java fails on MacOS X 10.9

Philip Race philip.race at oracle.com
Wed Nov 4 23:24:40 UTC 2015

This does not look right to me. Who knows what data is on the canvas ?
it is not clear that it is 'blank'. It could have data from a previous 
glyph .. I am not
sure how you know for sure. I can see that canvas is re-used. There is 
to a "global shared canvas".
And the actual function you invoke is one of two : one for grey and one 
for lcd and
looking at the grey one CGGI_CopyImageFromCanvasToAlphaInfo)
it utilises info->width and info->height which can't be NaN because they
are uint16 but I don't know if they are valid .. and is the "image" field
allocated to be 0 length ? Could you step through how this is all guaranteed
to be safe/correct ?


On 11/2/15, 12:41 AM, prasanta sadhukhan wrote:
> Hi Phil,
> I have modified as per your review to populate GlyphInfo with "empty" 
> glyph
> and also moved your existing test to "open"
> I also added a Infinite Transform test along with your NaN transform 
> just incase (in fact Sergey informally asked me to check)
> http://cr.openjdk.java.net/~psadhukhan/8023213/webrev.01/
> Regards
> Prasanta
> On 10/30/2015 1:03 AM, Phil Race wrote:
>> Should this new check go before this :
>> CGGI_ClearCanvas(canvas, info);
>> since it is using info which is where you get NaN from.
>> And should we then populate the returned canvas and info to
>> ensure that we return an "empty" glyph rather than garbage values ?
>> It is not clear to me that this is occurring.
>> Why does the bug report not contain the evaluation below ?
>> Also why is there a new test ? I would expect SQE would
>> want to run the existing test to verify this fix.
>> Should we not just open the existing test ?
>> -phil.
>> On 10/13/2015 04:49 AM, prasanta sadhukhan wrote:
>>> Gentle reminder for review
>>> Regards
>>> Prasanta
>>> On 10/6/2015 3:25 PM, prasanta sadhukhan wrote:
>>>> Hello All,
>>>> Please review a fix for jdk9
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8023213
>>>> webrev: http://cr.openjdk.java.net/~psadhukhan/8023213/webrev.00/
>>>> drawString takes long time in mac native call 
>>>> CGContextShowGlyphsAtPoint() if NaN transform is used which 
>>>> translated to x & y being NaN.
>>>> Fix is to prevent calling mac api for such invalid usage.
>>>> Regards
>>>> Prasanta

More information about the 2d-dev mailing list