Closed Bug 127627 Opened 23 years ago Closed 23 years ago

Print preview wants to use more than one print device context in some cases

Categories

(Core :: Print Preview, defect, P1)

All
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: roland.mainz, Assigned: roland.mainz)

Details

Attachments

(1 file)

Print preview wants to use more than one print device context in some cases.
This is bad due global vars in the print device context code - if we have more
than one device the different instances will start to overwrite their variables,
causing crashes and havoc...

Steps to reproduct:
1. Start Mozilla (it loads http://www.mozilla.org/start/)
2. Go to print preview
3. Click on the scale-one-unit-down-arrow-button

Result:
A 2nd print device context gets created.

Expected result:
The creation of the 2nd device context should be blocked.
Taking...
Assignee: rods → Roland.Mainz
We should avoid this in all cases until bug 119491 ("Cleanup global vars in
PostScript and Xprint modules) gets fixed.

The attached patch now counts the instances and returns an error if we have more
than one print device context object...
Severity: normal → blocker
Status: NEW → ASSIGNED
Keywords: patch, review
Priority: -- → P1
Target Milestone: --- → mozilla0.9.9
Comment on attachment 71287 [details] [diff] [review]
Patch for 2002-02-23-08-trunk

r=bryner
Attachment #71287 - Flags: review+
r=rods
Comment on attachment 71287 [details] [diff] [review]
Patch for 2002-02-23-08-trunk

sr=jag
Attachment #71287 - Flags: superreview+
Excuse me?  This completely disables zoom in print preview and disables the
landscape/portrait switching.  It doesn't disable the UI, though.  I can still
click the buttons and the zoom number changes, but nothing happens.

Without this patch these features work fine for me on Linux (postscript module,
not xprint).  I see no crashes.  Granted, that may be dependent on things like
exact memory layout of things and whatnot, but...

If the problem is that the UI can trigger operations that can lead to
instability, then the UI should be disabled in addition to these bulletproofing
changes.
bz wrote:
> Excuse me?  This completely disables zoom in print preview and disables the
> landscape/portrait switching.  It doesn't disable the UI, though.  I can still
> click the buttons and the zoom number changes, but nothing happens.

> Without this patch these features work fine for me on Linux (postscript 
> module, not xprint).  I see no crashes. 

The crashes are usually race-conditions. And Xprint module does not crash in
this case because it has an own safeguard in it's code which does the same...
but this patch catches the error earlier and better - and for both PostScript
module and Xprint module.

This patch is only a workaround for HERE&NOW - to get _stability_ into the 0.9.9
release. Otherwise we'll get a lot of random bugs about crashes in print
preview.

It's a trade:
It may disable some functionality in print preview. But if we do _not_ block the
creation of more than one print device context we will _CRASH_ sooner or later.
The question is: "What's better ?"
a) Random crashes due heap corruption (=bugzilla SPAM) because one print device
context corrupted the global vars of another print device context
  OR 
b) A stable Zilla where some things are not working yet due a known reason and a
fix in work...

> Granted, that may be dependent on 
> things like exact memory layout of things and whatnot, but...

See above. Stop blocking this patch. Developers can always turn the bug knob
(the |#define WE_DO_NOT_SUPPORT_MULTIPLE_PRINT_DEVICECONTEXTS 1| ON or OFF...
Bug 127699 filed to disable the UI that will no longer work.
a=asa (on behalf of drivers) for checkin to 0.9.9
checked into trunk for 0.9.9
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
and I'm a doofus.  tree is red, patch is backed out pending tree going green. 
My apologies for the spam.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
ok, relanded
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Roland, please verify...thanks!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: