MacBook Air crashes when plugging in Android devices

androidcrashmacusb

For the past few days, developing on an Android device has been a nightmare on my MacBook Air (mid-2013) model. Here's what happens:

  • I plug in an Android device (tested with 3 different devices and always the same outcome)
  • I do some remote debugging for some time (like 10mins), everything goes great
  • Then suddenly adb devices doesn't show any device connected, like if the connection just dropped

If I try to unplug/plug the device again, then the laptop freezes for about 30s, shows the black screen error, then reboots. Here's the content of the crash report:

Anonymous UUID:       B18F4043-AA7B-6B39-22DB-A918088AC538


Thu Dec 22 16:34:25 2016


*** Panic Report ***
panic(cpu 2 caller 0xffffff80009bf2fe): Preemption level underflow, possible cause unlocking an unlocked mutex or spinlock
Backtrace (CPU 2), Frame : Return Address
0xffffff810a0f3c30 : 0xffffff80008d7b92 
0xffffff810a0f3cb0 : 0xffffff80009bf2fe 
0xffffff810a0f3cc0 : 0xffffff80009bf01f 
0xffffff810a0f3cd0 : 0xffffff8000e8869b 
0xffffff810a0f3d20 : 0xffffff8000e92180 
0xffffff810a0f3d70 : 0xffffff8000edc149 
0xffffff810a0f3de0 : 0xffffff8000994b81 
0xffffff810a0f3e30 : 0xffffff80008dc303 
0xffffff810a0f3e60 : 0xffffff80008bf938 
0xffffff810a0f3ea0 : 0xffffff80008cf6e5 
0xffffff810a0f3f10 : 0xffffff80009b625a 
0xffffff810a0f3fb0 : 0xffffff80009ea3c6 


BSD process name corresponding to current thread: Google Chrome


Mac OS version:
15G1212


Kernel version:
Darwin Kernel Version 15.6.0: Wed Nov  2 20:30:56 PDT 2016; root:xnu-3248.60.11.1.2~2/RELEASE_X86_64
Kernel UUID: 865631CA-FB7C-31CA-9B7F-5CBFF3C38E0C
Kernel slide:     0x0000000000600000
Kernel text base: 0xffffff8000800000
__HIB  text base: 0xffffff8000700000
System model name: MacBookAir6,2 (Mac-7DF21CB3ED6977E5)


System uptime in nanoseconds: 6951911967629
last loaded kext at 2936111219770: com.apple.driver.usb.cdc 5.0.0 (addr 0xffffff7f83389000, size 28672)
last unloaded kext at 1417282467047: com.apple.driver.usb.AppleUSBHostCompositeDevice 1.0.1 (addr 0xffffff7f83382000, size 28672)
loaded kexts:
net.tunnelblick.tun 4685.3
com.intel.kext.intelhaxm 6.0.5
com.apple.driver.AudioAUUC 1.70
com.apple.driver.ApplePlatformEnabler 2.6.0d0
com.apple.driver.AGPM 110.22.0
com.apple.driver.X86PlatformShim 1.0.0
com.apple.filesystems.autofs 3.0
com.apple.driver.AppleOSXWatchdog 1
com.apple.driver.AppleUpstreamUserClient 3.6.1
com.apple.driver.AppleHDA 274.12
com.apple.driver.AppleLPC 3.1
com.apple.driver.pmtelemetry 1
com.apple.iokit.IOUserEthernet 1.0.1
com.apple.iokit.IOBluetoothSerialManager 4.4.6f1
com.apple.Dont_Steal_Mac_OS_X 7.0.0
com.apple.driver.AppleIntelHD5000Graphics 10.1.4
com.apple.driver.AppleHV 1
com.apple.driver.AppleIntelSlowAdaptiveClocking 4.0.0
com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport 4.4.6f1
com.apple.driver.AppleThunderboltIP 3.0.8
com.apple.driver.AppleCameraInterface 5.46.0
com.apple.driver.AppleSMCLMU 208
com.apple.driver.AppleIntelFramebufferAzul 10.1.4
com.apple.driver.AppleBacklight 170.8.9
com.apple.driver.AppleMCCSControl 1.2.13
com.apple.driver.AppleUSBCardReader 3.7.1
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0
com.apple.BootCache 38
com.apple.driver.AppleTopCaseHIDEventDriver 86
com.apple.iokit.IOAHCIBlockStorage 2.8.5
com.apple.driver.AppleAHCIPort 3.1.8
com.apple.driver.AirPort.Brcm4360 1040.1.1a6
com.apple.driver.AppleRTC 2.0
com.apple.driver.AppleSmartBatteryManager 161.0.0
com.apple.driver.AppleACPIButtons 4.0
com.apple.driver.AppleHPET 1.8
com.apple.driver.AppleSMBIOS 2.1
com.apple.driver.AppleACPIEC 4.0
com.apple.driver.AppleAPIC 1.7
com.apple.nke.applicationfirewall 163
com.apple.security.quarantine 3
com.apple.security.TMSafetyNet 8
com.apple.driver.usb.cdc 5.0.0
com.apple.driver.usb.AppleUSBHostCompositeDevice 1.0.1
com.apple.kext.triggers 1.0
com.apple.driver.DspFuncLib 274.12
com.apple.kext.OSvKernDSPLib 525
com.apple.iokit.IOSurface 108.2.3
com.apple.driver.CoreCaptureResponder 1
com.apple.iokit.IOSlowAdaptiveClockingFamily 1.0.0
com.apple.iokit.IOBluetoothHostControllerUSBTransport 4.4.6f1
com.apple.iokit.IOBluetoothFamily 4.4.6f1
com.apple.driver.AppleHDAController 274.12
com.apple.iokit.IOHDAFamily 274.12
com.apple.iokit.IOAudioFamily 204.4
com.apple.vecLib.kext 1.2.0
com.apple.driver.AppleIntelLpssUARTCommon 2.0.60
com.apple.iokit.IOSerialFamily 11
com.apple.driver.X86PlatformPlugin 1.0.0
com.apple.driver.IOPlatformPluginFamily 6.0.0d7
com.apple.AppleGraphicsDeviceControl 3.12.9
com.apple.iokit.IOAcceleratorFamily2 205.11
com.apple.driver.AppleBacklightExpert 1.1.0
com.apple.iokit.IONDRVSupport 2.4.1
com.apple.driver.AppleSMC 3.1.9
com.apple.driver.AppleSMBusController 1.0.14d1
com.apple.iokit.IOGraphicsFamily 2.4.1
com.apple.iokit.IOSCSIBlockCommandsDevice 3.7.7
com.apple.iokit.IOUSBMassStorageDriver 1.0.0
com.apple.iokit.IOSCSIArchitectureModelFamily 3.7.7
com.apple.driver.usb.networking 5.0.0
com.apple.driver.usb.AppleUSBHub 1.0.1
com.apple.driver.CoreStorage 517.50.1
com.apple.driver.AppleMultitouchDriver 304.12
com.apple.driver.AppleHIDTransport 5
com.apple.driver.AppleHIDKeyboard 181
com.apple.driver.AppleHSSPIHIDDriver 43
com.apple.iokit.IOAHCIFamily 2.8.1
com.apple.driver.AppleThunderboltDPInAdapter 4.1.3
com.apple.driver.AppleThunderboltDPAdapterFamily 4.1.3
com.apple.driver.AppleThunderboltPCIDownAdapter 2.0.2
com.apple.driver.AppleThunderboltNHI 4.0.4
com.apple.iokit.IOThunderboltFamily 6.0.2
com.apple.iokit.IO80211Family 1110.26
com.apple.driver.mDNSOffloadUserClient 1.0.1b8
com.apple.iokit.IONetworkingFamily 3.2
com.apple.driver.corecapture 1.0.4
com.apple.driver.AppleHSSPISupport 43
com.apple.driver.AppleIntelLpssSpiController 2.0.60
com.apple.driver.AppleIntelLpssGspi 2.0.60
com.apple.driver.AppleIntelLpssDmac 2.0.60
com.apple.driver.usb.AppleUSBXHCIPCI 1.0.1
com.apple.driver.usb.AppleUSBXHCI 1.0.1
com.apple.iokit.IOUSBFamily 900.4.1
com.apple.iokit.IOUSBHostFamily 1.0.1
com.apple.driver.AppleUSBHostMergeProperties 1.0.1
com.apple.driver.AppleEFINVRAM 2.0
com.apple.driver.AppleEFIRuntime 2.0
com.apple.iokit.IOHIDFamily 2.0.0
com.apple.iokit.IOSMBusFamily 1.1
com.apple.security.sandbox 300.0
com.apple.kext.AppleMatch 1.0.0d1
com.apple.driver.AppleKeyStore 2
com.apple.driver.AppleMobileFileIntegrity 1.0.5
com.apple.driver.AppleCredentialManager 1.0
com.apple.driver.DiskImages 417.4
com.apple.iokit.IOStorageFamily 2.1
com.apple.iokit.IOReportFamily 31
com.apple.driver.AppleFDEKeyStore 28.30
com.apple.driver.AppleACPIPlatform 4.0
com.apple.iokit.IOPCIFamily 2.9
com.apple.iokit.IOACPIFamily 1.4
com.apple.kec.Libm 1
com.apple.kec.pthread 1
com.apple.kec.corecrypto 1.0
Model: MacBookAir6,2, BootROM MBA61.0099.B23, 2 processors, Intel Core i5, 1,3 GHz, 8 GB, SMC 2.13f15
Graphics: Intel HD Graphics 5000, Intel HD Graphics 5000, Built-In
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x02FE, -
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x02FE, -
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x117), Broadcom BCM43xx 1.0 (7.21.95.175.1a6)
Bluetooth: Version 4.4.6f1 17910, 3 services, 18 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SD0128F, 121,33 GB
USB Device: USB 3.0 Bus
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
USB Device: k100_6210
Thunderbolt Bus: MacBook Air, Apple Inc., 23.6

Best Answer

First suspects on any kernel panic are non-Apple kexts.
In this case

net.tunnelblick.tun 4685.3
com.intel.kext.intelhaxm 6.0.5

I'd figure out what those belong to, uninstall one at a time & re-test.