Last Comment Bug 525277 - [10.5] Print dialog fails the second time I run it. [@objc_msgSend | _nsnote_callback ]
: [10.5] Print dialog fails the second time I run it. [@objc_msgSend | _nsnote_...
Status: RESOLVED FIXED
[crashkill][#39 Firefox 3.6b4 topcrash]
: crash, topcrash, verified1.9.2
Product: Core
Classification: Components
Component: Widget: Cocoa (show other bugs)
: Trunk
: x86 Mac OS X
: -- critical (vote)
: ---
Assigned To: Steven Michaud [:smichaud] (Retired)
:
: Markus Stange [:mstange]
Mentors:
: 532528 (view as bug list)
Depends on: 396680
Blocks: 456646 520494
  Show dependency treegraph
 
Reported: 2009-10-29 11:49 PDT by Jeff Muizelaar [:jrmuizel]
Modified: 2011-06-13 10:01 PDT (History)
12 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
final+
.2-fixed
.9-fixed


Attachments
GDB backtrace (10.76 KB, text/rtf)
2009-12-09 11:11 PST, Marcia Knous [:marcia - use ni]
no flags Details
Fix/workaround (3.37 KB, patch)
2009-12-11 18:10 PST, Steven Michaud [:smichaud] (Retired)
no flags Details | Diff | Splinter Review

Description Jeff Muizelaar [:jrmuizel] 2009-10-29 11:49:31 PDT
The print dialog doesn't seem to be working very well for me on trunk:

Sometimes I get crashes, sometimes I get error messages and the print dialog dispears.

Here are the crashes:
http://crash-stats.mozilla.com/report/index/b8285b00-09cc-4fa2-bc9d-ed57e2091029?p=1
http://crash-stats.mozilla.com/report/index/7d7dc483-28ad-49df-842d-afcd52091029?p=1
http://crash-stats.mozilla.com/report/index/98f28efd-6e29-4d25-9a7c-968eb2091029?p=1

One of them has the following notes:
App Notes  	
Obj-C Exception data:
NSInvalidArgumentException: *** -[NSCFString currentPrinter]: unrecognized selector sent to instance 0x3ab13b90
Obj-C Exception data:
NSInvalidArgumentException: *** -[NSCFString currentPrinter]: unrecognized selector sent to instance 0x3ab13b90
Comment 1 Jeff Muizelaar [:jrmuizel] 2009-10-29 11:50:36 PDT
The error message in the dialog is:

Printer Error
An unknown error occured while printing.
Comment 2 Jeff Muizelaar [:jrmuizel] 2009-10-29 11:55:33 PDT
Looking at the crash stats this seems to happen pretty often for people on 3.5.3 too.
Comment 3 Jeff Muizelaar [:jrmuizel] 2009-10-29 12:06:33 PDT
Here's a stack for the case where the ErrorDialog is shown.

#0  0x02563fa6 in nsPrintEngine::ShowPrintErrorDialog ()
#1  0x0256afa3 in nsPrintEngine::CommonPrint ()
#2  0x0256b107 in nsPrintEngine::Print ()
#3  0x0207df24 in DocumentViewerImpl::Print ()
#4  0x029c2d38 in NS_InvokeByIndex_P ()
#5  0x01e955be in XPCWrappedNative::CallMethod ()
#6  0x01e9c31e in XPC_WN_CallMethod ()
#7  0x002103a5 in js_Invoke ()
#8  0x00210cfe in js_InternalInvoke ()
#9  0x001b698e in JS_CallFunctionValue ()
Comment 4 Jeff Muizelaar [:jrmuizel] 2009-11-02 08:22:41 PST
Here's some slightly more verbose info:

2009-11-02 11:21:20.764 firefox-bin[97909:813] 	ERROR
2009-11-02 11:21:20.939 firefox-bin[97909:813] *** -[NSCTFont currentPrinter]: unrecognized selector sent to instance 0x17b752c0
2009-11-02 11:21:20.947 firefox-bin[97909:813] Mozilla has caught an Obj-C exception [NSInvalidArgumentException: *** -[NSCTFont currentPrinter]: unrecognized selector sent to instance 0x17b752c0]
Comment 5 Smokey Ardisson (offline for a while; not following bugs - do not email) 2009-11-04 22:44:18 PST
Widget:Mac is dead (unless you're a XUL app on Gecko 1.8.x); long live Widget:Cocoa!
Comment 6 Francesco Lodolo [:flod] (mostly out of office until Dec 19) 2009-11-15 01:37:05 PST
Mozilla Crash Reports sent me to this bug:
http://crash-stats.mozilla.com/report/index/bp-05cc9174-238c-4529-8c8f-dcac02091115
http://crash-stats.mozilla.com/report/index/bp-0b63c4b6-0ceb-41a7-a0e5-df9f02091114

I can reproduce it without difficulties on mozilla1.9.2 branch (I'm using a localized nightly build, tried also with a new clean profile): load a page (or even the blank page), open Print and press Esc to cancel. Do this more than 3-4 times and you get a crash or you have to stop the process with Activity Monitor.
Comment 7 Josh Aas 2009-12-01 11:57:41 PST
I can't reproduce this on Mac OS X 10.5.8 with either 3.5.5 or 3.6b4. Any more tips on reproducing would be helpful.
Comment 8 Marcia Knous [:marcia - use ni] 2009-12-03 10:31:12 PST
*** Bug 532528 has been marked as a duplicate of this bug. ***
Comment 10 chris hofmann 2009-12-03 11:34:41 PST
see attachment in comment 9 for some test cases. (may contain private information in url query strings)
Comment 11 Marcia Knous [:marcia - use ni] 2009-12-09 11:11:42 PST
Created attachment 416777 [details]
GDB backtrace

I am able to reproduce this 100% in the lab connected to the HP 1300 printer, so Steven Michaud was kind enough to show me how to do GDB - information is attached.
Comment 12 Steven Michaud [:smichaud] (Retired) 2009-12-10 15:25:37 PST
I've found reliable STR for this bug.  But it's very strange -- in
order to see it, you need to print to a printer whose supply levels
Apple is able to query!

These crashes only happen on the trunk and the 1.9.2 branch.  They
happen on OS X 10.5.8 but not on 10.6.2.  I haven't yet had a chance
to test 10.4.11.

1) In the Print & Fax pref panel, set as Default Printer a printer
   which reports current supply levels when you do the following:

   a) Click the Options & Supplies button (in the Print & Fax pref
      panel).

   b) Click the Supply Levels tab.

      This tab will either report the supply levels of toner and/or
      paper, or tell you "information not available".  The crashes
      don't happen if you see "information not available".

2) Select some text in a page.

3) Do File : Print or command-p to bring up as OS-provided modal print
   dialog.

4) Cancel out of the print dialog.

5) Open it again (as per step 3).

   You'll often crash at this point, or after repeating steps 4 and 5.

6) If not, try checking and unchecking "Print selection only" or
   "Shrink to fit page width", or make some other change in the modal
   Print dialog.

   This should trigger a crash.
Comment 14 Steven Michaud [:smichaud] (Retired) 2009-12-10 15:33:58 PST
As best I can tell, these crashes can happen with any printer driver, including the generic postscript printer driver.
Comment 15 Marcia Knous [:marcia - use ni] 2009-12-10 15:43:01 PST
Have not been able to reproduce this using 10.4.11 and printing the lab printer. Will try a local printer as well.
Comment 16 Steven Michaud [:smichaud] (Retired) 2009-12-10 15:46:05 PST
I should mention that you don't	always see a crash using the STR from
comment #12.  Sometimes	you see	a window with the following error
message:

Printer	Error
An unknown error occurred while	printing.
Comment 17 Steven Michaud [:smichaud] (Retired) 2009-12-10 15:50:22 PST
Here are the regression ranges for this bug:

2009-10-01-03-mozilla-central (trunk)
2009-11-06-03-mozilla-1.9.2 (1.9.2 branch)

This implicates the patches for bug 456646 and bug 520494.
Comment 18 Steven Michaud [:smichaud] (Retired) 2009-12-10 17:28:28 PST
And when you see the "unknown error" message, you also see "unrecognized selector" errors in the console, like

2009-12-10 17:21:47.788 firefox-bin[8601:10b]
  *** -[NSSecureTextField currentPrinter]:
  unrecognized selector sent to instance 0x1ef9da70

or

12/10/09 5:21:06 PM firefox-bin[8592]
  *** -[NSCFString currentPrinter]:
  unrecognized selector sent to instance 0x1eed8ad0

Clearly a currentPrinter selector is being sent to a deleted object.

I suspect this object was originally a PMPrintWindowController object.
Comment 19 Steven Michaud [:smichaud] (Retired) 2009-12-11 18:10:06 PST
Created attachment 417218 [details] [diff] [review]
Fix/workaround

A tryserver build will follow in a few hours.
Comment 20 Steven Michaud [:smichaud] (Retired) 2009-12-12 09:30:23 PST
The tryservers seem to have had a major hiccup last night, so my Mac
build never finished.  I'll do another one on Monday.

As best I can tell, here's why the crashes happen:

A PMPrintWindowController object registers itself for
kInkCheckerNotification notifications, but doesn't unregister itself
on deletion.  This causes the OS to continue sending these
notifications, to a now deleted object -- which triggers the crashes.

(The PMPrintWindowController class is (like the PMInkChecker class)
implemented in the PrintCocoaUI bundle, which is a "plugin" of the
Print framework under the Carbon framework.)
Comment 21 Steven Michaud [:smichaud] (Retired) 2009-12-12 09:57:36 PST
Looking	only at the builds containing the patches mentioned in comment
#17 (3.6 beta2 and above), this	bug's crash is the #5 Mac topcrasher,
with 481 cases in the last week.
Comment 22 Markus Stange [:mstange] 2009-12-12 14:12:43 PST
Thanks so much for looking into this, Steven!
Comment 23 Steven Michaud [:smichaud] (Retired) 2009-12-14 15:31:21 PST
> Thanks so much for looking into this, Steven!

You're most welcome, Markus!

Here, finally, is a tryserver build made with my patch from comment #19:
https://build.mozilla.org/tryserver-builds/smichaud@pobox.com-bugzilla525277/bugzilla525277-macosx.dmg
Comment 24 Steven Michaud [:smichaud] (Retired) 2009-12-15 10:51:28 PST
Comment on attachment 417218 [details] [diff] [review]
Fix/workaround

This bug may also be fixed by my patch for bug 396680, which I just
posted (attachment 417726 [details] [diff] [review]).  If so, it should probably replace my
current patch for this bug, since the former is more narrowly
targeted.

> As best I can tell, here's why the crashes happen:
>
> A PMPrintWindowController object registers itself for
> kInkCheckerNotification notifications, but doesn't unregister itself
> on deletion.  This causes the OS to continue sending these
> notifications, to a now deleted object -- which triggers the
> crashes.

If my patch at bug 396680 comment #30 does also fix this bug, this
comment will turn out to have been incorrect.

Marcia, please test my patch for bug 396680 on this bug's STR.  I can
no longer do it myself, since I'm no longer at the MV office.
Comment 25 Marcia Knous [:marcia - use ni] 2009-12-18 11:25:03 PST
Steven: Sorry for the delay in testing I was preoccupied with B5 testing.

I have tested your STR in this bug on the latest trunk nightly -  Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.3a1pre) Gecko/20091218 Minefield/3.7a1pre and I have not yet been able to crash. I tried with the both the lab printer and at least one of the other printers in Comment 13. I also took the printer offine and did not see any crash (that was for the other bug).
Comment 26 Steven Michaud [:smichaud] (Retired) 2009-12-18 16:11:15 PST
Thanks, Marcia!

So this bug is fixed by my patch for bug 396680.
Comment 27 Marcia Knous [:marcia - use ni] 2010-01-06 11:27:40 PST
Adding Mary to this bug since she was hitting this in Beta 5 with Wells Fargo. Mary if you test today's RC candidate to confirm this is fixed with your banking situation that would be great.
Comment 28 Steven Michaud [:smichaud] (Retired) 2010-01-06 13:02:47 PST
> test today's RC candidate

Please test today's Minefield nightly.  The fix for this bug has only landed on the trunk.
Comment 29 Marcia Knous [:marcia - use ni] 2010-01-25 12:47:24 PST
This looks to be the top crash on Mac for Firefox 3.6 ->http://tinyurl.com/yarok5a. I think we should consider this for a dot release.
Comment 30 Steven Michaud [:smichaud] (Retired) 2010-01-25 13:03:47 PST
I've already requested 1.9.2-branch and 1.9.1-branch approval for my patch for bug 396680, which also fixes this bug.

You might want to repeat your comment at bug 396680.
Comment 31 Steven Michaud [:smichaud] (Retired) 2010-03-01 15:01:51 PST
This should now be fixed on the 1.9.2 and 1.9.1 branches by my patch for bug 396680.
Comment 32 ritvik mayank 2010-03-03 13:56:30 PST
The latest online build (Firefox 3.6 for Mac, March 3 2010, from getfirefox.com) still seems to have this problem. But of course I'm not sure if the latest build includes the fix.

<Crash Report>
Add-ons: {972ce4c6-7e08-4474-a285-3208198ce6fd}:3.6
BuildID: 20100115132715
CrashTime: 1267649199
EMCheckCompatibility: true
FramePoisonBase: 00000000f0dea000
FramePoisonSize: 4096
InstallTime: 1266609804
ProductName: Firefox
ReleaseChannel: release
SecondsSinceLastCrash: 3912
StartupTime: 1267645865
Theme: classic/1.0
Throttleable: 1
URL: http://losangeles.broadwayworld.com/printcolumn.cfm?id=103829
Vendor: Mozilla
Version: 3.6

This report also contains technical information about the state of the application when it crashed.
</Crash Report>

Also 

http://crash-stats.mozilla.com/report/index/40ff6713-b2b2-4622-a7c7-1efb22100303
Comment 33 Steven Michaud [:smichaud] (Retired) 2010-03-03 14:19:40 PST
The date (March 3 2010) is when the crash happened, not the date of the build.

The report is of a crash in FF 3.6 (released in late January 2010) -- which of course doesn't yet have this bug's fix.
Comment 34 ritvik mayank 2010-03-03 14:30:50 PST
Thanks Steven,
               Any suggestions, where should i look for the latest build?

Best,
- Ritvik
Comment 35 Steven Michaud [:smichaud] (Retired) 2010-03-03 14:48:22 PST
Current Firefox nightly builds can be found at
ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/.

1.9.2-branch builds are of Firefox 3.6.X.  1.9.1-branch builds are of
Firefox 3.5.X.  "mozilla-central" builds are on the "trunk".
Comment 36 Al Billings [:abillings] 2010-03-22 11:34:33 PDT
Candidate builds for Firefox 3.6.2 can be found at ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/3.6.2-candidates/build3/.

Candidate builds for Firefox 3.5.9 can be found at ftp://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/3.5.9-candidates/build1/.

Both of these contain what we think is the fix for this.
Comment 37 Marcia Knous [:marcia - use ni] 2010-03-22 13:47:06 PDT
Verified fixed on the 1.9.2 branch using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2. I verified using an office printer that reports supply levels. Adding keyword.
Comment 38 chris hofmann 2010-03-23 08:45:26 PDT
no reports of this signature in early 3.6.2 crash data. #5 topcrash killed! whooohooo!
Comment 39 Steven Michaud [:smichaud] (Retired) 2010-03-23 09:14:21 PDT
(In reply to comment #38)

Actually there are a couple:

bp-516a2bd9-9e50-4e44-ab20-7a0702100321
bp-274a9009-c13d-4224-8dae-ac3e42100319

And there've been a few of these on the trunk.

But they're a different bug:  The crashes only happen on OS X 10.6.X,
and the stacks are different.  Presumably this new bug is also an
Apple bug, and it may even be related to the old one (Apple may
somehow have "ported" the old bug to 10.6).  But fortunately it's much
less common.  And in any case we probably won't be able to do anything
about it until we can reproduce it.

Here's a recent stack of the current bug for reference:

bp-eb39899b-4aab-4c41-b414-f2b4e2100323

Note You need to log in before you can comment on or make changes to this bug.