Kernel panic when waking from sleep

Describe the bug
I left my laptop powered on and sleeping all weekend with lid closed, with external display and keyboard attached. When I returned Monday morning I was unable to wake it up so I had to reboot and then I saw the panic report naming BetterTouchTool as the culprit. Not sure if you can get anything useful from this.

Device information:
MacBookPro11,5
macOS 10.14.2
BTT 2.428

*** Panic Report ***
Panic(CPU 0, time 237261541616907): NMIPI for unresponsive processor: TLB flush timeout, TLB state:0x0
RAX: 0xffffff80165c1916, RBX: 0x0000000000000000, RCX: 0xffffff80165c1a5c, RDX: 0xffffff922aaf8060
RSP: 0xffffff81d3440d80, RBP: 0xffffff81d3440df0, RSI: 0x0000000000000004, RDI: 0xffffff922aaf8060
R8:  0x0000000000000001, R9:  0x0000000000000000, R10: 0x0000000000000000, R11: 0x0000000000000000
R12: 0x0000000000000001, R13: 0x0000000000000002, R14: 0x000000000000fc00, R15: 0xffffff80400d9680
RFL: 0x0000000000000093, RIP: 0xffffff80165c1919, CS:  0x0000000000000008, SS:  0x0000000000000010
Backtrace (CPU 0), Frame : Return Address
0xffffff81d3440c20 : 0xffffff80166d975f 
0xffffff81d3440c80 : 0xffffff801655bfa7 
0xffffff81d3440df0 : 0xffffff7f977cb486 
0xffffff81d3440e10 : 0xffffff7f976df061 
0xffffff81d3440e30 : 0xffffff7f976d5fff 
0xffffff81d3440ea0 : 0xffffff8016c5c2e5 
0xffffff81d3440ee0 : 0xffffff7f96eb3a3e 
0xffffff81d3440f30 : 0xffffff7f97e42a7c 
0xffffff81d3440f50 : 0xffffff7f97e4baa5 
0xffffff81d3440f70 : 0xffffff80166d977c 
0xffffff81d3440fd0 : 0xffffff801655be4d 
0xffffff81f4e83f30 : 0xffffff80165ce627 
0xffffff81f4e83f80 : 0xffffff80165cecb0 
0xffffff81f4e83fa0 : 0xffffff801655b0ce 
      Kernel Extensions in backtrace:
         com.apple.iokit.IOPCIFamily(2.9)[7EA30FDD-A2FB-390F-99DD-42BC19691BB4]@0xffffff7f96e95000->0xffffff7f96ec9fff
         com.apple.driver.AppleACPIPlatform(6.1)[52CE91F1-D89E-3BF2-A5BE-0A914968DC65]@0xffffff7f97e3b000->0xffffff7f97ed6fff
            dependency: com.apple.iokit.IOACPIFamily(1.4)[99A8A054-9F64-3FB8-BB1D-5973F8AB04A1]@0xffffff7f97413000
            dependency: com.apple.iokit.IOPCIFamily(2.9)[7EA30FDD-A2FB-390F-99DD-42BC19691BB4]@0xffffff7f96e95000
            dependency: com.apple.driver.AppleSMC(3.1.9)[9FAF842D-CCF4-3F6A-893D-DD542139F128]@0xffffff7f9741c000
         com.apple.driver.usb.AppleUSBXHCI(1.2)[7F694937-2965-3985-B5D1-95642D87688C]@0xffffff7f976c7000->0xffffff7f9771cfff
            dependency: com.apple.iokit.IOACPIFamily(1.4)[99A8A054-9F64-3FB8-BB1D-5973F8AB04A1]@0xffffff7f97413000
            dependency: com.apple.iokit.IOUSBHostFamily(1.2)[28523125-5E51-38C1-B721-16166115E54E]@0xffffff7f9744c000
            dependency: com.apple.driver.usb.AppleUSBCommon(1.0)[46BD3E9A-9FF2-3806-B397-F45A4E834547]@0xffffff7f97444000
         com.apple.driver.usb.AppleUSBXHCIPCI(1.2)[94B23905-04C8-311B-9221-AAB88975A25D]@0xffffff7f977c4000->0xffffff7f977f2fff
            dependency: com.apple.iokit.IOACPIFamily(1.4)[99A8A054-9F64-3FB8-BB1D-5973F8AB04A1]@0xffffff7f97413000
            dependency: com.apple.iokit.IOPCIFamily(2.9)[7EA30FDD-A2FB-390F-99DD-42BC19691BB4]@0xffffff7f96e95000
            dependency: com.apple.iokit.IOUSBHostFamily(1.2)[28523125-5E51-38C1-B721-16166115E54E]@0xffffff7f9744c000
            dependency: com.apple.driver.usb.AppleUSBCommon(1.0)[46BD3E9A-9FF2-3806-B397-F45A4E834547]@0xffffff7f97444000
            dependency: com.apple.driver.usb.AppleUSBXHCI(1.2)[7F694937-2965-3985-B5D1-95642D87688C]@0xffffff7f976c7000

BSD process name corresponding to current thread: kernel_task

Mac OS version:
18C54

Kernel version:
Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64
Kernel UUID: 56B30885-F9BA-30E8-AD1C-5D59EC243BA9
Kernel slide:     0x0000000016200000
Kernel text base: 0xffffff8016400000
__HIB  text base: 0xffffff8016300000
System model name: MacBookPro11,5 (Mac-06F11F11946D27C5)

System uptime in nanoseconds: 237261734160635
last loaded kext at 65713837442484: com.apple.driver.AppleXsanScheme	3 (addr 0xffffff7f98792000, size 32768)
last unloaded kext at 67166082420464: com.apple.driver.AppleXsanScheme	3 (addr 0xffffff7f98792000, size 32768)
loaded kexts:
org.virtualbox.kext.VBoxNetAdp	5.2.22
org.virtualbox.kext.VBoxNetFlt	5.2.22
org.virtualbox.kext.VBoxUSB	5.2.22
org.virtualbox.kext.VBoxDrv	5.2.22
com.apple.driver.AppleIntelI210Ethernet	2.3.0
com.apple.driver.AppleFWOHCI	5.6.0
com.apple.filesystems.smbfs	3.3.1
com.apple.kext.AMDFramebuffer	2.0.4
com.apple.kext.AMDRadeonX4000	2.0.4
com.apple.driver.AudioAUUC	1.70
com.apple.driver.AppleGraphicsDevicePolicy	3.28.4
com.apple.AGDCPluginDisplayMetrics	3.28.4
com.apple.driver.AppleHV	1
com.apple.fileutil	18.306.12
com.apple.iokit.IOUserEthernet	1.0.1
com.apple.filesystems.autofs	3.0
com.apple.iokit.IOBluetoothSerialManager	6.0.9f2
com.apple.driver.AGPM	110.23.46
com.apple.driver.ApplePlatformEnabler	2.7.0d0
com.apple.driver.X86PlatformShim	1.0.0
com.apple.driver.pmtelemetry	1
com.apple.driver.AppleUpstreamUserClient	3.6.5
com.apple.driver.AGDCBacklightControl	3.28.4
com.apple.Dont_Steal_Mac_OS_X	7.0.0
com.apple.driver.AppleIntelHD5000Graphics	12.0.4
com.apple.driver.AppleHDA	282.10
com.apple.driver.eficheck	1
com.apple.driver.AppleThunderboltIP	3.1.2
com.apple.iokit.BroadcomBluetooth20703USBTransport	6.0.9f2
com.apple.kext.AMD7000Controller	2.0.4
com.apple.driver.AirPort.BrcmNIC	1400.1.1
com.apple.driver.AppleMCCSControl	1.5.6
com.apple.driver.AppleMuxControl	3.28.4
com.apple.driver.AppleLPC	3.1
com.apple.driver.AppleOSXWatchdog	1
com.apple.driver.AppleSMCLMU	212
com.apple.driver.AppleCameraInterface	6.8.0
com.apple.driver.AppleIntelSlowAdaptiveClocking	4.0.0
com.apple.driver.AppleIntelFramebufferAzul	12.0.4
com.apple.driver.AppleUSBCardReader	456.230.1
com.apple.driver.AppleTopCaseHIDEventDriver	138.2
com.apple.driver.AppleUSBTopCaseDriver	138.2
com.apple.filesystems.apfs	945.230.6
com.apple.driver.AppleAHCIPort	329.200.2
com.apple.driver.AppleVirtIO	2.1.2
com.apple.filesystems.hfs.kext	407.200.4
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless	1.0.0d1
com.apple.BootCache	40
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib	1.0.0
com.apple.AppleSystemPolicy	1.0
com.apple.private.KextAudit	1.0
com.apple.driver.AppleSmartBatteryManager	161.0.0
com.apple.driver.AppleHPET	1.8
com.apple.driver.AppleACPIButtons	6.1
com.apple.driver.AppleRTC	2.0
com.apple.driver.AppleSMBIOS	2.1
com.apple.driver.AppleACPIEC	6.1
com.apple.driver.AppleAPIC	1.7
com.apple.nke.applicationfirewall	190
com.apple.security.TMSafetyNet	8
com.apple.iokit.IOUSBHIDDriver	900.4.2
com.apple.iokit.IOFireWireIP	2.3.0
com.apple.iokit.IOFireWireFamily	4.7.3
com.apple.driver.AppleThunderboltPCIUpAdapter	2.1.4
com.apple.driver.AppleThunderboltDPOutAdapter	5.5.8
com.apple.driver.AppleUSBAudio	315.6
com.apple.driver.usb.AppleUSBHub	1.2
com.apple.kext.AMDRadeonX4030HWLibs	1.0
com.apple.kext.AMDRadeonX4000HWServices	2.0.4
com.apple.iokit.IOAVBFamily	710.1
com.apple.plugin.IOgPTPPlugin	700.7
com.apple.iokit.IOEthernetAVBController	1.1.0
com.apple.iokit.IOUSBUserClient	900.4.2
com.apple.kext.triggers	1.0
com.apple.driver.AppleSSE	1.0
com.apple.driver.DspFuncLib	282.10
com.apple.kext.OSvKernDSPLib	527
com.apple.driver.AppleBacklightExpert	1.1.0
com.apple.AppleGPUWrangler	3.28.4
com.apple.iokit.IONDRVSupport	530
com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport	6.0.9f2
com.apple.iokit.IOBluetoothHostControllerUSBTransport	6.0.9f2
com.apple.iokit.IOBluetoothHostControllerTransport	6.0.9f2
com.apple.kext.AMDSupport	2.0.4
com.apple.iokit.IO80211Family	1200.12.2
com.apple.driver.mDNSOffloadUserClient	1.0.1b8
com.apple.driver.corecapture	1.0.4
com.apple.driver.AppleHDAController	282.10
com.apple.iokit.IOHDAFamily	282.10
com.apple.driver.AppleSMBusController	1.0.18d1
com.apple.driver.AppleGraphicsControl	3.28.4
com.apple.iokit.IOAudioFamily	206.5
com.apple.vecLib.kext	1.2.0
com.apple.driver.X86PlatformPlugin	1.0.0
com.apple.driver.IOPlatformPluginFamily	6.0.0d8
com.apple.iokit.IOSlowAdaptiveClockingFamily	1.0.0
com.apple.AppleGraphicsDeviceControl	3.28.4
com.apple.iokit.IOAcceleratorFamily2	404.2.2
com.apple.iokit.IOGraphicsFamily	530.14
com.apple.iokit.IOSurface	255.1
com.apple.driver.AppleHSBluetoothDriver	138.2
com.apple.driver.IOBluetoothHIDDriver	6.0.9f2
com.apple.iokit.IOBluetoothFamily	6.0.9f2
com.apple.driver.AppleActuatorDriver	2410.5
com.apple.driver.AppleHIDKeyboard	208
com.apple.driver.AppleMultitouchDriver	2410.5
com.apple.driver.AppleInputDeviceSupport	2410.2
com.apple.driver.usb.IOUSBHostHIDDevice	1.2
com.apple.driver.usb.networking	5.0.0
com.apple.driver.usb.AppleUSBHostCompositeDevice	1.2
com.apple.iokit.IOAHCIBlockStorage	301.200.2
com.apple.driver.usb.AppleUSBXHCIPCI	1.2
com.apple.driver.usb.AppleUSBXHCI	1.2
com.apple.iokit.IOAHCIFamily	288
com.apple.iokit.IOSerialFamily	11
com.apple.filesystems.hfs.encodings.kext	1
com.apple.driver.AppleThunderboltDPInAdapter	5.5.8
com.apple.driver.AppleThunderboltDPAdapterFamily	5.5.8
com.apple.driver.AppleThunderboltPCIDownAdapter	2.1.4
com.apple.driver.AppleThunderboltNHI	4.7.6
com.apple.iokit.IOThunderboltFamily	6.8.1
com.apple.driver.usb.AppleUSBHostPacketFilter	1.0
com.apple.iokit.IOUSBFamily	900.4.2
com.apple.driver.AppleUSBHostMergeProperties	1.2
com.apple.driver.AppleEFINVRAM	2.1
com.apple.driver.AppleEFIRuntime	2.1
com.apple.iokit.IOSMBusFamily	1.1
com.apple.iokit.IOHIDFamily	2.0.0
com.apple.security.quarantine	3
com.apple.security.sandbox	300.0
com.apple.kext.AppleMatch	1.0.0d1
com.apple.driver.DiskImages	493.0.0
com.apple.driver.AppleFDEKeyStore	28.30
com.apple.driver.AppleEffaceableStorage	1.0
com.apple.driver.AppleKeyStore	2
com.apple.driver.AppleUSBTDM	456.230.1
com.apple.driver.AppleMobileFileIntegrity	1.0.5
com.apple.kext.CoreTrust	1
com.apple.iokit.IOUSBMassStorageDriver	145.200.2
com.apple.iokit.IOSCSIBlockCommandsDevice	408.200.1
com.apple.iokit.IOSCSIArchitectureModelFamily	408.200.1
com.apple.iokit.IOStorageFamily	2.1
com.apple.driver.AppleCredentialManager	1.0
com.apple.driver.KernelRelayHost	1
com.apple.iokit.IOUSBHostFamily	1.2
com.apple.driver.usb.AppleUSBCommon	1.0
com.apple.driver.AppleBusPowerController	1.0
com.apple.driver.AppleSEPManager	1.0.1
com.apple.driver.IOSlaveProcessor	1
com.apple.iokit.IOTimeSyncFamily	700.7
com.apple.iokit.IONetworkingFamily	3.4
com.apple.iokit.IOReportFamily	47
com.apple.driver.AppleACPIPlatform	6.1
com.apple.driver.AppleSMC	3.1.9
com.apple.iokit.IOPCIFamily	2.9
com.apple.iokit.IOACPIFamily	1.4
com.apple.kec.pthread	1
com.apple.kec.Libm	1
com.apple.kec.corecrypto	1.0
panic(cpu 4 caller 0xffffff80166b4c85): "TLB invalidation IPI timeout, unresponsive CPU bitmap: 0x1, NMIPI acks: 0x0, now: 0x1, deadline: 237261512308959"@/BuildRoot/Library/Caches/com.apple.xbs/Sources/xnu/xnu-4903.231.4/osfmk/x86_64/pmap.c:2837
Backtrace (CPU 4), Frame : Return Address
0xffffff9215f23660 : 0xffffff80165aeafd 
0xffffff9215f236b0 : 0xffffff80166e85a3 
0xffffff9215f236f0 : 0xffffff80166d9fca 
0xffffff9215f23760 : 0xffffff801655bca0 
0xffffff9215f23780 : 0xffffff80165ae517 
0xffffff9215f238a0 : 0xffffff80165ae363 
0xffffff9215f23910 : 0xffffff80166b4c85 
0xffffff9215f239b0 : 0xffffff80166bbb74 
0xffffff9215f23a90 : 0xffffff80166bcaf7 
0xffffff9215f23af0 : 0xffffff8016643cec 
0xffffff9215f23c40 : 0xffffff801664b3d2 
0xffffff9215f23c80 : 0xffffff801663f133 
0xffffff9215f23cb0 : 0xffffff8016be72f0 
0xffffff9215f23cd0 : 0xffffff8016c8d059 
0xffffff9215f23d30 : 0xffffff801669634b 
0xffffff9215f23d80 : 0xffffff80165b42bd 
0xffffff9215f23dd0 : 0xffffff801658ebe5 
0xffffff9215f23e50 : 0xffffff80165a359e 
0xffffff9215f23ef0 : 0xffffff80166c170b 
0xffffff9215f23fa0 : 0xffffff801655c486 

BSD process name corresponding to current thread: BetterTouchTool

EOF
Model: MacBookPro11,5, BootROM 187.0.0.0.0, 4 processors, Intel Core i7, 2.8 GHz, 16 GB, SMC 2.30f2
Graphics: AMD Radeon R9 M370X, AMD Radeon R9 M370X, PCIe
Graphics: Intel Iris Pro, Intel Iris Pro, Built-In
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533642465238412D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533642465238412D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x152), Broadcom BCM43xx 1.0 (7.77.61.1 AirPortDriverBrcmNIC-1305.2)
Bluetooth: Version 6.0.9f2, 3 services, 27 devices, 1 incoming serial ports
Network Service: Thunderbolt Ethernet Slot 2, Ethernet, en3
Network Service: Wi-Fi, AirPort, en0
PCI Card: ethernet, Ethernet Controller, Thunderbolt@193,0,0
PCI Card: pci1b73,1100, USB eXtensible Host Controller, Thunderbolt@194,0,0
PCI Card: pci1b73,1100, USB eXtensible Host Controller, Thunderbolt@192,0,0
PCI Card: pci11c1,5901, IEEE 1394 Open HCI, Thunderbolt@191,0,0
Serial ATA Device: APPLE SSD SM1024G, 1 TB
USB Device: USB 3.0 Bus
USB Device: USB audio CODEC
USB Device: USB 3.0 Bus
USB Device: KB800 Kinesis Freestyle
USB Device: USB 3.0 Bus
USB Device: Apple Internal Keyboard / Trackpad
USB Device: Bluetooth USB Host Controller
USB Device: USB Receiver
Thunderbolt Bus: MacBook Pro, Apple Inc., 27.1
Thunderbolt Device: Thunderbolt 2 Dock, Other World Computing, Inc., 1, 25.1

That's most likely not related to BTT (BTT runs in user space and doesn't install any kernel extensions).
Unfortunately it's very hard to track down stuff like this. Sometimes it's a hardware issue, sometimes it's some kernel extension that is installed (however in your case I can only see VirtualBox, so if that is up-to-date it's probably not caused by it)

Hi Andreas, and Elliott.

So I'm a longterm BTT worshipper, but I've only had a MacBook Pro with Touch Bar since March. It does seem that if BTT is running and the machine is left to sleep and particularly if the power supply is interrupted (disconnected/reconnected) in any way, the machine will panic in just the way described as Elliott.

I've been trying to troubleshoot this ever since getting the Mac, Apple have found it as difficult as I have to pin down but of course, as it doesn't occur with no third party software running, they don't see it as a hardware issue.

When BTT 3 came out, I was hoping the issue might go away, no luck. The MacBook Pro Supplemental Update came out this week and I was really hoping that, as it was over 1GB and focused on the T2 chip, that maybe this issue would get fixed. The only way I can be sure that I won't come back to a panicked, rebooted Mac is to quit BTT before sleeping it. That surely can't be right.

Now, I don't think this is a problem with BetterTouchTool per se. However at this point I find it undeniable that perhaps due to the way that BTT uses the Touch Bar, or simply the fact that the Touch Bar is doing way more than just sitting there totally unused (as I presume it does on every person's machine that doesn't have BTT), it's causing some flaw in the Touch Bar implementation/hardware to be symptomatic.

However, is there any chance you would take another look at this for us, Andreas? Do you use BTT with a Touch Bar enabled 2018+ MacBook Pro? If there are any troubleshooting steps you would like me to take or any data you would find it easier to look at (even the Panic logs, when related to the T2 'iBridge') chip, are totally unreadable for me)

Yours so very upset about this whole thing,

Chris

1 Like

I also have been experiencing sleep-wake failures (MacBook Pro spontaneously reboots) and BTT implicated in the panic report. Need to quit BTT before sleep to avoid. Very inconvenient as find BTT very useful.

1 Like

sorry, there is not much I can do here. This is most definitely a hardware or driver issue ;-(

However it may well be that some function in BTT could access parts of the faulty hardware/driver that could lead to this, but without having one of the faulty machines it's pretty much impossible for me to reproduce this in order to add a workaround. There are many people on the internet (apple forums) with the same ibridge issues, that are not using BTT at all.

Is it not possible that BTT could alter the way it accesses the Touch Bar in such a way as to avoid the issue? Do you have options when accessing the TB - are there any troubleshooting steps to try in this regard? But of course, if you don't have a T2-equipped Touch Bar Mac to test with, there's not much hope of this.

I'm tempted to install the Catalina DP but I'm sure that would have worse reliability if anything. I was just so disappointed when the panics continued to occur after the Supplemental Update - because whatever they say publicly Apple are most definitely aware of the situation.

Andreas, is there anything we can take back when trying to get support for this issue? I've wanted to say, "there's no way that any app should be able to cause kernel panics excepting a faulty driver or hardware" but wasn't 100% sure of this. But that's true, isn't it? I understand you feel this is both outside of your scope of support responsibilites and capabilities, but, as someone with obviously greater knowledge of the Touch Bar and how it integrates with the rest of the system, I know I would appreciate any help you can give us in diagnosing and/or getting support for the issue. (If I had the money I would send you a Touch Bar MBP pronto, but I'm in debt for mine already, which stings doubly as I feel like it's a lemon)

Unfortunately there is only one way to access the TouchBar. I do own multiple T2 Macs but even among the many BTT users there are maybe 20 with kernel panics, I would really need one of these faulty machines but even then it’s unlikely I would be able to add a workaround ;-(

Best bet would be to get it replaced by Apple (maybe due to a faulty keyboard? They replace the complete bottom part for keyboard repairs)

I didn't consider that you'd obviously have analytics. So it sounds like what you're saying is that there are loads of people with the exact same Mac who aren't experiencing the issue, which does suggest to me that it is in fact a hardware fault. OK, so that's something. Anything fixable is good news. Genius Bar tomorrow then. Thanks Andreas