Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4713057
Votes 14
Synopsis Method print()on Win98 crashes when HP DeskJet 710C installed.
Category java:classes_2d
Reported Against hopper-beta
Release Fixed 1.4.2(mantis)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 4510477
Submit Date 10-JUL-2002
Description




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) 
======================================================================




There is a similar crash in HPFWIN14.DLL with an HP Deskjet 722C.
(Review ID: 160445)
======================================================================
Work Around
N/A
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).

 xxxxx@xxxxx  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.

 xxxxx@xxxxx  2002-10-14
====================================

Fix: Passed in non-null port to DeviceCapabilities.

 xxxxx@xxxxx  2002-10-16
=====================================
Comments
  
  Include a link with my name & email   

Submitted On 21-SEP-2002
kgslade
Working with j2sdk1.4.0_01 on Win98SE and HP670C printer 
using V11 driver DJ516EN from HP I get all prints failing. Using 
alternate drivers (550-870) gives almost working results. Best 
results with 660(Color) driver but get gray shade instead of 
color. The failure using the V11 driver cites HPFWIN18.DLL as 
the module at fault. My results using the Print2DGraphics 
program above with the 670C V11 driver produced the 
following error details:
JAVA caused a general protection fault
in module HPFWIN18.DLL at 0016:00007fe9.
Registers:
EAX=40b70000 CS=1117 EIP=00007fe9 EFLGS=00000297
EBX=00000000 SS=3e8f ESP=000081e6 EBP=000081ea
ECX=0000ffff DS=3b37 ESI=00000000 FS=0000
EDX=00000000 ES=0000 EDI=0000016f GS=0000
Bytes at CS:EIP:
26 80 78 ff 3a 75 01 4e 66 ff 76 0c 06 53 8b c6 
Stack dump:
00003faf b09085c4 008040b7 00000000 3e8f84b0 410f05bf 
010c016f f26c0000 5b480057 052c6d38 05280063 002a0063 
0f700000 eaff6d3b f23c00ba f2600057 



PLEASE NOTE: JDK6 is formerly known as Project Mustang