ther0n / UnnaturalScrollWheels

Invert scroll direction for physical scroll wheels while maintaining "Natural" scrolling for trackpads on MacOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crashes on startup

Yasushi opened this issue · comments

IOHIDEventSystemClientCopyProperty seems to be crashing because it is returning nil.

https://github.com/ther0n/UnnaturalScrollWheels/blob/1.3.0/UnnaturalScrollWheels/AppDelegate.swift#L128

UnnaturalScrollWheels/AppDelegate.swift:128: Fatal error: Unexpectedly found nil while unwrapping an Optional value
2022-08-21 14:22:15.576466+0900 UnnaturalScrollWheels[34073:593636] UnnaturalScrollWheels/AppDelegate.swift:128: Fatal error: Unexpectedly found nil while unwrapping an Optional value
(lldb) 
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               UnnaturalScrollWheels [33775]
Path:                  /Applications/UnnaturalScrollWheels.app/Contents/MacOS/UnnaturalScrollWheels
Identifier:            com.theron.UnnaturalScrollWheels
Version:               1.3.0 (194)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2022-08-21 14:13:25.1979 +0900
OS Version:            macOS 12.5.1 (21G83)
Report Version:        12
Anonymous UUID:        62FD4EB0-FD12-A977-64BA-A779E7EFE606

Sleep/Wake UUID:       8FC3491B-BA3E-405A-BEFB-1DDD80DAD1A3

Time Awake Since Boot: 22000 seconds
Time Since Wake:       6683 seconds

System Integrity Protection: enabled

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

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x00000001004853b4
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [33775]

Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage


Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   UnnaturalScrollWheels         	       0x1004853b4 0x100480000 + 21428
1   UnnaturalScrollWheels         	       0x100485208 0x100480000 + 21000
2   UnnaturalScrollWheels         	       0x1004841f0 0x100480000 + 16880
3   UnnaturalScrollWheels         	       0x100484470 0x100480000 + 17520
4   CoreFoundation                	       0x1902dd51c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 28
5   CoreFoundation                	       0x190381c18 ___CFXRegistrationPost_block_invoke + 52
6   CoreFoundation                	       0x190381b84 _CFXRegistrationPost + 456
7   CoreFoundation                	       0x1902ac1c0 _CFXNotificationPost + 732
8   Foundation                    	       0x191171c98 -[NSNotificationCenter postNotificationName:object:userInfo:] + 96
9   AppKit                        	       0x192e5728c -[NSApplication _postDidFinishNotification] + 340
10  AppKit                        	       0x192e56fa4 -[NSApplication _sendFinishLaunchingNotification] + 236
11  AppKit                        	       0x192e549c8 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 588
12  AppKit                        	       0x192e545a8 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 780
13  Foundation                    	       0x19119e838 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 348
14  Foundation                    	       0x19119e670 _NSAppleEventManagerGenericHandler + 96
15  AE                            	       0x196a8eac4 0x196a83000 + 47812
16  AE                            	       0x196a8e41c 0x196a83000 + 46108
17  AE                            	       0x196a874b4 aeProcessAppleEvent + 488
18  HIToolbox                     	       0x198f3795c AEProcessAppleEvent + 68
19  AppKit                        	       0x192e4e8f4 _DPSNextEvent + 1844
20  AppKit                        	       0x192e4ce14 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1328
21  AppKit                        	       0x192e3efe0 -[NSApplication run] + 596
22  AppKit                        	       0x192e106fc NSApplicationMain + 1132
23  UnnaturalScrollWheels         	       0x100483c40 0x100480000 + 15424
24  dyld                          	       0x10053908c start + 520

Thread 1:
0   libsystem_pthread.dylib       	       0x190217078 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib       	       0x190217078 start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib       	       0x190217078 start_wqthread + 0


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000002   x3: 0x0000000000000044
    x4: 0x0000000000000d03   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x000000016f97ba50
    x8: 0x0000000000000000   x9: 0xae7486a1f57b00cb  x10: 0x00000000000007fb  x11: 0x00000000000007fd
   x12: 0x0000000000000090  x13: 0x00000000b0aa788f  x14: 0x00000000b0ca8000  x15: 0x0000000000000150
   x16: 0x0000000080000000  x17: 0x0000000030c00000  x18: 0x0000000000000000  x19: 0x000000013d07d520
   x20: 0x0000600000f79b00  x21: 0x0000000000000000  x22: 0x0000000000000008  x23: 0x0000600000130b20
   x24: 0x0000000100492000  x25: 0x0000600000f22b50  x26: 0x000000100000000f  x27: 0x0000000000001400
   x28: 0x0000000000000000   fp: 0x000000016f97d830   lr: 0x7322000100485208
    sp: 0x000000016f97d7d0   pc: 0x00000001004853b4 cpsr: 0x60001000
   far: 0x000000013d807fb6  esr: 0xf2000001 (Breakpoint) brk 1

Binary Images:
       0x100480000 -        0x10048bfff com.theron.UnnaturalScrollWheels (1.3.0) <bde11e29-2b67-3dcf-90ff-bc31e4c9f297> /Applications/UnnaturalScrollWheels.app/Contents/MacOS/UnnaturalScrollWheels
       0x190264000 -        0x1907aafff com.apple.CoreFoundation (6.9) <1643f3d9-7049-37e4-b844-c0c0a42bde3b> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x191168000 -        0x191559fff com.apple.Foundation (6.9) <59ff845a-05b2-3b64-ae06-6ef1d6aee83e> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
       0x192e0d000 -        0x193cc5fff com.apple.AppKit (6.9) <07bc3607-552a-3eb9-a941-4911c589dbc5> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
       0x196a83000 -        0x196af4fff com.apple.AE (924) <daf31fb3-2ce6-3945-9fb6-04e336c08177> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
       0x198ef4000 -        0x199227fff com.apple.HIToolbox (2.1.1) <7112f6f2-a77e-39db-83c8-f627b8a49df8> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
       0x100534000 -        0x100593fff dyld (*) <75627683-a780-32ad-ae34-cf86dd23a26b> /usr/lib/dyld
       0x190215000 -        0x190221fff libsystem_pthread.dylib (*) <f32ff902-ba43-30b0-ad43-a2a8a9ff69fe> /usr/lib/system/libsystem_pthread.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 6
    thread_create: 0
    thread_set_state: 232

VM Region Summary:
ReadOnly portion of Libraries: Total=897.0M resident=0K(0%) swapped_out_or_unallocated=897.0M(100%)
Writable regions: Total=1.1G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.1G(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                   256K        1 
ColorSync                          528K       23 
CoreGraphics                        32K        2 
Foundation                          16K        1 
Kernel Alloc Once                   32K        1 
MALLOC                           208.3M       31 
MALLOC guard page                  192K       10 
MALLOC_MEDIUM (reserved)         480.0M        4         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
STACK GUARD                       56.1M        4 
Stack                             9808K        4 
VM_ALLOCATE                         80K        5 
__AUTH                            2157K      213 
__AUTH_CONST                      13.3M      379 
__CTF                               756        1 
__DATA                            9954K      369 
__DATA_CONST                      13.7M      384 
__DATA_DIRTY                      1259K      149 
__FONT_DATA                          4K        1 
__LINKEDIT                       577.6M        4 
__OBJC_CONST                      2356K      182 
__OBJC_RO                         83.0M        1 
__OBJC_RW                         3168K        1 
__TEXT                           319.4M      397 
__UNICODE                          592K        1 
dyld private memory               1024K        1 
mapped file                      156.4M       20 
shared memory                      848K       13 
===========                     =======  ======= 
TOTAL                              2.3G     2203 
TOTAL, minus reserved VM space     1.4G     2203 



-----------
Full Report
-----------

{"app_name":"UnnaturalScrollWheels","timestamp":"2022-08-21 14:13:27.00 +0900","app_version":"1.3.0","slice_uuid":"bde11e29-2b67-3dcf-90ff-bc31e4c9f297","build_version":"194","platform":1,"bundleID":"com.theron.UnnaturalScrollWheels","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.5.1 (21G83)","incident_id":"07B49C6E-B3BB-4D61-8DCB-016FBFF32727","name":"UnnaturalScrollWheels"}
{
  "uptime" : 22000,
  "procLaunch" : "2022-08-21 14:13:25.0877 +0900",
  "procRole" : "Default",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "Mac14,2",
  "procStartAbsTime" : 532254752871,
  "coalitionID" : 5020,
  "osVersion" : {
    "train" : "macOS 12.5.1",
    "build" : "21G83",
    "releaseType" : "User"
  },
  "captureTime" : "2022-08-21 14:13:25.1979 +0900",
  "incident" : "07B49C6E-B3BB-4D61-8DCB-016FBFF32727",
  "bug_type" : "309",
  "pid" : 33775,
  "procExitAbsTime" : 532257374531,
  "translated" : false,
  "cpuType" : "ARM-64",
  "procName" : "UnnaturalScrollWheels",
  "procPath" : "\/Applications\/UnnaturalScrollWheels.app\/Contents\/MacOS\/UnnaturalScrollWheels",
  "bundleInfo" : {"CFBundleShortVersionString":"1.3.0","CFBundleVersion":"194","CFBundleIdentifier":"com.theron.UnnaturalScrollWheels"},
  "storeInfo" : {"deviceIdentifierForVendor":"D3B8FA1B-A1DD-527F-9B87-E4958429F1DC","thirdParty":true},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "com.theron.UnnaturalScrollWheels",
  "crashReporterKey" : "62FD4EB0-FD12-A977-64BA-A779E7EFE606",
  "wakeTime" : 6683,
  "sleepWakeUUID" : "8FC3491B-BA3E-405A-BEFB-1DDD80DAD1A3",
  "sip" : "enabled",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000001, 0x00000001004853b4","rawCodes":[1,4299707316],"type":"EXC_BREAKPOINT","signal":"SIGTRAP"},
  "termination" : {"flags":0,"code":5,"namespace":"SIGNAL","indicator":"Trace\/BPT trap: 5","byProc":"exc handler","byPid":33775},
  "ktriageinfo" : "VM - pmap_enter failed with resource shortage\nVM - pmap_enter failed with resource shortage\n",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":232,"task_for_pid":6},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":576578,"threadState":{"x":[{"value":0},{"value":0},{"value":2},{"value":68},{"value":3331},{"value":0},{"value":0},{"value":6167181904},{"value":0},{"value":12570820490064232651},{"value":2043},{"value":2045},{"value":144},{"value":2963961999},{"value":2966061056},{"value":336},{"value":2147483648},{"value":817889280},{"value":0},{"value":5318890784},{"value":105553132493568},{"value":0},{"value":8},{"value":105553117514528},{"value":4299759616},{"value":105553132137296},{"value":68719476751},{"value":5120},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":8296193467869581832},"cpsr":{"value":1610616832},"fp":{"value":6167189552},"sp":{"value":6167189456},"esr":{"value":4060086273,"description":"(Breakpoint) brk 1"},"pc":{"value":4299707316,"matchesCrashFrame":1},"far":{"value":5326798774}},"queue":"com.apple.main-thread","frames":[{"imageOffset":21428,"imageIndex":0},{"imageOffset":21000,"imageIndex":0},{"imageOffset":16880,"imageIndex":0},{"imageOffset":17520,"imageIndex":0},{"imageOffset":496924,"symbol":"__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__","symbolLocation":28,"imageIndex":1},{"imageOffset":1170456,"symbol":"___CFXRegistrationPost_block_invoke","symbolLocation":52,"imageIndex":1},{"imageOffset":1170308,"symbol":"_CFXRegistrationPost","symbolLocation":456,"imageIndex":1},{"imageOffset":295360,"symbol":"_CFXNotificationPost","symbolLocation":732,"imageIndex":1},{"imageOffset":40088,"symbol":"-[NSNotificationCenter postNotificationName:object:userInfo:]","symbolLocation":96,"imageIndex":2},{"imageOffset":303756,"symbol":"-[NSApplication _postDidFinishNotification]","symbolLocation":340,"imageIndex":3},{"imageOffset":303012,"symbol":"-[NSApplication _sendFinishLaunchingNotification]","symbolLocation":236,"imageIndex":3},{"imageOffset":293320,"symbol":"-[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:]","symbolLocation":588,"imageIndex":3},{"imageOffset":292264,"symbol":"-[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]","symbolLocation":780,"imageIndex":3},{"imageOffset":223288,"symbol":"-[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:]","symbolLocation":348,"imageIndex":2},{"imageOffset":222832,"symbol":"_NSAppleEventManagerGenericHandler","symbolLocation":96,"imageIndex":2},{"imageOffset":47812,"imageIndex":4},{"imageOffset":46108,"imageIndex":4},{"imageOffset":17588,"symbol":"aeProcessAppleEvent","symbolLocation":488,"imageIndex":4},{"imageOffset":276828,"symbol":"AEProcessAppleEvent","symbolLocation":68,"imageIndex":5},{"imageOffset":268532,"symbol":"_DPSNextEvent","symbolLocation":1844,"imageIndex":3},{"imageOffset":261652,"symbol":"-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]","symbolLocation":1328,"imageIndex":3},{"imageOffset":204768,"symbol":"-[NSApplication run]","symbolLocation":596,"imageIndex":3},{"imageOffset":14076,"symbol":"NSApplicationMain","symbolLocation":1132,"imageIndex":3},{"imageOffset":15424,"imageIndex":0},{"imageOffset":20620,"symbol":"start","symbolLocation":520,"imageIndex":6}]},{"id":576589,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]},{"id":576590,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]},{"id":576617,"frames":[{"imageOffset":8312,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":7}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4299685888,
    "CFBundleShortVersionString" : "1.3.0",
    "CFBundleIdentifier" : "com.theron.UnnaturalScrollWheels",
    "size" : 49152,
    "uuid" : "bde11e29-2b67-3dcf-90ff-bc31e4c9f297",
    "path" : "\/Applications\/UnnaturalScrollWheels.app\/Contents\/MacOS\/UnnaturalScrollWheels",
    "name" : "UnnaturalScrollWheels",
    "CFBundleVersion" : "194"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6713393152,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.CoreFoundation",
    "size" : 5533696,
    "uuid" : "1643f3d9-7049-37e4-b844-c0c0a42bde3b",
    "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation",
    "name" : "CoreFoundation",
    "CFBundleVersion" : "1866"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6729138176,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.Foundation",
    "size" : 4136960,
    "uuid" : "59ff845a-05b2-3b64-ae06-6ef1d6aee83e",
    "path" : "\/System\/Library\/Frameworks\/Foundation.framework\/Versions\/C\/Foundation",
    "name" : "Foundation",
    "CFBundleVersion" : "1866"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6759174144,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.AppKit",
    "size" : 15437824,
    "uuid" : "07bc3607-552a-3eb9-a941-4911c589dbc5",
    "path" : "\/System\/Library\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit",
    "name" : "AppKit",
    "CFBundleVersion" : "2113.60.148"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6822572032,
    "CFBundleShortVersionString" : "924",
    "CFBundleIdentifier" : "com.apple.AE",
    "size" : 466944,
    "uuid" : "daf31fb3-2ce6-3945-9fb6-04e336c08177",
    "path" : "\/System\/Library\/Frameworks\/CoreServices.framework\/Versions\/A\/Frameworks\/AE.framework\/Versions\/A\/AE",
    "name" : "AE",
    "CFBundleVersion" : "924"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6860783616,
    "CFBundleShortVersionString" : "2.1.1",
    "CFBundleIdentifier" : "com.apple.HIToolbox",
    "size" : 3358720,
    "uuid" : "7112f6f2-a77e-39db-83c8-f627b8a49df8",
    "path" : "\/System\/Library\/Frameworks\/Carbon.framework\/Versions\/A\/Frameworks\/HIToolbox.framework\/Versions\/A\/HIToolbox",
    "name" : "HIToolbox"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 4300423168,
    "size" : 393216,
    "uuid" : "75627683-a780-32ad-ae34-cf86dd23a26b",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6713069568,
    "size" : 53248,
    "uuid" : "f32ff902-ba43-30b0-ad43-a2a8a9ff69fe",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  }
],
  "sharedCache" : {
  "base" : 6709772288,
  "size" : 3144712192,
  "uuid" : "f8ab76fb-504c-32dd-a5db-15a1f2f028f8"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=897.0M resident=0K(0%) swapped_out_or_unallocated=897.0M(100%)\nWritable regions: Total=1.1G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.1G(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nActivity Tracing                   256K        1 \nColorSync                          528K       23 \nCoreGraphics                        32K        2 \nFoundation                          16K        1 \nKernel Alloc Once                   32K        1 \nMALLOC                           208.3M       31 \nMALLOC guard page                  192K       10 \nMALLOC_MEDIUM (reserved)         480.0M        4         reserved VM address space (unallocated)\nMALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)\nSTACK GUARD                       56.1M        4 \nStack                             9808K        4 \nVM_ALLOCATE                         80K        5 \n__AUTH                            2157K      213 \n__AUTH_CONST                      13.3M      379 \n__CTF                               756        1 \n__DATA                            9954K      369 \n__DATA_CONST                      13.7M      384 \n__DATA_DIRTY                      1259K      149 \n__FONT_DATA                          4K        1 \n__LINKEDIT                       577.6M        4 \n__OBJC_CONST                      2356K      182 \n__OBJC_RO                         83.0M        1 \n__OBJC_RW                         3168K        1 \n__TEXT                           319.4M      397 \n__UNICODE                          592K        1 \ndyld private memory               1024K        1 \nmapped file                      156.4M       20 \nshared memory                      848K       13 \n===========                     =======  ======= \nTOTAL                              2.3G     2203 \nTOTAL, minus reserved VM space     1.4G     2203 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "61301e3a61217b3110231469",
      "factorPackIds" : {
        "SIRI_FIND_MY_CONFIGURATION_FILES" : "6216ae152a40e71046e16225"
      },
      "deploymentId" : 240000016
    },
    {
      "rolloutId" : "5fc94383418129005b4e9ae0",
      "factorPackIds" : {

      },
      "deploymentId" : 240000441
    }
  ],
  "experiments" : [

  ]
}
}