Closed Bug 1607140 Opened 4 years ago Closed 4 years ago

Crash in [@ nsTouchBarInputIcon::SetupIcon]

Categories

(Core :: Widget: Cocoa, defect)

x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox-esr68 --- unaffected
firefox71 --- unaffected
firefox72 --- unaffected
firefox73 + fixed
firefox74 + fixed

People

(Reporter: gsvelto, Assigned: bugzilla)

References

(Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(2 files)

This bug is for crash report bp-8a60b34b-6ce1-4890-9661-6c9fd0200106.

Top 10 frames of crashing thread:

0 XUL nsTouchBarInputIcon::SetupIcon widget/cocoa/nsTouchBarInputIcon.mm:67
1 XUL -[nsTouchBar loadIconForInput:forItem:] widget/cocoa/nsTouchBar.mm:534
2 XUL -[nsTouchBar updatePopover:withIdentifier:] widget/cocoa/nsTouchBar.mm:368
3 XUL -[nsTouchBar touchBar:makeItemForIdentifier:] widget/cocoa/nsTouchBar.mm
4 AppKit __32-[NSTouchBar itemForIdentifier:]_block_invoke 
5 AppKit +[NSAppearance _performWithCurrentAppearance:usingBlock:] 
6 AppKit -[NSTouchBar itemForIdentifier:] 
7 XUL -[nsTouchBar releaseJSObjects] widget/cocoa/nsTouchBar.mm:550
8 XUL nsCocoaWindow::DestroyNativeWindow widget/cocoa/nsCocoaWindow.mm:173
9 XUL nsCocoaWindow::~nsCocoaWindow widget/cocoa/nsCocoaWindow.mm:207

This looks like a dereference of a NULL this pointer.

I hit this as well (https://crash-stats.mozilla.org/report/index/c92779fd-56fe-4773-9056-2eb760200106) and my MacBook is closed as I use an external monitor and keyboard. Thought that might be worth mentioning.

Bug 1581555 is in the regression range. ni on harry

Flags: needinfo?(htwyford)

Marcia, do you have a full regression range? I landed two patches that touched nsTouchBarInputIcon within an hour or so of each other. Bug 1581555 and bug 1600356. Is the latter bug in the range?

Flags: needinfo?(mozillamarcia.knous)

Crashes started in 20200104094647. Full regression range: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=c0a6eb95b65cce34497c3f6aca502934ed0191cc&tochange=38e6ad5fd7535be88e432075f76ec4a2dc294672

From the crash stack it looks as if Bug 1600356 might have touched code.

Flags: needinfo?(mozillamarcia.knous)

Bug 1600356 looks like a pretty big set of changes to land during a soft freeze :(. I'm thinking we should back it out from Beta ASAP.

Works for me. I asked Ryan via PM that Bug 1581555 be backed out from m-c as well, so I can determine which of the two patches is causing this crash. Leaving ni=me since I'll continue to investigate.

Both bugs from comment 3 have been backed out from mozilla-beta, so 73.0b1 shouldn't be affected by these crashes. Also, per comment 6, bug 1581555 was backed out from m-c to see what affect that has on the Nightly crash rate.

Bugbug thinks this bug is a regression, but please revert this change in case of error.

Keywords: regression

I hit this crash several times on my MBP with TB too.
Maybe the check on the call site of SetupIcon isn't sufficent https://searchfox.org/mozilla-central/source/widget/cocoa/nsTouchBar.mm#525
This change was added in bug1600356
Adding

if (!mTouchBarHelper) {
   return;
}

could help

Ah, thank you Christoph. I have a feeling that's it. I'll prepare a patch.

Flags: needinfo?(htwyford)
Assignee: nobody → htwyford
Status: NEW → ASSIGNED
Regressed by: 1600356
Has Regression Range: --- → yes

While looking through the stacktrace I noticed a new touchbar is instantiated during releaseJSObjects, because the call to itemForIdentifier implicitly calls makeItemForIdentifier if the item isn't yet created. To prevent this a early return in makeItemForIdentifiercould save some resources. e.g.:

if (!mTouchBarHelper) {
   return nil;
}
Pushed by htwyford@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/320f70246faf
Add a more stringent check for mTouchBarHelper in loadIconForInput. r=spohl
Flags: needinfo?(htwyford)

Thanks for the needinfo. I missed comment 12 before pushing.

Flags: needinfo?(htwyford)
Pushed by htwyford@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ae6bb3a10669
Add mTouchBarHelper null-checks to makeItemForIdentifier and updateItem. r=spohl
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74

Looks like the fix resolved this, so I'm going to re-land the backed out patches into 74.

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

Attachment

General

Creator:
Created:
Updated:
Size: