intel / haxm

Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
BSD 3-Clause "New" or "Revised" License
3.22k stars 873 forks source link

OS X 10.11.5 - starting Android Emulator using HAXM reboots Mac #150

Closed toby5box closed 5 years ago

toby5box commented 5 years ago

Installed latest HAXM extension. Starting emulator causes spontaneous reboot.

$ kextstat | grep intel
  116    0 0xffffff7f8282c000 0x28000    0x28000    com.intel.kext.intelhaxm (7.3.2) 58DFBE80-E54A-3EFE-B38A-215C5ED8E828 <7 5 4 3 1>

Android's troubleshooting notes recommend using an older HAXM version: https://developer.android.com/studio/run/emulator-troubleshooting#haxm_on_older_unsupported_versions_of_mac_os But these are not accessible online; releases go back only to 7.0.0 https://github.com/intel/haxm/releases

  1. What version of HAXM is recommended for OS X 10.11.5 on older Mac Pro Xeon hardware?
  2. How can we download older releases?
raphaelning commented 5 years ago

Thanks for the report. HAXM 6.x releases are archived here. But Google's troubleshooting advice is not really applicable here, because your macOS version is higher than 10.9.

The spontaneous reboot is the result of a macOS kernel panic, and you can find the panic report in /Library/Logs/DiagnosticReports/. Could you share it with us?

Please also provide your Android Emulator version number. You can see it in SDK Manager in Android Studio, or by running emulator -version from Terminal.

toby5box commented 5 years ago

Thanks for the archive link.

Emulator is version 28.0.22

Panic log:

Sat Jan  5 18:14:50 2019

*** Panic Report ***
panic(cpu 2 caller 0xffffff8007fce5fa): Kernel trap at 0xffffff7f8a562042, type 13=general protection, registers:
CR0: 0x0000000080010033, CR2: 0x0000000115bfa001, CR3: 0x00000001d6c8e000, CR4: 0x0000000000002660
RAX: 0x0000000020100800, RBX: 0x0000000000000002, RCX: 0x00000000c0000103, RDX: 0x0000000000000000
RSP: 0xffffff920d3c39c8, RBP: 0xffffff920d3c3a20, RSI: 0x000000000000001b, RDI: 0x00000000c0000103
R8:  0xffffff802a89f000, R9:  0xffffff920d3c3a10, R10: 0xffffff920d3c3b08, R11: 0x0000000000000206
R12: 0xffffff80371f2800, R13: 0xffffff7f8a572fc0, R14: 0xffffff7f8a573180, R15: 0xffffff8032ad4a00
RFL: 0x0000000000010046, RIP: 0xffffff7f8a562042, CS:  0x0000000000000008, SS:  0x0000000000000010
Fault CR2: 0x0000000115bfa001, Error code: 0x0000000000000000, Fault CPU: 0x2, PL: 0

Backtrace (CPU 2), Frame : Return Address
0xffffff81e61f5df0 : 0xffffff8007edab12 
0xffffff81e61f5e70 : 0xffffff8007fce5fa 
0xffffff81e61f6050 : 0xffffff8007fec463 
0xffffff81e61f6070 : 0xffffff7f8a562042 
0xffffff920d3c3a20 : 0xffffff7f8a54e372 
0xffffff920d3c3a60 : 0xffffff7f8a54e67f 
0xffffff920d3c3ac0 : 0xffffff7f8a552d6e 
0xffffff920d3c3af0 : 0xffffff7f8a54d76e 
0xffffff920d3c3b60 : 0xffffff80081391f2 
0xffffff920d3c3ba0 : 0xffffff800812723e 
0xffffff920d3c3c30 : 0xffffff800811c26a 
0xffffff920d3c3e20 : 0xffffff80083864db 
0xffffff920d3c3e50 : 0xffffff80083c7ebd 
0xffffff920d3c3f60 : 0xffffff80084286a1 
0xffffff920d3c3fb0 : 0xffffff8007fecc66 
      Kernel Extensions in backtrace:
         com.intel.kext.intelhaxm(7.3.2)[58DFBE80-E54A-3EFE-B38A-215C5ED8E828]@0xffffff7f8a54c000->0xffffff7f8a581fff

BSD process name corresponding to current thread: qemu-system-i386

Mac OS version:
15F34

Kernel version:
Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64
Kernel UUID: 7E7B0822-D2DE-3B39-A7A5-77B40A668BC6
Kernel slide:     0x0000000007c00000
Kernel text base: 0xffffff8007e00000
__HIB  text base: 0xffffff8007d00000
System model name: MacPro2,1 (Mac-F42C88C8)

System uptime in nanoseconds: 85789424003099
last loaded kext at 85680421891059: com.intel.kext.intelhaxm    7.3.2 (addr 0xffffff7f8a54c000, size 221184)
last unloaded kext at 84125409945275: com.intel.kext.intelhaxm  7.3.2 (addr 0xffffff7f8a4a5000, size 163840)
loaded kexts:
com.intel.kext.intelhaxm    7.3.2
org.virtualbox.kext.VBoxNetAdp  5.2.18
org.virtualbox.kext.VBoxNetFlt  5.2.18
org.virtualbox.kext.VBoxUSB 5.2.18
org.virtualbox.kext.VBoxDrv 5.2.18
com.nvidia.CUDA 1.1.0
com.apple.driver.AudioAUUC  1.70
com.apple.filesystems.autofs    3.0
com.apple.driver.AppleOSXWatchdog   1
com.apple.driver.pmtelemetry    1
com.apple.driver.AppleUpstreamUserClient    3.6.1
com.apple.driver.AppleHDA   274.9
com.apple.iokit.IOUserEthernet  1.0.1
com.apple.driver.AppleMCCSC

You will notice that the VirtualBox extensions are there. I shut down VM's before running this test, but maybe there are other steps I need to take? Hopefully I don't need to unload all those extensions in order to use HAXM?

Also this machine is using a patched in EFI64 (hardware is EFI32). Could this be implicated?

Do you know why Android Emulator cannot run with Apple HVM?

raphaelning commented 5 years ago

Thanks. I'm pretty sure this is a duplicate of #101, because you have a 2007 Mac Pro with two Xeon X5365 CPUs, which probably lack the RDTSCP feature. For now, please downgrade to HAXM 7.2.0. You can read that thread for more information.

By Apple HVM I think you mean macOS Hypervisor.framework. It requires a CPU feature known as EPT, and your Xeon doesn't support that either.

toby5box commented 5 years ago

Thanks for the info! I'll try 7.2.0.

Yes, I meant HVF.

raycardillo commented 5 years ago

I'm having this same problem on my iMac after installing Android Studio, HAXM 7.3.2 and trying to run the emulator. Instant reboot with a kernel panic. Here is my system info and kernel panic, and I'll try 7.3.0 and 7.2.0 and report results, but sure would be nice for a proper fix. This iMac is a great little inexpensive workhorse for indie developers. :)

SYSTEM INFO

macOS High Sierra (10.13.6)
iMac (21.5 inch, Late 2009)
Processor 3.06 GHz Intel Core 2 Duo
Graphics NVIDIA GeForce 9400 256MB

EMULATOR VERSION

Android emulator version 28.0.22.0 (build_id 5194135) (CL:0514023f0a9dfa2f6382c333f2fb30e3a17fd074)

KERNEL PANIC

Fri Jan 11 02:03:28 2019

*** Panic Report ***
panic(cpu 0 caller 0xffffff800d788f9f): Kernel trap at 0xffffff7f90731042, type 13=general protection, registers:
CR0: 0x0000000080010033, CR2: 0x000000011254a000, CR3: 0x0000000345cae000, CR4: 0x00000000000026e0
RAX: 0x0000000020100800, RBX: 0x0000000000000002, RCX: 0x00000000c0000103, RDX: 0x0000000000000000
RSP: 0xffffff91fb47b9b8, RBP: 0xffffff91fb47ba10, RSI: 0x000000000000001b, RDI: 0x00000000c0000103
R8:  0xffffff803d8d6db0, R9:  0xffffff800de8a5b0, R10: 0xffffff91fb47ba68, R11: 0xffffff7f8e320810
R12: 0xffffff8034a63800, R13: 0xffffff7f90741fc0, R14: 0xffffff7f90742180, R15: 0xffffff802c0e6400
RFL: 0x0000000000010046, RIP: 0xffffff7f90731042, CS:  0x0000000000000008, SS:  0x0000000000000010
Fault CR2: 0x000000011254a000, Error code: 0x0000000000000000, Fault CPU: 0x0, PL: 0, VF: 0

Backtrace (CPU 0), Frame : Return Address
0xffffff800d54c290 : 0xffffff800d66e1c6
0xffffff800d54c2e0 : 0xffffff800d796aa4
0xffffff800d54c320 : 0xffffff800d788d74
0xffffff800d54c390 : 0xffffff800d6201e0
0xffffff800d54c3b0 : 0xffffff800d66dc3c
0xffffff800d54c4e0 : 0xffffff800d66d9fc
0xffffff800d54c540 : 0xffffff800d788f9f
0xffffff800d54c6b0 : 0xffffff800d6201e0
0xffffff800d54c6d0 : 0xffffff7f90731042
0xffffff91fb47ba10 : 0xffffff7f9071d372
0xffffff91fb47ba50 : 0xffffff7f9071d67f
0xffffff91fb47bab0 : 0xffffff7f90721d6e
0xffffff91fb47bae0 : 0xffffff7f9071c76e
0xffffff91fb47bb50 : 0xffffff800d8d86e1
0xffffff91fb47bb80 : 0xffffff800d8cdeef
0xffffff91fb47bc00 : 0xffffff800d8c07bb
0xffffff91fb47be00 : 0xffffff800daf7e23
0xffffff91fb47be30 : 0xffffff800db4877c
0xffffff91fb47bf40 : 0xffffff800dc041e8
0xffffff91fb47bfa0 : 0xffffff800d6209c6
      Kernel Extensions in backtrace:
         com.intel.kext.intelhaxm(7.3.2)[58DFBE80-E54A-3EFE-B38A-215C5ED8E828]@0xffffff7f9071b000->0xffffff7f90742fff

BSD process name corresponding to current thread: qemu-system-i386

Mac OS version:
17G4015

Kernel version:
Darwin Kernel Version 17.7.0: Fri Nov  2 20:43:16 PDT 2018; root:xnu-4570.71.17~1/RELEASE_X86_64
Kernel UUID: F39BC8AD-8981-3617-BF39-E68CAA3268D5
Kernel slide:     0x000000000d400000
Kernel text base: 0xffffff800d600000
__HIB  text base: 0xffffff800d500000
System model name: iMac10,1 (Mac-F2268CC8)

System uptime in nanoseconds: 74876873108250
last loaded kext at 74540151328499: com.intel.kext.intelhaxm    7.3.2 (addr 0xffffff7f9071b000, size 221184)
last unloaded kext at 74685149262742: com.apple.driver.usb.cdc  5.0.0 (addr 0xffffff7f90704000, size 28672)
...
...
raycardillo commented 5 years ago

Same problem with 7.3.0:

Fri Jan 11 13:19:30 2019

*** Panic Report ***
panic(cpu 1 caller 0xffffff8019988f9f): Kernel trap at 0xffffff7f9ca01102, type 13=general protection, registers:
CR0: 0x0000000080010033, CR2: 0x0000000119c29000, CR3: 0x00000001bf956000, CR4: 0x00000000000026e0
RAX: 0x0000000020100800, RBX: 0x0000000000000002, RCX: 0x00000000c0000103, RDX: 0x0000000000000000
RSP: 0xffffff92043539b8, RBP: 0xffffff9204353a10, RSI: 0x000000000000001b, RDI: 0x00000000c0000103
R8:  0xffffff8053d936d0, R9:  0xffffff801a08a5b0, R10: 0xffffff9204353a68, R11: 0xffffff7f9a58f810
R12: 0xffffff8054659800, R13: 0xffffff7f9ca11fc0, R14: 0xffffff7f9ca12180, R15: 0xffffff805829f600
RFL: 0x0000000000010046, RIP: 0xffffff7f9ca01102, CS:  0x0000000000000008, SS:  0x0000000000000010
Fault CR2: 0x0000000119c29000, Error code: 0x0000000000000000, Fault CPU: 0x1, PL: 0, VF: 0

Backtrace (CPU 1), Frame : Return Address
0xffffff801974ca90 : 0xffffff801986e1c6 
0xffffff801974cae0 : 0xffffff8019996aa4 
0xffffff801974cb20 : 0xffffff8019988d74 
0xffffff801974cb90 : 0xffffff80198201e0 
0xffffff801974cbb0 : 0xffffff801986dc3c 
0xffffff801974cce0 : 0xffffff801986d9fc 
0xffffff801974cd40 : 0xffffff8019988f9f 
0xffffff801974ceb0 : 0xffffff80198201e0 
0xffffff801974ced0 : 0xffffff7f9ca01102 
0xffffff9204353a10 : 0xffffff7f9c9ed442 
0xffffff9204353a50 : 0xffffff7f9c9ed752 
0xffffff9204353ab0 : 0xffffff7f9c9f1e3a 
0xffffff9204353ae0 : 0xffffff7f9c9ec83e 
0xffffff9204353b50 : 0xffffff8019ad86e1 
0xffffff9204353b80 : 0xffffff8019acdeef 
0xffffff9204353c00 : 0xffffff8019ac07bb 
0xffffff9204353e00 : 0xffffff8019cf7e23 
0xffffff9204353e30 : 0xffffff8019d4877c 
0xffffff9204353f40 : 0xffffff8019e041e8 
0xffffff9204353fa0 : 0xffffff80198209c6 
      Kernel Extensions in backtrace:
         com.intel.kext.intelhaxm(7.3)[65C423BE-0315-30BD-8DA8-CABFE8487E10]@0xffffff7f9c9eb000->0xffffff7f9ca12fff

BSD process name corresponding to current thread: qemu-system-i386

Mac OS version:
17G4015

Kernel version:
Darwin Kernel Version 17.7.0: Fri Nov  2 20:43:16 PDT 2018; root:xnu-4570.71.17~1/RELEASE_X86_64
Kernel UUID: F39BC8AD-8981-3617-BF39-E68CAA3268D5
Kernel slide:     0x0000000019600000
Kernel text base: 0xffffff8019800000
__HIB  text base: 0xffffff8019700000
System model name: iMac10,1 (Mac-F2268CC8)

System uptime in nanoseconds: 3366937681741
last loaded kext at 3111073399161: com.intel.kext.intelhaxm 7.3.0 (addr 0xffffff7f9c9eb000, size 221184)
last unloaded kext at 3254383115776: com.apple.driver.AppleXsanScheme   3 (addr 0xffffff7f9c8d8000, size 32768)
loaded kexts:
com.intel.kext.intelhaxm    7.3.0
raycardillo commented 5 years ago

Kernel panic resolved with HAXM 7.2.0 but the extremely slow performance makes it almost unusable (apparently because of the lack of features on Core 2 Duo that is needed for acceleration).

1:45 PM Emulator: Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.

At this point, it would have been better to just make it clear that it's not supported on this device. At least I understand the root cause now. 🤕

ipatch commented 5 years ago

Same issue here 🙋‍♂️, different hardware.

Running macOS 10.13.6 on an Intel 2013 MBP late model with Virtualbox 6.0 installed. Installed the haxm driver v7.3.2 for macOS from the releases page on this repo. Then tried to use v7.3.2 with QEMU V3.1.0 and the system kernel panics, ie. halts and then reboots. It's unfortunate because HVF with Windows 10 guests does not work well at all on macOS. 🤷‍♂️

kextstat | grep -i "haxm"
# Output
164    0 0xffffff7f83cf2000 0x28000    0x28000    com.intel.kext.intelhaxm (7.3.2) 58DFBE80-E54A-3EFE-B38A-215C5ED8E828 <7 5 4 3 1>
raphaelning commented 5 years ago

@ipatch Your issue is probably caused by a different bug. FYI, HAXM cannot boot Windows 10 guests at the moment, but there are people working on a fix:

https://github.com/intel/haxm/pull/152#issuecomment-453752510 https://github.com/intel/haxm/issues/118

So let's move further discussion to #118. Could you post your kernel panic report (especially the call stack) there?

GISS18 commented 5 years ago

MY MAC OS IS THE CAPITAN VERSION 10.11.6 AND ANDY WORKED BEFORE UPDATE. NOW GIVES ME AN ERROR: As a compliance measure this installer is deprecated and may no longer be used PLEASE HELP!

HaHoYou commented 5 years ago

See https://github.com/intel/haxm/wiki/Installation-Instructions-on-macOS#system-requirements, we updated Mac OS requirements since HAXM v7.5.1, because Mac update their sign tool. So either you may use Mac OS 10.12 or above, or use HAXM v7.4.1 or below.