Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reset the NSUserNotication handle on dismiss #17796

Merged
merged 1 commit into from Apr 16, 2019

Conversation

MarshallOfSound
Copy link
Member

Fixes #17758

The destructor and Dismiss both attempt to removeDeliveredNotification which you can only do once.

Notes: Fix crash when manually dismissing notifications before quit on macOS

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Apr 15, 2019
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Apr 16, 2019
@MarshallOfSound MarshallOfSound merged commit 9c3315c into master Apr 16, 2019
@release-clerk
Copy link

release-clerk bot commented Apr 16, 2019

Release Notes Persisted

Fix crash when manually dismissing notifications before quit on macOS

@trop
Copy link
Contributor

trop bot commented Apr 16, 2019

I have automatically backported this PR to "3-1-x", please check out #17820

@trop
Copy link
Contributor

trop bot commented Apr 16, 2019

I have automatically backported this PR to "4-1-x", please check out #17821

@trop trop bot added the in-flight/3-1-x label Apr 16, 2019
@trop
Copy link
Contributor

trop bot commented Apr 16, 2019

I have automatically backported this PR to "5-0-x", please check out #17822

@MarshallOfSound MarshallOfSound deleted the cleanup-notify branch April 16, 2019 18:39
@sofianguy sofianguy added this to Fixed in 5.0.0-beta.9 in 5.0.x Apr 20, 2019
@sofianguy sofianguy added this to Fixed (3.1.9) in 3.0.x / 3.1.x May 1, 2019
kiku-jw pushed a commit to kiku-jw/electron that referenced this pull request May 16, 2019
@VishwasShashidhar
Copy link

VishwasShashidhar commented Jul 2, 2019

@MarshallOfSound @codebytere Looks like this has caused a regression w.r.t. HTML notifications which crashes Electron on macOS when a notification comes in and is dismissed automatically by the system. We have not been able to consistently repro this yet on the electron-quick-start app though but can on Symphony.

We've tested with 3.1.6 and it doesn't crash, only happens with >=3.1.9

Here's a crash report if it helps understand the issue further.

System Integrity Protection: enabled

Crashed Thread:        0  CrBrowserMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000018

VM Regions Near 0x18:
--> 
    __TEXT                 000000010e3e4000-000000010e3e5000 [    4K] r-x/rwx SM=COW  /Applications/Symphony.app/Contents/MacOS/Symphony

Application Specific Information:
objc_msgSend() selector name: release


Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               	0x00007fff609d069d objc_msgSend + 29
1   com.github.electron.framework 	0x0000000110a0e969 0x110975000 + 629097
2   com.github.electron.framework 	0x0000000110a29aaf 0x110975000 + 740015
3   com.github.electron.framework 	0x0000000110a29ac9 0x110975000 + 740041
4   com.github.electron.framework 	0x0000000110a29179 0x110975000 + 737657
5   com.github.electron.framework 	0x0000000110afb5a5 brightray::CocoaNotification::Dismiss() + 117
6   com.github.electron.framework 	0x0000000110afdea9 brightray::NotificationPresenter::CloseNotificationWithId(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 153
7   com.github.electron.framework 	0x0000000110afe5c2 brightray::PlatformNotificationService::CloseNotification(content::BrowserContext*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 34
8   com.github.electron.framework 	0x00000001112d92df 0x110975000 + 9847519
9   com.github.electron.framework 	0x0000000110b94c11 0x110975000 + 2227217
10  com.github.electron.framework 	0x0000000110bb61bc 0x110975000 + 2363836
11  com.github.electron.framework 	0x0000000110bb6928 0x110975000 + 2365736
12  com.github.electron.framework 	0x0000000110c4ccda 0x110975000 + 2981082
13  com.github.electron.framework 	0x0000000110c4fa0a 0x110975000 + 2992650
14  com.github.electron.framework 	0x0000000110c4c5ff 0x110975000 + 2979327
15  com.apple.CoreFoundation      	0x00007fff3629b083 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
16  com.apple.CoreFoundation      	0x00007fff3629b029 __CFRunLoopDoSource0 + 108
17  com.apple.CoreFoundation      	0x00007fff3627e9eb __CFRunLoopDoSources0 + 195
18  com.apple.CoreFoundation      	0x00007fff3627dfb5 __CFRunLoopRun + 1189
19  com.apple.CoreFoundation      	0x00007fff3627d8be CFRunLoopRunSpecific + 455
20  com.apple.HIToolbox           	0x00007fff3556996b RunCurrentEventLoopInMode + 292
21  com.apple.HIToolbox           	0x00007fff355696a5 ReceiveNextEventCommon + 603
22  com.apple.HIToolbox           	0x00007fff35569436 _BlockUntilNextEventMatchingListInModeWithFilter + 64
23  com.apple.AppKit              	0x00007fff33903987 _DPSNextEvent + 965
24  com.apple.AppKit              	0x00007fff3390271f -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1361
25  com.apple.AppKit              	0x00007fff338fc83c -[NSApplication run] + 699
26  com.github.electron.framework 	0x0000000110c4d43c 0x110975000 + 2982972
27  com.github.electron.framework 	0x0000000110c4c11e 0x110975000 + 2978078
28  com.github.electron.framework 	0x0000000110bdb085 0x110975000 + 2515077
29  com.github.electron.framework 	0x00000001110a4c60 0x110975000 + 7535712
30  com.github.electron.framework 	0x00000001110a4a90 0x110975000 + 7535248
31  com.github.electron.framework 	0x00000001110cff42 0x110975000 + 7712578
32  com.github.electron.framework 	0x00000001110a0d99 0x110975000 + 7519641
33  com.github.electron.framework 	0x0000000110d96729 0x110975000 + 4331305
34  com.github.electron.framework 	0x0000000112a51342 0x110975000 + 34456386
35  com.github.electron.framework 	0x0000000110d95344 0x110975000 + 4326212
36  com.github.electron.framework 	0x00000001109774c4 AtomMain + 68

@codebytere
Copy link
Member

codebytere commented Jul 2, 2019

@VishwasShashidhar thanks for letting us know! would you mind opening a new issue for tracking purposes and tagging me?

@VishwasShashidhar
Copy link

Done @codebytere 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
3.0.x / 3.1.x
Fixed (3.1.9)
5.0.x
Fixed in 5.0.0-beta.9
Development

Successfully merging this pull request may close these issues.

Crash on macOS when clearing notifications manually on exit
3 participants