Bug 1694104 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Hiroyuki Ikezoe (:hiro) from comment #4)
> Bumping up the severity.
> 
> From [a duplicated bug comment](https://bugzilla.mozilla.org/show_bug.cgi?id=1695763#c0);
> 
> > FireFox crashes. Figured out that this is related to the name of our network printer with special characters: Värmdö. When deleting this printer in about:config, printing works
> 
> :jwatt, :bobowen, any insights on this?

I think this is all down to us pulling back various settings and capabilities for a printer in many threads.
In a previous bug I changed it so we lock around getting the default DEVMODE, but it looks like can't rely on these drivers being at all thread-safe despite the fact that the OpenPrinter docs suggest you can if you have different printer handles per thread.

So, I think we should add another Mutex (possibly per printer name, rather than nsIPrinter object, although maybe that's overkill) and lock around probably the following: DeviceCapabilitiesW, DocumentPropertiesW and CreateICW/DCW

I think OpenPrinterW itself is probably OK (especially as we don't pass in any defaults) and also GetDeviceCaps, as we're just pulling information from an already created information/device context.
(In reply to Hiroyuki Ikezoe (:hiro) from comment #4)
> Bumping up the severity.
> 
> From [a duplicated bug comment](https://bugzilla.mozilla.org/show_bug.cgi?id=1695763#c0);
> 
> > FireFox crashes. Figured out that this is related to the name of our network printer with special characters: Värmdö. When deleting this printer in about:config, printing works
> 
> :jwatt, :bobowen, any insights on this?

I think this is all down to us pulling back various settings and capabilities for a printer in many threads.
In a previous bug I changed it so we lock around getting the default DEVMODE, but it looks like we can't rely on these drivers being at all thread-safe despite the fact that the OpenPrinter docs suggest you can if you have different printer handles per thread.

So, I think we should add another Mutex (possibly per printer name, rather than nsIPrinter object, although maybe that's overkill) and lock around probably the following: DeviceCapabilitiesW, DocumentPropertiesW and CreateICW/DCW

I think OpenPrinterW itself is probably OK (especially as we don't pass in any defaults) and also GetDeviceCaps, as we're just pulling information from an already created information/device context.

Back to Bug 1694104 Comment 5