[OpenJDK 2D-Dev] [9] RFR: JDK-8039412, , Stack overflow on Linux using DialogTypeSelection.NATIVE

prasanta sadhukhan prasanta.sadhukhan at oracle.com
Fri Nov 6 11:00:42 UTC 2015


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



More information about the 2d-dev mailing list