Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6446094

Win32PrintServiceLookup.getPrintServiceByName() should not recreate duplicate instances.

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • Resolved In Build:
      b17
    • CPU:
      x86
    • OS:
      windows_xp
    • Verification:
      Verified

      Description

      I have an infinite loop within which I am calling 3 methods - One of PrintJob, one for PrinterJob and one for DocPrintJob. Each method creates the respective print job and calls some methods on it without actually printing anything. I am running this indefinitely on WinXP with Mustang-b90.

      After 8 hours (on some other machine it probably takes little longer time), the VM crashes. I ran the same test on WinXP, Linux and solaris-sparc and the crash is noticed only on WinXP. The test is running fine on other machines. I have just started the test on JDK 5.0 to see if I can reproduce the crash there. I will update the bug once it is done.

      I have attached the testcase herewith. Run the test and you will see the loop number being printed on the console alongwith other info. Allow the test to run indefinitely and you will the crash after 8 or 10 hours.

      Here is the log information:
      ----------------------------
      #
      # An unexpected error has been detected by Java Runtime Environment:
      #
      # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c350440, pid=3664, tid=764
      #
      # Java VM: Java HotSpot(TM) Client VM (1.6.0-rc-b90 mixed mode)
      # Problematic frame:
      # C [msvcr71.dll+0x10440]
      #
      # If you would like to submit a bug report, please visit:
      # http://java.sun.com/webapps/bugreport/crash.jsp
      #

      --------------- T H R E A D ---------------

      Current thread (0x00295800): JavaThread "main" [_thread_in_native, id=764]

      siginfo: ExceptionCode=0xc0000005, reading address 0x0af65000

      Registers:
      EAX=0x0af65000, EBX=0x00000019, ECX=0x003e02ff, EDX=0x00000004
      ESP=0x003ef92c, EBP=0x003ef96c, ESI=0x0af64d30, EDI=0x002958e4
      EIP=0x7c350440, EFLAGS=0x00010206

      Top of Stack: (sp=0x003ef92c)
      0x003ef92c: 6d19bf19 0af64d30 00295800 06f64ff0
      0x003ef93c: 06f64ff0 0af640b0 0aa70618 0af35c18
      0x003ef94c: 0000001a 0aa7061c 0009001f 06f64e58
      0x003ef95c: 003ef934 003efdc8 6d1ebb90 00000000
      0x003ef96c: 003ef9c4 6d19bfbd 002958e4 003ef9dc
      0x003ef97c: 003ef9d8 003ef9d4 00000010 00000040
      0x003ef98c: 008ea460 002958e4 003ef9dc 003ef9d8
      0x003ef99c: 003ef9d4 00000019 003ef9a4 00000000

      Instructions: (pc=0x7c350440)
      0x7c350430: 42 42 66 85 c0 75 f1 8b 44 24 04 c3 8b 44 24 04
      0x7c350440: 66 8b 08 40 40 66 85 c9 75 f6 2b 44 24 04 d1 f8


      Stack: [0x003a0000,0x003f0000), sp=0x003ef92c, free space=318k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      C [msvcr71.dll+0x10440]
      C [awt.dll+0xebfbd]
      J sun.print.Win32PrintService.getMediaSizes(Ljava/util/ArrayList;[I)[Ljavax/print/attribute/standard/MediaSize;
      J sun.print.Win32PrintService.initMedia()V
      j sun.print.Win32PrintService.getSupportedAttributeValues(Ljava/lang/Class;Ljavax/print/DocFlavor;Ljavax/print/attribute/AttributeSet;)Ljava/lang/Object;+668
      j sun.print.RasterPrinterJob.updatePageAttributes(Ljavax/print/PrintService;Ljava/awt/print/PageFormat;)V+62
      j sun.print.RasterPrinterJob.setPrintable(Ljava/awt/print/Printable;Ljava/awt/print/PageFormat;)V+19
      j sun.print.PrintJob2D.printDialog()Z+510
      j sun.awt.windows.WToolkit.getPrintJob(Ljava/awt/Frame;Ljava/lang/String;Ljava/awt/JobAttributes;Ljava/awt/PageAttributes;)Ljava/awt/PrintJob;+30
      j MultiPrintNoThread$PrintJobThread.execute()V+22
      j MultiPrintNoThread.<init>()V+61
      j MultiPrintNoThread.main([Ljava/lang/String;)V+4
      v ~StubRoutines::call_stub

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j sun.print.Win32PrintService.getAllMediaNames(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;+0
      J sun.print.Win32PrintService.getMediaSizes(Ljava/util/ArrayList;[I)[Ljavax/print/attribute/standard/MediaSize;
      J sun.print.Win32PrintService.initMedia()V
      j sun.print.Win32PrintService.getSupportedAttributeValues(Ljava/lang/Class;Ljavax/print/DocFlavor;Ljavax/print/attribute/AttributeSet;)Ljava/lang/Object;+668
      j sun.print.RasterPrinterJob.updatePageAttributes(Ljavax/print/PrintService;Ljava/awt/print/PageFormat;)V+62
      j sun.print.RasterPrinterJob.setPrintable(Ljava/awt/print/Printable;Ljava/awt/print/PageFormat;)V+19
      j sun.print.PrintJob2D.printDialog()Z+510
      j sun.awt.windows.WToolkit.getPrintJob(Ljava/awt/Frame;Ljava/lang/String;Ljava/awt/JobAttributes;Ljava/awt/PageAttributes;)Ljava/awt/PrintJob;+30
      j MultiPrintNoThread$PrintJobThread.execute()V+22
      j MultiPrintNoThread.<init>()V+61
      j MultiPrintNoThread.main([Ljava/lang/String;)V+4
      v ~StubRoutines::call_stub

      --------------- P R O C E S S ---------------

      Java Threads: ( => current thread )
        0x0aaeec00 JavaThread "RMI TCP Connection(7)-129.158.229.233" daemon [_thread_in_native, id=3324]
        0x0aac5c00 JavaThread "RMI TCP Connection(6)-129.158.229.233" daemon [_thread_in_native, id=3624]
        0x0aac9800 JavaThread "RMI TCP Connection(5)-129.158.229.233" daemon [_thread_blocked, id=2808]
        0x0aaac000 JavaThread "JMX server connection timeout 296" daemon [_thread_blocked, id=2624]
        0x0aaa8c00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=4024]
        0x0ae5d800 JavaThread "Thread-2" daemon [_thread_in_native, id=3452]
        0x0ae52c00 JavaThread "AWT-Windows" daemon [_thread_in_native, id=3940]
        0x0ae51400 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3524]
        0x0ae31800 JavaThread "RMI TCP Accept-1090" daemon [_thread_in_native, id=2908]
        0x0ae25000 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=3828]
        0x0aa8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2728]
        0x0aa88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3012]
        0x0aa86c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=2580]
        0x0aa86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1800]
        0x0aa76c00 JavaThread "Finalizer" daemon [_thread_blocked, id=1756]
        0x0aa72400 JavaThread "Reference Handler" daemon [_thread_blocked, id=3816]
      =>0x00295800 JavaThread "main" [_thread_in_native, id=764]

      Other Threads:
        0x0aa6f400 VMThread [id=3420]
        0x0ae2c000 WatcherThread [id=3124]

      VM state:not at safepoint (normal execution)

      VM Mutex/Monitor currently owned by a thread: None

      Heap
       def new generation total 960K, used 739K [0x02960000, 0x02a60000, 0x02e40000)
        eden space 896K, 82% used [0x02960000, 0x02a18d00, 0x02a40000)
        from space 64K, 0% used [0x02a50000, 0x02a50000, 0x02a60000)
        to space 64K, 0% used [0x02a40000, 0x02a40000, 0x02a50000)
       tenured generation total 4396K, used 2637K [0x02e40000, 0x0328b000, 0x06960000)
         the space 4396K, 59% used [0x02e40000, 0x030d35d0, 0x030d3600, 0x0328b000)
       compacting perm gen total 12288K, used 7102K [0x06960000, 0x07560000, 0x0a960000)
         the space 12288K, 57% used [0x06960000, 0x0704fa48, 0x0704fc00, 0x07560000)
      No shared spaces configured.

      Dynamic libraries:
      0x00400000 - 0x00423000 y:\disk09\jdk\1.6.0\latest\binaries\win\bin\java.exe
      0x77f50000 - 0x77ff9000 E:\WINDOWS\System32\ntdll.dll
      0x77e60000 - 0x77f40000 E:\WINDOWS\system32\kernel32.dll
      0x77dd0000 - 0x77e5b000 E:\WINDOWS\system32\ADVAPI32.dll
      0x78000000 - 0x7806f000 E:\WINDOWS\system32\RPCRT4.dll
      0x7c340000 - 0x7c396000 y:\disk09\jdk\1.6.0\latest\binaries\win\jre\bin\msvcr71.dll
      0x6d8b0000 - 0x6daf2000 y:\disk09\jdk\1.6.0\latest\binaries\win\jre\bin\client\jvm.dll
      0x77d40000 - 0x77dc6000 E:\WINDOWS\system32\USER32.dll
      0x77c70000 - 0x77cae000 E:\WINDOWS\system32\GDI32.dll
      0x76b40000 - 0x76b6c000 E:\WINDOWS\System32\WINMM.dll
      0x6d3c0000 - 0x6d3c8000 y:\disk09\jdk\1.6.0\latest\binaries\win\jre\bin\hpi.dll
      0x76bf0000 - 0x76bfb000 E:\WINDOWS\System32\PSAPI.DLL
      0x6d860000 - 0x6d86c000 y:\disk09\jdk\1.6.0\latest\binaries\win\jre\bin\verify.dll
      0x6d460000 - 0x6d47f000 y:\disk09\jdk\1.6.0\latest\binaries\win\jre\bin\java.dll
      0x6d8a0000 - 0x6d8af000 y:\disk09\jdk\1.6.0\latest\binaries\win\jre\bin\zip.dll
      0x6d610000 - 0x6d619000 Y:\disk09\jdk\1.6.0\latest\binaries\win\jre\bin\management.dll
      0x6d620000 - 0x6d633000 Y:\disk09\jdk\1.6.0\latest\binaries\win\jre\bin\net.dll
      0x71ab0000 - 0x71ac5000 E:\WINDOWS\System32\WS2_32.dll
      0x77c10000 - 0x77c63000 E:\WINDOWS\system32\msvcrt.dll
      0x71aa0000 - 0x71aa8000 E:\WINDOWS\System32\WS2HELP.dll
      0x71a50000 - 0x71a8b000 E:\WINDOWS\System32\mswsock.dll
      0x76f20000 - 0x76f45000 E:\WINDOWS\System32\DNSAPI.dll
      0x76fb0000 - 0x76fb7000 E:\WINDOWS\System32\winrnr.dll
      0x76f60000 - 0x76f8c000 E:\WINDOWS\system32\WLDAP32.dll
      0x76fc0000 - 0x76fc5000 E:\WINDOWS\System32\rasadhlp.dll
      0x0ffd0000 - 0x0fff2000 E:\WINDOWS\System32\rsaenh.dll
      0x75a70000 - 0x75b13000 E:\WINDOWS\system32\USERENV.dll
      0x71c20000 - 0x71c6d000 E:\WINDOWS\System32\netapi32.dll
      0x71a90000 - 0x71a98000 E:\WINDOWS\System32\wshtcpip.dll
      0x6d0b0000 - 0x6d272000 Y:\disk09\jdk\1.6.0\latest\binaries\win\jre\bin\awt.dll
      0x73000000 - 0x73023000 E:\WINDOWS\System32\WINSPOOL.DRV
      0x76390000 - 0x763aa000 E:\WINDOWS\System32\IMM32.dll
      0x771b0000 - 0x772c3000 E:\WINDOWS\system32\ole32.dll
      0x51000000 - 0x51049000 E:\WINDOWS\System32\ddraw.dll
      0x73bc0000 - 0x73bc6000 E:\WINDOWS\System32\DCIMAN32.dll
      0x10000000 - 0x1016f000 E:\WINDOWS\System32\nview.dll
      0x772d0000 - 0x77334000 E:\WINDOWS\system32\SHLWAPI.dll
      0x773d0000 - 0x77bbf000 E:\WINDOWS\system32\SHELL32.dll
      0x77120000 - 0x771ab000 E:\WINDOWS\system32\OLEAUT32.dll
      0x77340000 - 0x773cb000 E:\WINDOWS\system32\COMCTL32.dll
      0x77c00000 - 0x77c07000 E:\WINDOWS\system32\VERSION.dll
      0x71950000 - 0x71a34000 E:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll
      0x76ce0000 - 0x76cff000 E:\WINDOWS\System32\NTMARTA.DLL
      0x5e160000 - 0x5e1d3000 E:\WINDOWS\System32\spool\DRIVERS\W32X86\3\PSCRIPT5.DLL
      0x73b30000 - 0x73b43000 E:\WINDOWS\System32\mscms.dll
      0x5e1f0000 - 0x5e212000 E:\WINDOWS\System32\spool\DRIVERS\W32X86\3\PS5UI.DLL
      0x74ac0000 - 0x74aca000 E:\WINDOWS\System32\spool\DRIVERS\W32X86\3\XXPSRU1.DLL
      0x763b0000 - 0x763f5000 E:\WINDOWS\system32\COMDLG32.DLL
      0x6d780000 - 0x6d786000 Y:\disk09\jdk\1.6.0\latest\binaries\win\jre\bin\rmi.dll

      VM Arguments:
      jvm_args: -Dcom.sun.management.jmxremote.port=1090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
      java_command: MultiPrintNoThread
      Launcher Type: SUN_STANDARD

      Environment Variables:
      PATH=y:\disk09\jdk\1.6.0\latest\binaries\win\bin;E:\PROGRA~1\MKSTOO~1\bin;E:\PROGRA~1\MKSTOO~1\bin\X11;E:\PROGRA~1\MKSTOO~1\mksnt;E:\WINDOWS\system32;E:\WINDOWS;E:\WINDOWS\System32\Wbem;E:\PROGRA~1\ULTRAE~1;C:\PROGRA~1\MKSTOO~1\bin;C:\PROGRA~1\MKSTOO~1\bin\X11;C:\PROGRA~1\MKSTOO~1\mksnt;
      USERNAME=admin
      SHELL=E:/PROGRA~1/MKSTOO~1/mksnt/sh.exe
      DISPLAY=:0.0
      OS=Windows_NT
      PROCESSOR_IDENTIFIER=x86 Family 15 Model 3 Stepping 3, GenuineIntel



      --------------- S Y S T E M ---------------

      OS: Windows XP Build 2600

      CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht

      Memory: 4k page, physical 1047272k(480316k free), swap 2521412k(1993824k free)

      vm_info: Java HotSpot(TM) Client VM (1.6.0-rc-b90) for windows-x86, built on Jun 30 2006 00:35:54 by "java_re" with unknown MS VC++:1310
      The crash is reproducible on Tiger as well but the stack trace looks different from Mustang. I have attached the tiger log file to this bug report (hs_err_pid1612.log).
      Crash is reproduced with HP LaserJet 4050 N printer and not reproducible with Xerox Docuprint N4025 (Random Exceptions seen and a bug has been filed separately on this). I have given the driver details below:

      Driver Name: PSCRIPT5.DLL
      Data File: HP4050_7.PPD
      Config File: PS5UI.DLL
      Help File: PSCRIPT.HLP
      Driver Version: 5.02
      I tried running the attached test with 5.0u9-b01 PIT build on WinXP with HP LaserJet 4050N and Xerox Docuprint N4025 with a heap size of 8 MB.

      On One of the machines, I have already got out of memory error and on the other machine, it is still running. I monitored both through Jconsole and the memory graphs go like a stair-case on both the machines. I have attached a screenshot of the graph where I got OOME.

      I have left the bug in incomplete state and waiting for the results from other machine. I will also try running the app with full heap size over the night and see how it behaves.

      I have got OOME from other machine also (with 8MB heap) and I have attached the screen shot of mem consumption monitored through jconsole.

      I have launched the test again on the same machine with 5.0u8 with def heap size and Will update the status tomorrow.
      The memory graph still shows a stair-case appearence regardless of what heap size I specify (8MB or def). I allowed it to run for 2 days with 5.0u8 and the mem graph is a replica of what I have attached. I used Xerox Docuprint N4025 and no crash is seen. (unfortunately I could not use HP LaserJet since it is down).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              prr Philip Race
              Reporter:
              pmohansunw Praveen Mohan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: