MacOS 10.13 color picker crashes browser if input tag is hidden
Reported by
kevin...@gmail.com,
Sep 21 2017
|
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36 Steps to reproduce the problem: Install MacOS 10.13 GM. Click the color box to open the color picker. Select any color. Click the "Toggle" button to hide the div containing the input tag. Select any other color in the still open color picker. Usually (but not always) the browser will crash. This has been reproduced in 61.0.3163.91 and 63.0.3213.0. Unable to reproduce in MacOS 10.12. What is the expected behavior? What went wrong? Crash at "Performing @selector(didChooseColor:) from sender NSColorPanel 0x7fdd74fe3250". Did this work before? N/A Does this work in other browsers? Yes Chrome version: 61.0.3163.91 Channel: stable OS Version: OS X 10.13 Flash Version: Shockwave Flash 27.0 r0
,
Sep 22 2017
,
Sep 22 2017
Tested the issue on Mac !0.13 High Sierra using latest stable M61 #61.0.3163.100 and unable to reproduce the issue. Attached screencast for reference. @kevinday-- Could you please check attaced screencast and try in latest chrome stable and update us with your observations, if we have missed any steps in reproducing the issue. Thanks!
,
Sep 22 2017
You kinda need to click twice on the "toggle" button. Once for the browser window to take focus back from the picker, then again to actually click it. What you did in the screencast didn't actually click the "toggle" button. When you actually click it, you'll see the div below the button disappear.
,
Sep 22 2017
Thank you for providing more feedback. Adding requester "hdodda@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 22 2017
Confirmed the crash on 10.13. Symbolicated crash log attached.
It appears that the color_chooser_mac that set up the color panel is getting dealloced and the color panel still has it as its target.
The dealloc method says
- (void)dealloc {
NSColorPanel* panel = [NSColorPanel sharedColorPanel];
if ([panel delegate] == self) {
[panel setDelegate:nil];
[panel setTarget:nil];
[panel setAction:nil];
}
[super dealloc];
}
If 10.13 clears or changes the delegate for some reason, that would cause this crash.
,
Sep 22 2017
Confirmed that within -dealloc the delegate is set to nil, and that forcing the target to nil at that point prevents the crash. NSColorPanel has no public -target method but it does have a private __target method. Clearing the target on [panel __target] == self fixes the crasher.
,
Sep 22 2017
,
Nov 7 2017
Just ran into this too, 10.13 and can reproduce consistently (so can my colleague). Thanks for working on it. https://jsfiddle.net/ta8j0u8u/
,
Nov 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6bc9a0797f03a5da66423e6a622c795bfdb5036a commit 6bc9a0797f03a5da66423e6a622c795bfdb5036a Author: Jayson Adams <shrike@chromium.org> Date: Sat Nov 18 00:56:41 2017 [Mac] Fix NSColorPanel crasher on macOS 10.13. The ColorPanelCocoa sets itself as the target and delegate of the NSColorPanel, and on dealloc it clears the NSColorPanel's target and delegate settings if it sees that it is the delegate. On 10.13 it appears that the NSColorPanel's delegate can get set to nil while leaving the target intact, preventing -dealloc from clearing the ColorPanelCocoa target and leading to a Zombie crash. This cl uses a private method to check the NSColorPanel's target in -dealloc and clear it if it's still the ColorPanelCocoa. R=rsesek@chromium.org,avi@chromium.org Bug: 767598 Change-Id: I86557f3dadc65b8e0d455156457d960d8f45044e Reviewed-on: https://chromium-review.googlesource.com/685394 Commit-Queue: Jayson Adams <shrike@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Cr-Commit-Position: refs/heads/master@{#517645} [modify] https://crrev.com/6bc9a0797f03a5da66423e6a622c795bfdb5036a/chrome/browser/ui/BUILD.gn [add] https://crrev.com/6bc9a0797f03a5da66423e6a622c795bfdb5036a/chrome/browser/ui/cocoa/color_chooser_mac.h [modify] https://crrev.com/6bc9a0797f03a5da66423e6a622c795bfdb5036a/chrome/browser/ui/cocoa/color_chooser_mac.mm [add] https://crrev.com/6bc9a0797f03a5da66423e6a622c795bfdb5036a/chrome/browser/ui/cocoa/color_panel_cocoa_unittest.mm [modify] https://crrev.com/6bc9a0797f03a5da66423e6a622c795bfdb5036a/chrome/test/BUILD.gn
,
Nov 20 2017
,
Nov 20 2017
Should you file a radar for this (as it sounds like a macOS issue, since private methods are not supposed to be used)? |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by manoranj...@chromium.org
, Sep 21 2017Labels: Hotlist-HighSierra Needs-Triage-M61