United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4713057 : Method print()on Win98 crashes when HP DeskJet 710C installed.

Details
Type:
Bug
Submit Date:
2002-07-10
Status:
Resolved
Updated Date:
2002-11-12
Project Name:
JDK
Resolved Date:
2002-11-12
Component:
client-libs
OS:
windows_98
Sub-Component:
2d
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.1
Fixed Versions:
1.4.2 (mantis)

Related Reports
Relates:

Sub Tasks

Description

Name: jk109818			Date: 07/10/2002


FULL PRODUCT VERSION :
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)


FULL OPERATING SYSTEM VERSION :

Windows 98 [version 4.10.1998]

ADDITIONAL OPERATING SYSTEMS :

None

EXTRA RELEVANT SYSTEM CONFIGURATION :
AuthenticAMD AMD-K6(tm) 3D processor
128Mb RAM

Printer Driver:  HP DeskJet 710C Series Version 10.3.


A DESCRIPTION OF THE PROBLEM :
General protection fault if there's a default printer HP
DeskJet 710C installed.
When runs the programme, the runtime crashes on the
call: pj.print(doc, aset);


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the Java Print Service API User Guide example
Print2DGraphics that reproduces the problem.


EXPECTED VERSUS ACTUAL BEHAVIOR :
Instead of executing the statement pj.print(doc, aset);,
crashes the system.


ERROR MESSAGES/STACK TRACES THAT OCCUR :
JAVA provoc?? un error de protecci??n general
en el m??dulo HPFWIN13.DLL de 0016:00008019.
Registros:
EAX=51ef0000 CS=50df EIP=00008019 EFLGS=00000297
EBX=00000000 SS=4c5f ESP=000081e2 EBP=000081e6
ECX=0000ffff DS=513f ESI=00000000 FS=0000
EDX=00000000 ES=0000 EDI=00000247 GS=0000
Bytes en CS:EIP:
,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x ,02x
Volcado de pila:
,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x ,08x

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.io.*;
     import java.awt.*;
     import java.net.*;
     import java.awt.image.*;
     import java.awt.print.*;
     import javax.print.*;
     import javax.print.attribute.*;
     import javax.print.attribute.standard.*;

     public class Print2DGraphics implements Printable {

             public Print2DGraphics() {

                     /* Construct the print request specification.
                     * The print data is a Printable object.
                     * the request additonally specifies a job name, 2 copies,
and
                     * landscape orientation of the media.
                     */
                     DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
                     PrintRequestAttributeSet aset = new
HashPrintRequestAttributeSet();
                     aset.add(OrientationRequested.LANDSCAPE);
                     aset.add(new Copies(2));
                     aset.add(new JobName("My job", null));

                     /* locate a print service that can handle the request */
                     PrintService[] services =
                             PrintServiceLookup.lookupPrintServices(flavor,
aset);

                     if (services.length > 0) {
                             System.out.println("selected printer " +
services[0].getName());

                             /* create a print job for the chosen service */
                             DocPrintJob pj = services[0].createPrintJob();

                             try {
                                     /*
                                     * Create a Doc object to hold the print
data.
                                     */
                                     Doc doc = new SimpleDoc(this, flavor,
null);
                                     System.err.println("pre");
                                     /* print the doc as specified */
                                     pj.print(doc, aset);//Crashes !!!!!!!!!
                                     System.err.println("post");
                                     /*
                                     * Do not explicitly call System.exit() when
print returns.
                                     * Printing can be asynchronous so may be
executing in a
                                     * separate thread.
                                     * If you want to explicitly exit the VM,
use a print job
                                     * listener to be notified when it is safe
to do so.
                                     */

                             } catch (PrintException e) {
                                     System.err.println(e);
                             }
                     }
             }

             public int print(Graphics g,PageFormat pf,int pageIndex) {

                     if (pageIndex == 0) {
                             Graphics2D g2d= (Graphics2D)g;
                             g2d.translate(pf.getImageableX(),
pf.getImageableY());
                             g2d.setColor(Color.black);
                             g2d.drawString("example string", 250, 250);
                             g2d.fillRect(0, 0, 200, 200);
                             return Printable.PAGE_EXISTS;
                             
                     } else {
                             return Printable.NO_SUCH_PAGE;
                     }
             }

             public static void main(String arg[]) {
                     Print2DGraphics sp = new Print2DGraphics();
             }
     }
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
None.
Doesn?t exists any generic HP DeskJet printer driver for Win
98. Affirmative to Win XP, 3.1 and 3.11.
(Review ID: 159009) 
======================================================================

Name: jl125535			Date: 08/08/2002


There is a similar crash in HPFWIN14.DLL with an HP Deskjet 722C.
(Review ID: 160445)
======================================================================

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mantis

FIXED IN:
mantis

INTEGRATED IN:
mantis
mantis-b07


                                     
2004-06-14
EVALUATION

I tested using a different test case which didn't use 1.4 APIs and
can reproduce this bug on JDK 1.4 and JDK 1.4.1 but it is fine on JDK 1.3.1.
I used win ME and the HP driver for 710c  installed by dj705en.exe 
(downloaded from hp.com).

###@###.### 2002-07-11
============================

It crashes also in HP Deskjet 690 series.

Crash happens on a call to DeviceCapabilities where the JDK passes NULL
for port.  See also 4510477.

###@###.### 2002-10-14
====================================

Fix: Passed in non-null port to DeviceCapabilities.

###@###.### 2002-10-16
=====================================
                                     
2002-10-14



Hardware and Software, Engineered to Work Together