Project: SWT
Bug 342192 PrintDialog crashes on xp if no printers are installed
Reported: 2011-04-07 12:27:56 | Status: resolved fixed

Build Identifier: I20100608-0911 If no printers are installed on xp, rcp application crashes when the following line is executed: PrintDialog dialog = new PringDialog(shell, SWT.NONE); Stack: [0x00030000,0x00130000], sp=0x0012ed6c, free space=3fb0012e8a0k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [swt-win32-3557.dll+0x2c263] C [swt-win32-3557.dll+0xa3b5] j org.eclipse.swt.internal.win32.OS.MoveMemory(Lorg/eclipse/swt/internal/win32/DEVMODEW;II)V+0 j org.eclipse.swt.internal.win32.OS.MoveMemory(Lorg/eclipse/swt/internal/win32/DEVMODE;II)V+12 j org.eclipse.swt.printing.PrintDialog.open()Lorg/eclipse/swt/printing/PrinterData;+168 j com.teamcenter.rac.services.PrintService.printImage(Lcom/teamcenter/rac/print/IGraphicInfo;)V+30 j com.teamcenter.rac.handlers.PrintGraphicsHandler.execute(Lorg/eclipse/core/commands/ExecutionEvent;)Ljava/lang/Object;+44 j org.eclipse.ui.internal.handlers.HandlerProxy.execute(Lorg/eclipse/core/commands/ExecutionEvent;)Ljava/lang/Object;+33 j org.eclipse.core.commands.Command.executeWithChecks(Lorg/eclipse/core/commands/ExecutionEvent;)Ljava/lang/Object;+115 j org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+21 j org.eclipse.ui.internal.handlers.HandlerService.executeCommand(Lorg/eclipse/core/commands/ParameterizedCommand;Lorg/eclipse/swt/widgets/Event;)Ljava/lang/Object;+6 j org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(Lorg/eclipse/core/commands/ParameterizedCommand;Lorg/eclipse/swt/widgets/Event;)Ljava/lang/Object;+6 j org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(Lorg/eclipse/core/commands/ParameterizedCommand;Lorg/eclipse/swt/widgets/Event;)Ljava/lang/Object;+6 j org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(Lorg/eclipse/swt/widgets/Event;)V+79 j org.eclipse.ui.menus.CommandContributionItem.access$10(Lorg/eclipse/ui/menus/CommandContributionItem;Lorg/eclipse/swt/widgets/Event;)V+2 j org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(Lorg/eclipse/swt/widgets/Event;)V+51 J org.eclipse.swt.widgets.EventTable.sendEvent(Lorg/eclipse/swt/widgets/Event;)V J org.eclipse.swt.widgets.Display.runDeferredEvents()Z J org.eclipse.swt.widgets.Display.readAndDispatch()Z j org.eclipse.ui.internal.Workbench.runEventLoop(Lorg/eclipse/jface/window/Window$IExceptionHandler;Lorg/eclipse/swt/widgets/Display;)V+9 j org.eclipse.ui.internal.Workbench.runUI()I+393 j org.eclipse.ui.internal.Workbench.access$4(Lorg/eclipse/ui/internal/Workbench;)I+1 j org.eclipse.ui.internal.Workbench$5.run()V+55 j org.eclipse.core.databinding.observable.Realm.runWithDefault(Lorg/eclipse/core/databinding/observable/Realm;Ljava/lang/Runnable;)V+12 j org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Lorg/eclipse/swt/widgets/Display;Lorg/eclipse/ui/application/WorkbenchAdvisor;)I+18 j org.eclipse.ui.PlatformUI.createAndRunWorkbench(Lorg/eclipse/swt/widgets/Display;Lorg/eclipse/ui/application/WorkbenchAdvisor;)I+2 j com.teamcenter.rac.aifrcp.Application.runApplication(Ljava/lang/Object;)Ljava/lang/Object;+71 j com.teamcenter.rac.aifrcp.Application.start(Lorg/eclipse/equinox/app/IApplicationContext;)Ljava/lang/Object;+16 j org.eclipse.equinox.internal.app.EclipseAppHandle.run(Ljava/lang/Object;)Ljava/lang/Object;+135 j org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Ljava/lang/Object;)Ljava/lang/Object;+103 j org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ljava/lang/Object;)Ljava/lang/Object;+29 j org.eclipse.core.runtime.adaptor.EclipseStarter.run(Ljava/lang/Object;)Ljava/lang/Object;+149 j org.eclipse.core.runtime.adaptor.EclipseStarter.run([Ljava/lang/String;Ljava/lang/Runnable;)Ljava/lang/Object;+183 v ~StubRoutines::call_stub V [jvm.dll+0xf049c] V [jvm.dll+0x17fcf1] V [jvm.dll+0xf051d] V [jvm.dll+0x199ceb] V [jvm.dll+0x19a706] V [jvm.dll+0x11bc03] C [java.dll+0x714d] j sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87 j sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+161 j org.eclipse.equinox.launcher.Main.invokeFramework([Ljava/lang/String;[Ljava/net/URL;)V+211 j org.eclipse.equinox.launcher.Main.basicRun([Ljava/lang/String;)V+114 j org.eclipse.equinox.launcher.Main.run([Ljava/lang/String;)I+4 v ~StubRoutines::call_stub V [jvm.dll+0xf049c] V [jvm.dll+0x17fcf1] V [jvm.dll+0xf051d] V [jvm.dll+0xf9e0f] V [jvm.dll+0xfbae4] C [eclipse_1206.dll+0x5196] C [eclipse_1206.dll+0x4721] C [eclipse_1206.dll+0x152c] C [Teamcenter.exe+0x1495] C [Teamcenter.exe+0x1181] C [Teamcenter.exe+0x4a3a] C [kernel32.dll+0x17077] It works on windows 7, and it also works on xp if one or more printer are installed. Reproducible: Always

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/PrintDialog.java