leits / MeetingBar

🇺🇦 Your meetings at your fingertips in the macOS menu bar
https://meetingbar.app
Apache License 2.0
4.44k stars 192 forks source link

Bug: One appointment is making the app eating up 100% CPU #478

Closed thekoma closed 1 year ago

thekoma commented 2 years ago

App version Tested 3.x and 4.x

Installation source

Describe the bug The process starts but it eat up 100% CPU (only one CPU). Looks like it's because of an appointment but my calendar is really busy So I cannot understand which one. If I select other calendars it won't flinch. I cannot test via API as my company does not open API to third party apps (only Calendar by apple is working).

To Reproduce I can reproduce it at every start but I cannot detect the appointment. Is there a way to debug?

Desktop (please complete the following information):

thekoma commented 2 years ago

Is there anything I can do to help you debug this?

leits commented 2 years ago

Hi @thekoma, Can you check the latest version? https://github.com/leits/MeetingBar/releases/download/v4.0.6/MeetingBar.dmg

I have made some optimizations and want to check if the situation has improved.

SikhNerd commented 2 years ago

I'm also facing this problem out of the blue, 100% pegged cpu and it never loads. Upgrading to 4.0.6 showed no difference.

M1 Mac Pro, meetingbar installed via homebrew on MacOS 12.4.

Please let me know if there is any steps I can take to debug

SikhNerd commented 2 years ago

Here is the Diagnostic Report found in Console after it gets killed.

End time:         2022-08-08 10:43:34.050 -0500
OS Version:       macOS 12.4 (Build 21F79)
Architecture:     arm64e
Report Version:   35.1
Incident Identifier: 1F4667C5-5488-413E-B774-34B689BBBA52

Data Source:      Microstackshots
Shared Cache:     513553BB-5CA5-3B9E-A613-B0603FFE3038 slid base address 0x18b840000, slide 0xb840000

Command:          MeetingBar
Path:             /Applications/MeetingBar.app/Contents/MacOS/MeetingBar
Identifier:       leits.MeetingBar
Version:          4.0.6 (140)
Team ID:          KGH289N6T8
Architecture:     arm64
PID:              3820

Event:            cpu usage
Action taken:     none
CPU:              90 seconds cpu time over 91 seconds (99% cpu average), exceeding limit of 50% cpu over 180 seconds
CPU limit:        90s
Limit duration:   180s
CPU used:         90s
CPU duration:     91s
Duration:         90.91s
Duration Sampled: 83.95s
Steps:            52

Hardware model:   MacBookPro18,1
Active cpus:      10
HW page size:     16384
VM page size:     16384

Fan speed:        0 rpm
Advisory levels:  Battery -> 3, User -> 2, ThermalPressure -> 0, Combined -> 2
Free disk space:  485.01 GB/926.35 GB, low space threshold 3072 MB

Heaviest stack for the target process:
  51  start + 520 (dyld + 20620) [0x1030ed08c]
  51  ??? (MeetingBar + 19796) [0x102b4cd54]
  51  NSApplicationMain + 1132 (AppKit + 14700) [0x18e75f96c]
  51  -[NSApplication run] + 596 (AppKit + 205392) [0x18e78e250]
  51  -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1328 (AppKit + 262276) [0x18e79c084]
  51  _DPSNextEvent + 860 (AppKit + 268172) [0x18e79d78c]
  51  _BlockUntilNextEventMatchingListInModeWithFilter + 72 (HIToolbox + 204392) [0x19486ee68]
  51  ReceiveNextEventCommon + 564 (HIToolbox + 204980) [0x19486f0b4]
  51  RunCurrentEventLoopInMode + 292 (HIToolbox + 205624) [0x19486f338]
  51  CFRunLoopRunSpecific + 600 (CoreFoundation + 535332) [0x18bc36b24]
  51  __CFRunLoopRun + 2532 (CoreFoundation + 539816) [0x18bc37ca8]
  51  __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CoreFoundation + 813596) [0x18bc7aa1c]
  51  _dispatch_main_queue_callback_4CF + 44 (libdispatch.dylib + 74524) [0x18b9b631c]
  51  _dispatch_main_queue_drain + 928 (libdispatch.dylib + 75468) [0x18b9b66cc]
  51  _dispatch_client_callout + 20 (libdispatch.dylib + 16820) [0x18b9a81b4]
  51  _dispatch_call_block_and_release + 32 (libdispatch.dylib + 9712) [0x18b9a65f0]
  51  ??? (MeetingBar + 709504) [0x102bf5380]
  51  ??? (MeetingBar + 763288) [0x102c02598]
  51  ??? (MeetingBar + 617056) [0x102bdea60]
  51  ??? (MeetingBar + 555144) [0x102bcf888]
  51  ??? (MeetingBar + 556436) [0x102bcfd94]
  51  ??? (MeetingBar + 478016) [0x102bbcb40]
  51  ??? (MeetingBar + 732800) [0x102bfae80]
  51  ??? (MeetingBar + 476788) [0x102bbc674]
  51  ??? (MeetingBar + 296656) [0x102b906d0]
  51  ??? (MeetingBar + 223104) [0x102b7e780]
  50  ??? (MeetingBar + 251060) [0x102b854b4]
  50  -[NSRegularExpression(NSMatching) matchesInString:options:range:] + 196 (Foundation + 615296) [0x18cb4d380]
  50  -[NSRegularExpression(NSMatching) enumerateMatchesInString:options:range:usingBlock:] + 620 (Foundation + 388244) [0x18cb15c94]
  49  icu::RegexMatcher::find(UErrorCode&) + 744 (libicucore.A.dylib + 1914248) [0x18e1bf588]
  5  icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 10520 (libicucore.A.dylib + 1928452) [0x18e1c2d04]

Powerstats for:   MeetingBar [3820] [unique pid 8241348]
UUID:             05413561-3E0C-32FA-81A4-BC4CA9403662
Path:             /Applications/MeetingBar.app/Contents/MacOS/MeetingBar
Identifier:       leits.MeetingBar
Version:          4.0.6 (140)
Team ID:          KGH289N6T8
Architecture:     arm64
Footprint:        24.02 MB -> 73.81 MB (+49.80 MB)
Pageins:          46 pages
Start time:       2022-08-08 10:42:04.219 -0500
End time:         2022-08-08 10:43:28.169 -0500
Num samples:      52 (100%)
Primary state:    51 samples Non-Frontmost App, Non-Suppressed, User mode, Effective Thread QoS User Interactive, Requested Thread QoS User Interactive, Override Thread QoS Unspecified
User Activity:    0 samples Idle, 52 samples Active
Power Source:     0 samples on Battery, 52 samples on AC
  51  start + 520 (dyld + 20620) [0x1030ed08c]
    51  ??? (MeetingBar + 19796) [0x102b4cd54]
      51  NSApplicationMain + 1132 (AppKit + 14700) [0x18e75f96c]
        51  -[NSApplication run] + 596 (AppKit + 205392) [0x18e78e250]
          51  -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1328 (AppKit + 262276) [0x18e79c084]
            51  _DPSNextEvent + 860 (AppKit + 268172) [0x18e79d78c]
              51  _BlockUntilNextEventMatchingListInModeWithFilter + 72 (HIToolbox + 204392) [0x19486ee68]
                51  ReceiveNextEventCommon + 564 (HIToolbox + 204980) [0x19486f0b4]
                  51  RunCurrentEventLoopInMode + 292 (HIToolbox + 205624) [0x19486f338]
                    51  CFRunLoopRunSpecific + 600 (CoreFoundation + 535332) [0x18bc36b24]
                      51  __CFRunLoopRun + 2532 (CoreFoundation + 539816) [0x18bc37ca8]
                        51  __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CoreFoundation + 813596) [0x18bc7aa1c]
                          51  _dispatch_main_queue_callback_4CF + 44 (libdispatch.dylib + 74524) [0x18b9b631c]
                            51  _dispatch_main_queue_drain + 928 (libdispatch.dylib + 75468) [0x18b9b66cc]
                              51  _dispatch_client_callout + 20 (libdispatch.dylib + 16820) [0x18b9a81b4]
                                51  _dispatch_call_block_and_release + 32 (libdispatch.dylib + 9712) [0x18b9a65f0]
                                  51  ??? (MeetingBar + 709504) [0x102bf5380]
                                    51  ??? (MeetingBar + 763288) [0x102c02598]
                                      51  ??? (MeetingBar + 617056) [0x102bdea60]
                                        51  ??? (MeetingBar + 555144) [0x102bcf888]
                                          51  ??? (MeetingBar + 556436) [0x102bcfd94]
                                            51  ??? (MeetingBar + 478016) [0x102bbcb40]
                                              51  ??? (MeetingBar + 732800) [0x102bfae80]
                                                51  ??? (MeetingBar + 476788) [0x102bbc674]
                                                  51  ??? (MeetingBar + 296656) [0x102b906d0]
                                                    51  ??? (MeetingBar + 223104) [0x102b7e780]
                                                      50  ??? (MeetingBar + 251060) [0x102b854b4]
                                                        50  -[NSRegularExpression(NSMatching) matchesInString:options:range:] + 196 (Foundation + 615296) [0x18cb4d380]
                                                          50  -[NSRegularExpression(NSMatching) enumerateMatchesInString:options:range:usingBlock:] + 620 (Foundation + 388244) [0x18cb15c94]
                                                            49  icu::RegexMatcher::find(UErrorCode&) + 744 (libicucore.A.dylib + 1914248) [0x18e1bf588]
                                                              5   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 10520 (libicucore.A.dylib + 1928452) [0x18e1c2d04]
                                                              5   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 248 (libicucore.A.dylib + 1918180) [0x18e1c04e4]
                                                              4   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4568 (libicucore.A.dylib + 1922500) [0x18e1c15c4]
                                                              3   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 8260 (libicucore.A.dylib + 1926192) [0x18e1c2430]
                                                              3   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4108 (libicucore.A.dylib + 1922040) [0x18e1c13f8]
                                                              3   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 472 (libicucore.A.dylib + 1918404) [0x18e1c05c4]
                                                              2   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 10484 (libicucore.A.dylib + 1928416) [0x18e1c2ce0]
                                                              2   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 9696 (libicucore.A.dylib + 1927628) [0x18e1c29cc]
                                                              2   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4028 (libicucore.A.dylib + 1921960) [0x18e1c13a8]
                                                              2   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 3492 (libicucore.A.dylib + 1921424) [0x18e1c1190]
                                                              2   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 292 (libicucore.A.dylib + 1918224) [0x18e1c0510]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 10548 (libicucore.A.dylib + 1928480) [0x18e1c2d20]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 9684 (libicucore.A.dylib + 1927616) [0x18e1c29c0]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 5964 (libicucore.A.dylib + 1923896) [0x18e1c1b38]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 5952 (libicucore.A.dylib + 1923884) [0x18e1c1b2c]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4648 (libicucore.A.dylib + 1922580) [0x18e1c1614]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4608 (libicucore.A.dylib + 1922540) [0x18e1c15ec]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4600 (libicucore.A.dylib + 1922532) [0x18e1c15e4]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4516 (libicucore.A.dylib + 1922448) [0x18e1c1590]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4152 (libicucore.A.dylib + 1922084) [0x18e1c1424]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4088 (libicucore.A.dylib + 1922020) [0x18e1c13e4]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4024 (libicucore.A.dylib + 1921956) [0x18e1c13a4]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 4020 (libicucore.A.dylib + 1921952) [0x18e1c13a0]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 428 (libicucore.A.dylib + 1918360) [0x18e1c0598]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 408 (libicucore.A.dylib + 1918340) [0x18e1c0584]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 272 (libicucore.A.dylib + 1918204) [0x18e1c04fc]
                                                              1   icu::RegexMatcher::MatchAt(long long, signed char, UErrorCode&) + 260 (libicucore.A.dylib + 1918192) [0x18e1c04f0]
                                                            1   icu::RegexMatcher::find(UErrorCode&) + 632 (libicucore.A.dylib + 1914136) [0x18e1bf518]
                                                      1   ??? (MeetingBar + 250392) [0x102b85218]
                                                        1   specialized static String._fromSubstring(_:) + 84 (libswiftCore.dylib + 3238288) [0x198ff2990]
                                                          1   specialized static String._copying(_:) + 264 (libswiftCore.dylib + 3237040) [0x198ff24b0]
                                                            1   specialized _copyCollectionToContiguousArray<A>(_:) + 140 (libswiftCore.dylib + 136228) [0x198cfd424]
                                                              1   specialized Sequence._copySequenceContents(initializing:) + 128 (libswiftCore.dylib + 1752448) [0x198e87d80]
                                                                1   -[__NSCFString characterAtIndex:] + 100 (CoreFoundation + 391112) [0x18bc137c8]
  1   start_wqthread + 8 (libsystem_pthread.dylib + 8320) [0x18bb67080]
    1   _pthread_wqthread + 228 (libsystem_pthread.dylib + 13092) [0x18bb68324]
      1   _dispatch_worker_thread2 + 164 (libdispatch.dylib + 90372) [0x18b9ba104]
        1   _dispatch_root_queue_drain + 396 (libdispatch.dylib + 88296) [0x18b9b98e8]
          1   _dispatch_async_redirect_invoke + 736 (libdispatch.dylib + 28020) [0x18b9aad74]
            1   _dispatch_continuation_pop + 500 (libdispatch.dylib + 30320) [0x18b9ab670]
              1   _dispatch_client_callout + 20 (libdispatch.dylib + 16820) [0x18b9a81b4]
                1   _Block_release + 192 (libsystem_blocks.dylib + 6676) [0x18b892a14]
                  1   __destroy_helper_block_e8_32s40s48s + 28 (Accounts + 26800) [0x1922258b0]
                    1   _Block_release + 192 (libsystem_blocks.dylib + 6676) [0x18b892a14]
                      1   _dispatch_dispose + 208 (libdispatch.dylib + 12180) [0x18b9a6f94]
                        1   _os_semaphore_dispose + 32 (libsystem_platform.dylib + 14108) [0x18bb8271c]
                          1   semaphore_destroy + 116 (libsystem_kernel.dylib + 19920) [0x18bb31dd0]
                            1   mach_msg_trap + 8 (libsystem_kernel.dylib + 6320) [0x18bb2e8b0]
                              1   <Kernel mode, Effective Thread QoS User Initiated, Requested Thread QoS User Initiated>

  Binary Images:
           0x102b48000 -        0x102cf7fff  leits.MeetingBar 4.0.6 (140)         <05413561-3E0C-32FA-81A4-BC4CA9403662>  /Applications/MeetingBar.app/Contents/MacOS/MeetingBar
           0x1030e8000 -        0x103163fff  dyld (957)                           <D9C2A46E-8DC4-3950-9D6A-F799E8CCB683>  /usr/lib/dyld
           0x18b891000 -        0x18b892fff  libsystem_blocks.dylib (79.1)        <233D7321-F30D-31D7-8CB4-86B924F902A3>  /usr/lib/system/libsystem_blocks.dylib
           0x18b9a4000 -        0x18b9eafff  libdispatch.dylib (1325.120.2)       <F9300D47-D3DB-3349-8A6D-ACB68CD9983B>  /usr/lib/system/libdispatch.dylib
           0x18bb2d000 -        0x18bb64fff  libsystem_kernel.dylib (8020.121.3)  <03F48DC5-CAA7-3678-AF61-1A3C7FA8B06E>  /usr/lib/system/libsystem_kernel.dylib
           0x18bb65000 -        0x18bb71fff  libsystem_pthread.dylib (486.100.11) <42166A2C-89A9-3C38-A215-F028544CEA23>  /usr/lib/system/libsystem_pthread.dylib
           0x18bb7f000 -        0x18bb86fff  libsystem_platform.dylib (273.100.5) <D7ABA99F-BA00-36E9-945D-48ACF57FC568>  /usr/lib/system/libsystem_platform.dylib
           0x18bbb4000 -        0x18c0fafff  com.apple.CoreFoundation 6.9 (1863)  <994DB908-11A1-3E43-B7DF-25C09D51368A>  /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
           0x18cab7000 -        0x18cea8fff  com.apple.Foundation 6.9 (1863)      <A2E534D9-CDF0-397F-A41E-147559C83893>  /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
           0x18dfec000 -        0x18e2a1fff  libicucore.A.dylib (70104.2)         <B828A81C-77BB-3B55-9C92-7F5407755F50>  /usr/lib/libicucore.A.dylib
           0x18e75c000 -        0x18f613fff  com.apple.AppKit 6.9 (2113.50.132)   <A773DD23-B1C8-3C9B-9175-9A71D210ACE0>  /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
           0x19221f000 -        0x19229cfff  com.apple.Accounts 113 (113)         <9D250074-3401-3493-B820-0B0FEAED8EEC>  /System/Library/Frameworks/Accounts.framework/Versions/A/Accounts
           0x19483d000 -        0x194b70fff  com.apple.HIToolbox 2.1.1 (1114.1)   <F842B96A-54F3-36F3-9B94-B258FAE1B7EB>  /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
           0x198cdc000 -        0x1991dafff  libswiftCore.dylib (5.6.0.323.35)    <7EA04A7E-6CF6-34DB-B042-B49F544077DD>  /usr/lib/swift/libswiftCore.dylib
leits commented 1 year ago

Thanks, @SikhNerd! After your trace, I found the potential reason in regexes and fixed it: https://github.com/leits/MeetingBar/commit/e512b90e11c36b5fb52356744bacca667edeb34c

I've added the fix to the next release scope (4.2.0). I hope it'll help.

leits commented 1 year ago

@thekoma @SikhNerd released the fix in 4.2.0. Can you check it?

thekoma commented 1 year ago

After a couple days the problematic meeting was in the past so i was unable to reproduce it.

leits commented 1 year ago

Ok, thanks!

This error does not repeat itself for me, so I will close this ticket. Feel free to reopen.