Closed Bug 1156283 Opened 9 years ago Closed 9 years ago

crash in WidgetShutdownObserver::Observe(nsISupports*, char const*, char16_t const*)

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set
blocker

Tracking

()

VERIFIED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: yury, Assigned: jimm)

References

Details

(Keywords: crash, regression, Whiteboard: Is your Firefox Nightly affected by this bug? WORKAROUND in comment #8.)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-ac9510c5-9c88-49a7-abb5-8dcfe2150420.
=============================================================

The first bad revision is:
changeset:   239650:c24fb4429029
user:        Jim Mathies <jmathies@mozilla.com>
date:        Thu Apr 16 10:16:04 2015 -0500
summary:     Bug 1153939 - Avoid a race condition with setting nsBaseWidgets WidgetShutdownObserver widget pointer to null. Fixes a crash in nsBaseWidget::DestroyCompositor(). r=roc


STR:
1. Open Nightly from terminal with -ProfileManager, e.g.  ./obj-x86_64-apple-darwin14.3.0/dist/Nightly.app/Contents/MacOS/firefox -ProfileManager
Flags: needinfo?(jmathies)
This is a blocker for anyone using the profile manager.  I have been forced to revert to the build on 20140417 and disable updates until this is fixed.
Severity: critical → blocker
Looks like mWidget is null here. I*'m going to try to reproduce locally.
Flags: needinfo?(jmathies)
Hmm bummer, I can't reproduce on Windows. I'll have to fire up my mac and get it updated. If anyone on mac has the time to loook at this I would appreciate it.
Assignee: nobody → jmathies
bug 1156215 mentions debug build only, will look at that.
(In reply to Jim Mathies [:jimm] from comment #5)
> bug 1156215 mentions debug build only, will look at that.

I can reproduce on today's "regular" nightlies, which I think (?) are not debug builds, fwiw.
Yeah, whatever this is it's looks like it is osx specific.
Note you can work around this by using the -p <profilename> option.
Whiteboard: Is your Firefox Nightly affected by this bug? WORKAROUND in comment #8.
Attached patch patchSplinter Review
This is what I'm seeing:

1) The list of shutdown observers starts getting processed and during this our widget gets torn down.

2) During widget tear down we unregister the WidgetShutdownObserver observer and cleanup the gfx code.

3) The UnregisterShutdownObserver(this) call in WidgetShutdownObserver::Unregister() doesn't take effect, the observer service is too far into processing its list.

5) Observe gets called on WidgetShutdownObservers which looks at mWidget which still looks valid.. but it's not, the widget is already dead.

At this point we crash. Clearing mWidget before ~nsBaseWidget() works around this race.
Attachment #8594968 - Flags: review?(roc)
Once we're good, could we merge to m-c and re-spin a new Mac nightly? Please and thank you!
https://hg.mozilla.org/mozilla-central/rev/a81b76a677af
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
also restarted nightlys now for this!
no crashes in the 4-21 build so far, looks fixed.
Can confirm, no crash anymore here.
Status: RESOLVED → VERIFIED
Crash Signature: [@ WidgetShutdownObserver::Observe(nsISupports*, char const*, char16_t const*)] → [@ WidgetShutdownObserver::Observe(nsISupports*, char const*, char16_t const*)] [@ nsCOMPtr<nsIApplicationCacheContainer>::nsCOMPtr<nsIApplicationCacheContainer>(nsIApplicationCacheContainer*) | WidgetShutdownObserver::Observe(nsISupports*, char const*, …
Depends on: 1157625
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: