[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] [9] RFR: JDK-8039412, , Stack overflow on Linux using DialogTypeSelection.NATIV
From:       Rajeev Chamyal <rajeev.chamyal () oracle ! com>
Date:       2015-11-17 11:18:13
Message-ID: 90b07074-119f-45b1-9b1e-1abedffd2c35 () default
[Download RAW message or body]

The fix looks good to me.

  

Regards,

Rajeev Chamyal

Subject: 

Re: [9] RFR: JDK-8039412,,Stack overflow on Linux using DialogTypeSelection.NATIVE

Date: 

Mon, 16 Nov 2015 12:42:06 -0800

From: 

Phil Race HYPERLINK "mailto:philip.race@oracle.com"<philip.race@oracle.com>

To: 

prasanta sadhukhan HYPERLINK \
"mailto:prasanta.sadhukhan@oracle.com"<prasanta.sadhukhan@oracle.com>

CC: 

Rajeev Chamyal HYPERLINK \
"mailto:rajeev.chamyal@oracle.com"<rajeev.chamyal@oracle.com>, HYPERLINK \
"mailto:2d-dev@openjdk.java.net"2d-dev@openjdk.java.net HYPERLINK \
"mailto:2d-dev@openjdk.java.net"<2d-dev@openjdk.java.net>

  

On 11/13/2015 12:24 AM, prasanta sadhukhan wrote:
> Hi Phil,
> 
> On 11/13/2015 12:23 AM, Philip Race wrote:
> > I am 99% sure this breaks the API on Windows on Mac.
> > Did you test what it does there ?
> > 
> It works on Windows as PrinterJob.pageDialog(attributes) calls 
> pageDialog(PageFormat page) in WPrinterJob.java which overrides 
> pageDialog(PageFormat) of RasterPrinterJob
> It also works on Mac as PrinterJob.pageDialog(attributes) calls 
> pageDialog(PageFormat page) in CPrinterJob.java which overrides 
> pageDialog(PageFormat) of RasterPrinterJob
> 
> I actually mistakenly mentioned down below that the check was added in 
> pageDialog(attributes) whereas actually
> the temporary removal and addition was added in pageDialog(PageFormat) 
> so it only affects linux printing dialog.
  
  
I see. So long as you have tested .. approved.
  
-phil.
  
> > Test has wild card imports again ..
> Corrected wild card imports. Updated webrev is here:
> http://cr.openjdk.java.net/~psadhukhan/8039412/webrev.01/
> 
> > 
> > Also please add evaluation and explanation of the proposed fix into a
> > public comment on the bug report before submitting for review.
> > 
> Added public comment.
> 
> Regards
> Prasanta
> > -phil.
> > 
> > On 11/6/15, 3:00 AM, prasanta sadhukhan wrote:
> > > Hi All,
> > > 
> > > Please review a fix for jdk9.
> > > 
> > > Bug: https://bugs.openjdk.java.net/browse/JDK-8039412
> > > webrev: http://cr.openjdk.java.net/~psadhukhan/8039412/webrev.00/
> > > 
> > > Issue was seen in linux whereby if we call PrinterJob.pageDialog() 
> > > after PrinterJob.printDialog() it results in StackOverflowError if 
> > > DialogSelectionType is NATIVE.
> > > 
> > > This was because pageDialog(attributes) was calling 
> > > pageDialog(pageformat) if it is DialogTypeSelection.NATIVE which 
> > > again calls pageDialog(attributes)
> > > via this code
> > > http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java#l767 \
> > >  
> > > and
> > > http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java#l743 \
> > >  
> > > 
> > > I added a fix whereby in pageDialog(attributes)we check if it is 
> > > DialogTypeSelection.NATIVE and remove this attribute temporarily 
> > > before calling pageDialog(pageformat)
> > > and restore the DialogTypeSelection.NATIVE after the call.
> > > It is similar to solution done in
> > > http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/PSPrinterJob.java#l443 \
> > >  
> > > 
> > > Regards
> > > Prasanta
> 
  

  

  


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;
	color:black;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML Preformatted Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";
	color:black;}
span.HTMLPreformattedChar
	{mso-style-name:"HTML Preformatted Char";
	mso-style-priority:99;
	mso-style-link:"HTML Preformatted";
	font-family:Consolas;
	color:black;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-IN link=blue \
vlink=purple><div class=WordSection1><p class=MsoNormal><span \
style='color:#1F497D'>The fix looks good to me.<o:p></o:p></span></p><p \
class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span style='color:#1F497D'>Regards,<o:p></o:p></span></p><p \
class=MsoNormal><span style='color:#1F497D'>Rajeev Chamyal<o:p></o:p></span></p><p \
class=MsoNormal> <o:p></o:p></p><table class=MsoNormalTable border=0 cellspacing=0 \
cellpadding=0><tr><td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p \
class=MsoNormal align=right style='text-align:right'><b>Subject: \
<o:p></o:p></b></p></td><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal>Re: \
[9] RFR: JDK-8039412,,Stack overflow on Linux using \
DialogTypeSelection.NATIVE<o:p></o:p></p></td></tr><tr><td nowrap valign=top \
style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right \
style='text-align:right'><b>Date: <o:p></o:p></b></p></td><td style='padding:0cm 0cm \
0cm 0cm'><p class=MsoNormal>Mon, 16 Nov 2015 12:42:06 \
-0800<o:p></o:p></p></td></tr><tr><td nowrap valign=top style='padding:0cm 0cm 0cm \
0cm'><p class=MsoNormal align=right style='text-align:right'><b>From: \
<o:p></o:p></b></p></td><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal>Phil \
Race <a href="mailto:philip.race@oracle.com">&lt;philip.race@oracle.com&gt;</a><o:p></o:p></p></td></tr><tr><td \
nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right \
style='text-align:right'><b>To: <o:p></o:p></b></p></td><td style='padding:0cm 0cm \
0cm 0cm'><p class=MsoNormal>prasanta sadhukhan <a \
href="mailto:prasanta.sadhukhan@oracle.com">&lt;prasanta.sadhukhan@oracle.com&gt;</a><o:p></o:p></p></td></tr><tr><td \
nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right \
style='text-align:right'><b>CC: <o:p></o:p></b></p></td><td style='padding:0cm 0cm \
0cm 0cm'><p class=MsoNormal>Rajeev Chamyal <a \
href="mailto:rajeev.chamyal@oracle.com">&lt;rajeev.chamyal@oracle.com&gt;</a>, <a \
href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a> <a \
href="mailto:2d-dev@openjdk.java.net">&lt;2d-dev@openjdk.java.net&gt;</a><o:p></o:p></p></td></tr></table><p \
class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p><pre>On 11/13/2015 \
12:24 AM, prasanta sadhukhan wrote:<o:p></o:p></pre><pre>&gt; Hi \
Phil,<o:p></o:p></pre><pre>&gt;<o:p>&nbsp;</o:p></pre><pre>&gt; On 11/13/2015 12:23 \
AM, Philip Race wrote:<o:p></o:p></pre><pre>&gt;&gt; I am 99% sure this breaks the \
API on Windows on Mac.<o:p></o:p></pre><pre>&gt;&gt; Did you test what it does there \
?<o:p></o:p></pre><pre>&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt; It works on Windows \
as PrinterJob.pageDialog(attributes) calls <o:p></o:p></pre><pre>&gt; \
pageDialog(PageFormat page) in WPrinterJob.java which overrides \
<o:p></o:p></pre><pre>&gt; pageDialog(PageFormat) of \
RasterPrinterJob<o:p></o:p></pre><pre>&gt; It also works on Mac as \
PrinterJob.pageDialog(attributes) calls <o:p></o:p></pre><pre>&gt; \
pageDialog(PageFormat page) in CPrinterJob.java which overrides \
<o:p></o:p></pre><pre>&gt; pageDialog(PageFormat) of \
RasterPrinterJob<o:p></o:p></pre><pre>&gt;<o:p>&nbsp;</o:p></pre><pre>&gt; I actually \
mistakenly mentioned down below that the check was added in \
<o:p></o:p></pre><pre>&gt; pageDialog(attributes) whereas \
actually<o:p></o:p></pre><pre>&gt; the temporary removal and addition was added in \
pageDialog(PageFormat) <o:p></o:p></pre><pre>&gt; so it only affects linux printing \
dialog.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>I \
see. So long as you have tested .. \
approved.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>-phil.<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>&gt;&gt; \
Test has wild card imports again ..<o:p></o:p></pre><pre>&gt; Corrected wild card \
imports. Updated webrev is here:<o:p></o:p></pre><pre>&gt; <a \
href="http://cr.openjdk.java.net/~psadhukhan/8039412/webrev.01/">http://cr.openjdk.jav \
a.net/~psadhukhan/8039412/webrev.01/</a><o:p></o:p></pre><pre>&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt; \
Also please add evaluation and explanation of the proposed fix into \
a<o:p></o:p></pre><pre>&gt;&gt; public comment on the bug report before submitting \
for review.<o:p></o:p></pre><pre>&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt; Added \
public comment.<o:p></o:p></pre><pre>&gt;<o:p>&nbsp;</o:p></pre><pre>&gt; \
Regards<o:p></o:p></pre><pre>&gt; Prasanta<o:p></o:p></pre><pre>&gt;&gt; \
-phil.<o:p></o:p></pre><pre>&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt; On 11/6/15, \
3:00 AM, prasanta sadhukhan wrote:<o:p></o:p></pre><pre>&gt;&gt;&gt; Hi \
All,<o:p></o:p></pre><pre>&gt;&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt;&gt; Please \
review a fix for jdk9.<o:p></o:p></pre><pre>&gt;&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt;&gt; \
Bug: <a href="https://bugs.openjdk.java.net/browse/JDK-8039412">https://bugs.openjdk.java.net/browse/JDK-8039412</a><o:p></o:p></pre><pre>&gt;&gt;&gt; \
webrev: <a href="http://cr.openjdk.java.net/~psadhukhan/8039412/webrev.00/">http://cr. \
openjdk.java.net/~psadhukhan/8039412/webrev.00/</a><o:p></o:p></pre><pre>&gt;&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt;&gt; \
Issue was seen in linux whereby if we call PrinterJob.pageDialog() \
<o:p></o:p></pre><pre>&gt;&gt;&gt; after PrinterJob.printDialog() it results in \
StackOverflowError if <o:p></o:p></pre><pre>&gt;&gt;&gt; DialogSelectionType is \
NATIVE.<o:p></o:p></pre><pre>&gt;&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt;&gt; \
This was because pageDialog(attributes) was calling \
<o:p></o:p></pre><pre>&gt;&gt;&gt; pageDialog(pageformat) if it is \
DialogTypeSelection.NATIVE which <o:p></o:p></pre><pre>&gt;&gt;&gt; again calls \
pageDialog(attributes)<o:p></o:p></pre><pre>&gt;&gt;&gt; via this \
code<o:p></o:p></pre><pre>&gt;&gt;&gt; <a \
href="http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/sh \
are/classes/sun/print/RasterPrinterJob.java#l767">http://hg.openjdk.java.net/jdk9/clie \
nt/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java#l767</a> \
<o:p></o:p></pre><pre>&gt;&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt;&gt; \
and<o:p></o:p></pre><pre>&gt;&gt;&gt; <a \
href="http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/sh \
are/classes/sun/print/RasterPrinterJob.java#l743">http://hg.openjdk.java.net/jdk9/clie \
nt/jdk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java#l743</a> \
<o:p></o:p></pre><pre>&gt;&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt;&gt; \
I added a fix whereby in pageDialog(attributes)we check if it is \
<o:p></o:p></pre><pre>&gt;&gt;&gt; DialogTypeSelection.NATIVE and remove this \
attribute temporarily <o:p></o:p></pre><pre>&gt;&gt;&gt; before calling \
pageDialog(pageformat)<o:p></o:p></pre><pre>&gt;&gt;&gt; and restore the \
DialogTypeSelection.NATIVE after the call.<o:p></o:p></pre><pre>&gt;&gt;&gt; It is \
similar to solution done in<o:p></o:p></pre><pre>&gt;&gt;&gt; <a \
href="http://hg.openjdk.java.net/jdk9/client/jdk/file/298d3fe64572/src/java.desktop/sh \
are/classes/sun/print/PSPrinterJob.java#l443">http://hg.openjdk.java.net/jdk9/client/j \
dk/file/298d3fe64572/src/java.desktop/share/classes/sun/print/PSPrinterJob.java#l443</a> \
<o:p></o:p></pre><pre>&gt;&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt;&gt;<o:p>&nbsp;</o:p></pre><pre>&gt;&gt;&gt; \
Regards<o:p></o:p></pre><pre>&gt;&gt;&gt; \
Prasanta<o:p></o:p></pre><pre>&gt;<o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic