pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.86k stars 838 forks source link

[12.9.0] Hang / panic at restart or shutdown - possibly due to kernel extension? #2151

Open luckman212 opened 4 years ago

luckman212 commented 4 years ago

Been tracking a problem for a couple of months now, a hang at restart/shutdown on 2 different Macs of mine. Started with kbE 12.8 + macOS 10.15.2 but now I am on kbE 12.9 + 10.15.3 and still having this hang.

The symptom is that upon issuing the restart/shutdown command, all windows will close and the "spinner" will appear in the center of the screen, as if the OS is trying to close all threads, but something is hanging it. This will spin for approximately 3-5 minutes and eventually a kernel panic will occur and the machine will automatically reboot itself. It doesn't happen 100% of the time, but I'd say pretty often (~75%). The longer I have used the computer without rebooting, the more likely it seems that it will hang. Not sure of a reliable way yet to reproduce this 100%.

Karabiner is the only 3rd party kext I have loaded:

$ kextstat | grep -v apple
Index Refs Address            Size       Wired      Name (Version) UUID <Linked Against>
  169    0 0xffffff7f83c4c000 0x5000     0x5000     org.pqrs.driver.Karabiner.VirtualHIDDevice.v061000 (6.10.0) 4D004D1A-ED2F-3780-AD53-A10F286EC759 <49 6 5 3 1>

Here's the output from the most recent panic, if it helps. I note that org.pqrs.driver.Karabiner.VirtualHIDDevice.v061000 is listed as the only loaded kernel extension:

panic(cpu 2 caller 0xffffff7f8fd63aae): watchdog timeout: no checkins from watchdogd in 182 seconds (11 totalcheckins since monitoring last enabled), shutdown in progress
Backtrace (CPU 2), Frame : Return Address
0xffffff8110a7bc40 : 0xffffff800ed3bb2b 
0xffffff8110a7bc90 : 0xffffff800ee734d5 
0xffffff8110a7bcd0 : 0xffffff800ee64f4e 
0xffffff8110a7bd20 : 0xffffff800ece2a40 
0xffffff8110a7bd40 : 0xffffff800ed3b217 
0xffffff8110a7be40 : 0xffffff800ed3b5fb 
0xffffff8110a7be90 : 0xffffff800f4d2b25 
0xffffff8110a7bf00 : 0xffffff7f8fd63aae 
0xffffff8110a7bf10 : 0xffffff7f8fd63472 
0xffffff8110a7bf50 : 0xffffff7f8fd78e76 
0xffffff8110a7bfa0 : 0xffffff800ece213e 
      Kernel Extensions in backtrace:
         com.apple.driver.watchdog(1.0)[053A5D15-51D4-3E61-978B-EB435FA4BD0A]@0xffffff7f8fd62000->0xffffff7f8fd6afff
         com.apple.driver.AppleSMC(3.1.9)[8D698096-1F90-3679-8151-22A7665ED287]@0xffffff7f8fd6b000->0xffffff7f8fd89fff
            dependency: com.apple.iokit.IOACPIFamily(1.4)[3D78401B-5D2D-33BC-9E41-DD2164EA874D]@0xffffff7f8fd59000
            dependency: com.apple.driver.watchdog(1)[053A5D15-51D4-3E61-978B-EB435FA4BD0A]@0xffffff7f8fd62000
            dependency: com.apple.iokit.IOPCIFamily(2.9)[ADD485B5-3EF8-37C4-B3C5-F86326E497A4]@0xffffff7f8f72f000

BSD process name corresponding to current thread: kernel_task

Mac OS version:
19D76

Kernel version:
Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64
Kernel UUID: A8DDE75C-CD97-3C37-B35D-1070CC50D2CE
Kernel slide:     0x000000000ea00000
Kernel text base: 0xffffff800ec00000
__HIB  text base: 0xffffff800eb00000
System model name: MacBookAir7,2 (Mac-937CB26E2E02BB01)
System shutdown begun: YES
Panic diags file available: NO (0xe00002cd)

System uptime in nanoseconds: 83388824775475
last loaded kext at 83146092375810: >!AXsanScheme   3 (addr 0xffffff7f92671000, size 32768)
last unloaded kext at 66831708438248: >usb.!UHostCompositeDevice    1.2 (addr 0xffffff7f92663000, size 28672)
loaded kexts:
org.pqrs.driver.Karabiner.VirtualHIDDevice.v061000  6.10.0
@filesystems.smbfs  3.4.1
@fileutil   20.036.15
>AudioAUUC  1.70
>!APlatformEnabler  2.7.0d0
>AGPM   111.4.2
>X86PlatformShim    1.0.0
@filesystems.autofs 3.0
>!AUpstreamUserClient   3.6.8
>!AHDA  283.15
>!AGraphicsDevicePolicy 4.7.2
@AGDCPluginDisplayMetrics   4.7.2
>!AHV   1
|IOUserEthernet 1.0.1
|IO!BSerialManager  7.0.3f5
>pmtelemetry    1
>!A!IBDWGraphics    14.0.4
@Dont_Steal_Mac_OS_X    7.0.0
>!ABacklight    180.1
>!A!IBDWGraphicsFramebuffer 14.0.4
>!A!ISlowAdaptiveClocking   4.0.0
>!AMCCSControl  1.13
>!AThunderboltIP    3.1.3
>eficheck   1
>!ACameraInterface  7.6.0
>!ALPC  3.1
>!ASMCLMU   212
>!UCardReader   489.80.2
>!AVirtIO   1.0
@filesystems.hfs.kext   522.0.9
@!AFSCompression.!AFSCompressionTypeDataless    1.0.0d1
@BootCache  40
@!AFSCompression.!AFSCompressionTypeZlib    1.0.0
>!ATopCaseHIDEventDriver    3430.1
@filesystems.apfs   1412.81.1
>!AAHCIPort 341.0.2
>AirPort.BrcmNIC    1400.1.1
@private.KextAudit  1.0
>!ASmartBatteryManager  161.0.0
>!ARTC  2.0
>!AACPIButtons  6.1
>!AHPET 1.8
>!ASMBIOS   2.1
>!AACPIEC   6.1
>!AAPIC 1.7
$!AImage4   1
@nke.applicationfirewall    303
$TMSafetyNet    8
@!ASystemPolicy 2.0.0
|EndpointSecurity   1
>!AXsanScheme   3
>!UAudio    320.49
>usb.cdc    5.0.0
>usb.!UHostCompositeDevice  1.2
@plugin.IOAVBDiscoveryPlugin    800.17
@kext.triggers  1.0
>DspFuncLib 283.15
@kext.OSvKernDSPLib 529
>!AGraphicsControl  4.7.2
|IOAVB!F    800.17
>!ASSE  1.0
>!ABacklightExpert  1.1.0
|IONDRVSupport  569.4
@!AGPUWrangler  4.7.2
@!AGraphicsDeviceControl    4.7.2
|IOAccelerator!F2   438.3.1
|IOSlowAdaptiveClocking!F   1.0.0
>!ASMBus!C  1.0.18d1
>X86PlatformPlugin  1.0.0
>IOPlatformPlugin!F 6.0.0d8
>!AHDA!C    283.15
|IOGraphics!F   569.4
|IOHDA!F    283.15
@plugin.IOgPTPPlugin    810.1
|IOEthernetAVB!C    1.1.0
|Broadcom!BHost!CUSBTransport   7.0.3f5
|IO!BHost!CUSBTransport 7.0.3f5
|IO!BHost!CTransport    7.0.3f5
>usb.!UHub  1.2
>usb.networking 5.0.0
|IOAudio!F  300.2
@vecLib.kext    1.2.0
|IOSerial!F 11
|IOSurface  269.6
@filesystems.hfs.encodings.kext 1
>!AHS!BDriver   3430.1
>IO!BHIDDriver  7.0.3f5
|IO!B!F 7.0.3f5
|IO!BPacketLogger   7.0.3f5
>!AMultitouchDriver 3430.1
>!AInputDeviceSupport   3430.1
>!AHIDKeyboard  209
>!AHSSPIHIDDriver   59
|IOAHCIBlock!S  316.80.1
|IOAHCI!F   290.0.1
>!AThunderboltDPInAdapter   6.2.5
>!AThunderboltDPAdapter!F   6.2.5
>!AThunderboltPCIDownAdapter    2.5.4
>!AThunderboltNHI   5.8.6
|IOThunderbolt!F    7.6.0
|IO80211!F  1200.12.2b1
>mDNSOffloadUserClient  1.0.1b8
>corecapture    1.0.4
|IOSkywalk!F    1
>!AHSSPISupport 59
|IOUSB!F    900.4.2
>!A!ILpssSpi!C  3.0.60
>!A!ILpssDmac   3.0.60
>!A!ILpssGspi   3.0.60
>usb.!UXHCIPCI  1.2
>usb.!UXHCI 1.2
>!AEFINVRAM 2.1
>!AEFIRuntime   2.1
|IOSMBus!F  1.1
|IOHID!F    2.0.0
$quarantine 4
$sandbox    300.0
@kext.!AMatch   1.0.0d1
>DiskImages 493.0.0
>!AFDEKeyStore  28.30
>!AEffaceable!S 1.0
>!AKeyStore 2
>!UTDM  489.80.2
|IOSCSIBlockCommandsDevice  422.0.2
>!ACredentialManager    1.0
>KernelRelayHost    1
>!ASEPManager   1.0.1
>IOSlaveProcessor   1
|IOUSBMass!SDriver  157.40.7
|IOSCSIArchitectureModel!F  422.0.2
|IO!S!F 2.1
|IOUSBHost!F    1.2
>!UHostMergeProperties  1.2
>usb.!UCommon   1.0
>!ABusPower!C   1.0
|CoreAnalytics!F    1
>!AMobileFileIntegrity  1.0.5
@kext.CoreTrust 1
|IOReport!F 47
|IOTimeSync!F   810.1
|IONetworking!F 3.4
>!AACPIPlatform 6.1
>!ASMC  3.1.9
>watchdog   1
|IOPCI!F    2.9
|IOACPI!F   1.4
@kec.pthread    1
@kec.Libm   1
@kec.corecrypto 1.0

Anything else I can do to try to help track this down please let me know!

rileytwo commented 4 years ago

I've also been encountering this problem, and I'd love to help if possible. The most recent panic I had showed org.pqrs.driver.Karabiner.VirtualHIDDevice.v061000 as the only kext, as well.

luckman212 commented 4 years ago

@rileytwo This may seem like an odd question but, by any chance do you have xq installed on your system? It's part of python-yq and used to parse XML into JSON. I had this installed on my system via Homebrew and through some trial and error I found that for some reason, running this binary was a way to guarantee that my system would hang upon restart. I haven't figured out why yet but this could be a clue.

https://github.com/kislyuk/yq

rileytwo commented 4 years ago

I don't. How were you able to test whether xq would cause your system to hang when shutting down?

luckman212 commented 4 years ago

It was just through a lot of trial and error. I have a few bash scripts that used it, and I noticed when I didn't run those scripts during my session, I was able to reboot cleanly. Hunting and pecking and about 100 reboots later, I narrowed it down to xq. It's crazy because it's just a userspace tool, so not sure how it could be causing this. But I am quite sure about it. Maybe whatever edge case it's hitting is also present in something else on your system.

rileytwo commented 4 years ago

Huh, that's interesting--especially since it's only in the userspace. Would you mind sharing what you use the tools for/what they interact with? I'm wondering if anything I'm doing happens to share any similarities with what your scripts do.

At this point, I've accepted anything is possible - I can't for the life of me figure out what's causing these hangs when rebooting or shutting down!

luckman212 commented 4 years ago

Sure. The scripts are for keeping a handful of apps updated on my systems. Something like my own version of brew cask. They basically check whatever API or XML feed that the app uses for auto-updating and compares the locally installed version, installing when needed. I have scripts for 20 different apps now, as well as a "wrapper" script that allows multiple selections and loops through them as a batch (ala brew cask upgrade).

Here's a relevant snippet from one that used to use xq for example, which was for Typora:

xml=$(curl -L -s -o- https://www.typora.io/download/dev_update.xml)
if [ -z "$xml" ]; then
  echo "error fetching XML version feed from typora.io"
  exit 1
fi
json=$(xq '.[] | .channel.item.enclosure?' <<<"$xml")
if [ -z "$json" ]; then
  json=$(xq '.[] | .channel.item[0].enclosure?' <<<"$xml")
fi
if [ -z "$json" ]; then
  echo "error extracting enclosure data from XML/json"
  exit 1
fi
eval "$(jq -r '@sh "url=\(."@url") ver=\(."@sparkle:shortVersionString")"' <<<"$json")"
if [ -z "$url" ] || [ -z "$ver" ]; then
  echo "error fetching version / url metadata from typora.io"
  exit 1
fi
echo "latest version is ${ver}"

I have rewritten it to use xmlstarlet instead, which works fine and doesn't cause this strange hang.

luckman212 commented 4 years ago

Had the hang again today. So whatever is causing this, there must be some other process aside from xq that triggers it.

rileytwo commented 4 years ago

I've been experiencing the issues above, still @luckman212. Any luck on your end?

After uninstalling Karabiner-Elements this morning, my macbook shuts down and restarts without any trouble.

Looking through system.log and karabiner's observer log, the observer appears to be scanning devices while the computer is shutting down. Should KE be scanning devices during a shutdown or reboot?

I've tried messing with the KeepAlive property in KE's agents and daemons plist files, but I can't seem to find a way to disable KE staying active while the system shuts down or reboots.

Any ideas, @tekezo? Let me know if you need any logs or anything else to help.

luckman212 commented 4 years ago

@rileytwo Nothing new on my end. Still getting the hangs from time to time. It seems that eventually the system watchdog daemon will time out and force a restart (sometimes 10 minutes+) so I usually opt for that rather than a hard reboot to avoid disk corruption.

I don't know where to go to help debug this, it's beyond my abilities - and with Apple deprecating kexts in 10.15.4 it seems that this whole thing will need some overhauling if kbE is to continue to function, so I'm waiting to see what's going to happen there.

cppguru commented 4 years ago

Do we have any update on the kernel panic issue? I had to remove Karabiner because it crashed my machine every 5-10 minutes.

cppguru commented 4 years ago

I am wondering, is this project abandoned or we should use something else not the issues here? This issue is open for more than 2 months without any reaction from the project.

itaen commented 4 years ago

I had same issue in my 16 inch MBP. Does anyone has solutions? I only need thirdparty keyboard Fn function mapping

panic(cpu 2 caller 0xffffff800f216487): "AppleIntelFramebuffer::setPowerState(0xffffff81be35b000 : 0xffffff7f927a8d88, 1 -> 0) timed out after 45950 ms"@/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/xnu/xnu-6153.101.6/iokit/Kernel/IOServicePM.cpp:5296 Backtrace (CPU 2), Frame : Return Address 0xffffff820e113b40 : 0xffffff800eb215cd 0xffffff820e113b90 : 0xffffff800ec5a3c5 0xffffff820e113bd0 : 0xffffff800ec4bf7e 0xffffff820e113c20 : 0xffffff800eac7a40 0xffffff820e113c40 : 0xffffff800eb20c97 0xffffff820e113d40 : 0xffffff800eb21087 0xffffff820e113d90 : 0xffffff800f2c2c7c 0xffffff820e113e00 : 0xffffff800f216487 0xffffff820e113e50 : 0xffffff800f215d69 0xffffff820e113e60 : 0xffffff800f22d2fe 0xffffff820e113ea0 : 0xffffff800f214b18 0xffffff820e113ec0 : 0xffffff800eb63545 0xffffff820e113f40 : 0xffffff800eb63071 0xffffff820e113fa0 : 0xffffff800eac713e

BSD process name corresponding to current thread: kernel_task Boot args: chunklist-security-epoch=0 -chunklist-no-rev2-dev

Mac OS version: 19E287

Kernel version: Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 Kernel UUID: AB0AA7EE-3D03-3C21-91AD-5719D79D7AF6 Kernel slide: 0x000000000e800000 Kernel text base: 0xffffff800ea00000 __HIB text base: 0xffffff800e900000 System model name: MacBookPro16,1 System shutdown begun: NO

System uptime in nanoseconds: 12744975851793 last loaded kext at 12271717156896: >usb.IOUSBHostHIDDevice 1.2 (addr 0xffffff7f927ff000, size 45056) last unloaded kext at 12085337858407: >!UAudio 322.2 (addr 0xffffff7f95e32000, size 434176) loaded kexts: org.pqrs.driver.Karabiner.VirtualHIDDevice.v061000 6.10.0

AudioAUUC 1.70 usb.!UHostBillboardDevice 1.0 @kext.AMDRadeonX6000 3.0.8 @kext.AMDRadeonServiceManager 3.0.8 !AGraphicsDevicePolicy 5.1.16 @fileutil 20.036.15 @AGDCPluginDisplayMetrics 5.1.16 !AHV 1 |IOUserEthernet 1.0.1 |IO!BSerialManager 7.0.4f6 pmtelemetry 1 !AUpstreamUserClient 3.6.8 AGPM 111.4.4 !APlatformEnabler 2.7.0d0 X86PlatformShim 1.0.0 @Dont_Steal_Mac_OS_X 7.0.0 !A!IKBLGraphics 14.0.5 AGDCBacklightControl 5.1.16 BridgeAudioCommunication 6.70.3 !AThunderboltIP 3.1.4 !A!ISlowAdaptiveClocking 4.0.0 !AMuxControl2 5.1.16 !AHIDALSService 1 !ATopCaseHIDEventDriver 3430.1 !ABridgeAudio!C 6.70.3 !AGFXHDA 100.1.426 !A!IPCHPMC 2.0.1 !A!ICFLGraphicsFramebuffer 14.0.5 !AAVEBridge 6.1 !AMCCSControl 1.11 @filesystems.autofs 3.0 BCMWLANFirmware4355.Hashstore 1 BCMWLANFirmware4364.Hashstore 1 BCMWLANFirmware4377.Hashstore 1 !ABCMWLANBusInterfacePCIe 1 @filesystems.hfs.kext 522.100.5 @BootCache 40 @!AFSCompression.!AFSCompressionTypeDataless 1.0.0d1 @!AFSCompression.!AFSCompressionTypeZlib 1.0.0 !AVirtIO 1.0 @filesystems.apfs 1412.101.1 @private.KextAudit 1.0 !ASmartBatteryManager 161.0.0 !AACPIButtons 6.1 !ASMBIOS 2.1 !AACPIEC 6.1 !AAPIC 1.7 $!AImage4 1 @nke.applicationfirewall 303 $TMSafetyNet 8 @!ASystemPolicy 2.0.0 |EndpointSecurity 1 usb.IOUSBHostHIDDevice 1.2 !UAudio 322.2 usb.!UHub 1.2 @kext.AMDRadeonX6100HWLibs 1.0 @kext.AMDRadeonX6000HWServices 3.0.8 |IOAVB!F 840.3 !ASSE 1.0 @!AGPUWrangler 5.1.16 @kext.AMDRadeonX6000Framebuffer 3.0.8 !ABacklightExpert 1.1.0 |IOSlowAdaptiveClocking!F 1.0.0 !AActuatorDriver 3440.1 X86PlatformPlugin 1.0.0 !AGraphicsControl 5.1.16 !AHS!BDriver 3430.1 IO!BHIDDriver 7.0.4f6 !AMultitouchDriver 3440.1 !AInputDeviceSupport 3440.8 !AHIDKeyboard 209 |IONDRVSupport 575.1 IOPlatformPlugin!F 6.0.0d8 |IO!BHost!CUARTTransport 7.0.4f6 |IO!BHost!CTransport 7.0.4f6 !A!ILpssUARTv1 3.0.60 !A!ILpssUARTCommon 3.0.60 !AOnboardSerial 1.0 @kext.AMDSupport 3.0.8 @!AGraphicsDeviceControl 5.1.16 |IOAccelerator!F2 438.4.5 !ASMBus!C 1.0.18d1 |IOGraphics!F 575.1 @plugin.IOgPTPPlugin 840.3 |IOEthernetAVB!C 1.1.0 @kext.triggers 1.0 usb.cdc.ncm 5.0.0 usb.cdc 5.0.0 usb.networking 5.0.0 usb.!UHostCompositeDevice 1.2 !ABCMWLANCore 1.0.0 mDNSOffloadUserClient 1.0.1b8 IOImageLoader 1.0.0 |IO80211!FV2 1200.12.2b1 corecapture 1.0.4 |IOSkywalk!F 1 |IOSurface 269.11 @filesystems.hfs.encodings.kext 1 |IOAudio!F 300.2 @vecLib.kext 1.2.0 |IOSerial!F 11 usb.!UVHCIBCE 1.2 usb.!UVHCI 1.2 usb.!UVHCICommonBCE 1.0 usb.!UVHCICommon 1.0 !AEffaceableNOR 1.0 |IOBufferCopy!C 1.1.0 |IOBufferCopyEngine!F 1 |IONVMe!F 2.1.0 !AThunderboltPCIDownAdapter 2.5.4 !AThunderboltDPInAdapter 6.2.6 !AThunderboltDPAdapter!F 6.2.6 !AHPM 3.4.4 !A!ILpssI2C!C 3.0.60 !A!ILpssDmac 3.0.60 !A!ILpssI2C 3.0.60 !AThunderboltNHI 5.8.6 |IOThunderbolt!F 7.6.0 usb.!UXHCIPCI 1.2 usb.!UXHCI 1.2 |IOUSB!F 900.4.2 !AEFINVRAM 2.1 !AEFIRuntime 2.1 !ASMCRTC 1.0 |IOSMBus!F 1.1 |IOHID!F 2.0.0 $quarantine 4 $sandbox 300.0 @kext.!AMatch 1.0.0d1 !AKeyStore 2 !UTDM 489.101.1 |IOSCSIBlockCommandsDevice 422.101.1 !ACredentialManager 1.0 KernelRelayHost 1 !ASEPManager 1.0.1 IOSlaveProcessor 1 !AFDEKeyStore 28.30 !AEffaceable!S 1.0 !AMobileFileIntegrity 1.0.5 @kext.CoreTrust 1 |CoreAnalytics!F 1 |IOTimeSync!F 840.3 |IONetworking!F 3.4 DiskImages 493.0.0 |IO!B!F 7.0.4f6 |IO!BPacketLogger 7.0.4f6 |IOUSBMass!SDriver 157.101.3 |IOSCSIArchitectureModel!F 422.101.1 |IO!S!F 2.1 |IOUSBHost!F 1.2 usb.!UCommon 1.0 !UHostMergeProperties 1.2 !ABusPower!C 1.0 |IOReport!F 47 !AACPIPlatform 6.1 !ASMC 3.1.9 watchdog 1 |IOPCI!F 2.9 |IOACPI!F 1.4 @kec.pthread 1 @kec.corecrypto 1.0 @kec.Libm 1

carlbennettnz commented 4 years ago

For others experiencing this issue, today I finally got confirmation from Apple Support that there is a known bug in macOS that has been causing kernel panics for 16" MacBook Pro users (and possibly others, not sure) when certain accessories are connected. They said a fix was coming, probably in the next macOS update.

For me, the panics only seem to happen while my Mac is asleep and connected to my Thunderbolt dock. I've been disconnecting it overnight and that seems to be avoiding the issue.

I tried uninstalling Karabiner for a few days, but nothing changed. I'm pretty sure Karabiner has nothing to do with the issue, at least for me.

fbrzozowski commented 4 years ago

For others experiencing this issue, today I finally got confirmation from Apple Support that there is a known bug in macOS that has been causing kernel panics for 16" MacBook Pro users (and possibly others, not sure) when certain accessories are connected. They said a fix was coming, probably in the next macOS update.

For me, the panics only seem to happen while my Mac is asleep and connected to my Thunderbolt dock. I've been disconnecting it overnight and that seems to be avoiding the issue.

I tried uninstalling Karabiner for a few days, but nothing changed. I'm pretty sure Karabiner has nothing to do with the issue, at least for me.

I think it also concerns 13" 2016+ MBP. It's happening with mine too. Apparently we have to w8 for an update.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cppguru commented 4 years ago

Please fix this. Karabiner right now is useless. It crashes the machine every 5 minutes.

rileytwo commented 4 years ago

Using KB with the driverkit dext seems to have fixed this issue for me

edit: the issue still persists, although, at this point, I'm less certain Karabiner is actually the issue. Honestly, whether my mac actually shuts down or hangs when attempting to seems to just happen at random, and pinning the issue to any one app has been difficult, to say the least.

Adding on to what @carlbennettnz and @fbrzozowski have said, I've had this issue with three MacBooks now: an early 2017 13" MacBook Pro (no T2 or Touch Bar), a late 2019 15" MacBook Pro, and a 2019 16" MacBook Pro. Hopefully the "update" will come soon?

ymkjp commented 3 years ago

I'm not quite sure if the information can be helpful, but I've faced a similar kernel panic once with MacBook Pro (15-inch, 2018):

last loaded kext at 4750921560329: >!AXsanScheme    3 (addr 0xffffff7fa2e27000, size 32768)
last unloaded kext at 848490181018: >usb.IOUSBHostHIDDevice 1.2 (addr 0xffffff7fa2d60000, size 45056)