JDK-6996051 : Occasional crashes in sun.print.Win32PrintServiceLookup.getAllPrinterNames()
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u18
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2010-10-29
  • Updated: 2021-03-10
  • Resolved: 2021-03-10
Related Reports
Duplicate :  
Relates :  
Description
Customer reports occasionally crashes somewhere in msvcr71.dll
which got invoked from sun.print.Win32PrintServiceLookup.getAllPrinterNames()
Unfortunately there is no crashdump available right now. I attach a
hs_error.log 


Stack: [0x1b390000,0x1b3e0000],  sp=0x1b3df944,  free space=13e1b3df478k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [msvcr71.dll+0x10440]
j  sun.print.Win32PrintServiceLookup.getAllPrinterNames()[Ljava/lang/String;+0
j  sun.print.Win32PrintServiceLookup.refreshServices()V+2
j  sun.print.Win32PrintServiceLookup.access$200(Lsun/print/Win32PrintServiceLookup;)V+1
j  sun.print.Win32PrintServiceLookup$PrinterChangeListener.run()V+29
v  ~StubRoutines::call_stub
V  [jvm.dll+0xf072c]
V  [jvm.dll+0x17fd51]
V  [jvm.dll+0xf08f7]
V  [jvm.dll+0xf096d]
V  [jvm.dll+0x11a4c0]
V  [jvm.dll+0x1dd924]
V  [jvm.dll+0x17f9cc]
C  [msvcr71.dll+0x9565]
C  [kernel32.dll+0x44911]
C  [ntdll.dll+0x3e4b6]
C  [ntdll.dll+0x3e489]

Comments
The crash should be resolved by JDK-8262829.
10-03-2021

I looked at the code of Java_sun_print_PrintServiceLookupProvider_getAllPrinterNames() and I could not find anything obvious that might result in crash. Also I saw from https://msdn.microsoft.com/en-us/library/windows/desktop/dd162692%28v=vs.85%29.aspx that Windows Vista: The printer data returned by EnumPrinters is retrieved from a local cache when the value of Level is 4. it might happen that local cache might be corrupted or something which might be resulting in this kind of behaviour. I am closing this as non-reproducible, if similar issue is seen in future in windows 7 and beyond, it can be reopened with reproducible testcase/scenario.
15-07-2016

> Win32PrintServiceLookup is not available and there is no getAllPrinterNames() methods now. I don't understand what you mean by any of that. This is not being called directly by the application. Take a look at the call stack. This is a JDK internally created thread that monitors printers being added and removed. In JDK 9 the internal class Win32PrintServiceLookup was renamed as PrintServiceLookupProvider in order to help out the module system (jigsaw) but the method getAllPrinterNames most certainly remains ! So all of that has no bearing on whether this is still reproducible with VS2013+JDK9
16-05-2016

Win32PrintServiceLookup is not available and there is no getAllPrinterNames() methods now. Also, windows vista is not supported anymore for jdk9.
16-05-2016