请教 Android Studio 将 macOS 系统搞崩怎么解决?

2020-03-03 18:54:46 +08:00
 loulijun

最近遇到个问题,每次用 Android studio 切换工程后,直接将 mac 的系统搞重启,再次打开 Android studio 依旧可以把系统搞重启,死循环。 尝试过的方法

  1. 升级 macOS 系统,从 Mojava 升级到 Catalina 无效(两个版本都有这个问题)
  2. Android studio 3.5 和 3.6 版本均无效
  3. invalide cache 无效 4.在 studio.vmoptions 配置 -Dsun.font.layoutengine=icu 无效

看错误日志像是 openjdk 的问题,但是具体看不懂,而且 Android studio 3.6 版本找不到配置 jdk 的地方了,求大佬指教

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x000000010487c270, pid=84560, tid=0x0000000000004203

JRE version: OpenJDK Runtime Environment (8.0_212) (build 1.8.0_212-release-1586-b4-5784211)

Java VM: OpenJDK 64-Bit Server VM (25.212-b4-5784211 mixed mode bsd-amd64 compressed oops)

Problematic frame:

V [libjvm.dylib+0x27c270] CodeHeap::search_freelist(unsigned long, bool)+0x40

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

If you would like to submit a bug report, please visit:

http://bugreport.java.com/bugreport/crash.jsp

--------------- T H R E A D ---------------

Current thread (0x00007f9b0500c800): JavaThread "C1 CompilerThread3" daemon [_thread_in_vm, id=16899, stack(0x000070000f65a000,0x000070000f75a000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0xffffffffffffffff

Registers: RAX=0x000000010f4384c0, RBX=0xffffffffffffffff, RCX=0xffffffffffffffff, RDX=0x0000000000000000 RSP=0x000070000f759498, RBP=0x000070000f7594c0, RSI=0x000000000000000d, RDI=0x000000000007d000 R8 =0x000000010f437b00, R9 =0x000000011d80e000, R10=0xffffffffffffffff, R11=0x000000010f437b00 R12=0x000000010f4384c0, R13=0xffffffffffffffff, R14=0xffffffffffffffff, R15=0x000000010f4384c0 RIP=0x000000010487c270, EFLAGS=0x0000000000010286, ERR=0x0000000000000004 TRAPNO=0x000000000000000e

Top of Stack: (sp=0x000070000f759498) 0x000070000f759498: 000000000000000d 0000000000000000 0x000070000f7594a8: 0000000104dfb440 00007f9b03e000c0 0x000070000f7594b8: 0000000000000000 000070000f7594f0 0x000070000f7594c8: 000000010487c163 0000000000000010 0x000070000f7594d8: 00000000000002f8 0000000000000000 0x000070000f7594e8: 00000000000002f8 000070000f759530 0x000070000f7594f8: 00000001047864c6 0000000000000010 0x000070000f759508: 0000000000000030 00000000000002f8 0x000070000f759518: 0000000000000000 00000000000002b0 0x000070000f759528: 0000000000000000 000070000f7595f0 0x000070000f759538: 0000000104a38b2f 0000000126578180 0x000070000f759548: 000070000f7595f0 0000000000000064 0x000070000f759558: 0000000000000000 000070000f759590 0x000070000f759568: 00000001047a8bc8 000000000000000c 0x000070000f759578: 000070000f759688 0000000000000020 0x000070000f759588: 000070000f759950 00007f9b03e06460 0x000070000f759598: 0000000126578180 00007f9b0500c800 0x000070000f7595a8: 00007f9b03f00bd0 000070000f759bb0 0x000070000f7595b8: 000070000f759bb0 0000674cffffffff 0x000070000f7595c8: 0000000126578180 000070000f759bb0 0x000070000f7595d8: 00007f9b03c22e90 000070000f759bb0 0x000070000f7595e8: 000070000f759918 000070000f7596f0 0x000070000f7595f8: 000000010474b13a 00007f9b04c98f50 0x000070000f759608: 000070000f759970 0000000000000008 0x000070000f759618: 00007f9b04c98f00 000070000f759918 0x000070000f759628: 000070000f759930 00007f9b03c22e90 0x000070000f759638: 0000000000000002 0000000126578180 0x000070000f759648: 000070000f7598a8 000070000f7598a8 0x000070000f759658: 0000000000000000 000070000f7598a8 0x000070000f759668: 00007f9b0500c800 00007f9b03f02350 0x000070000f759678: 00007f9b0500c800 000070000f759950 0x000070000f759688: 0000000126578180 00007f9b0500c800

Instructions: (pc=0x000000010487c270) 0x000000010487c250: 00 48 8d 05 e0 f1 57 00 48 8b 38 45 31 f6 48 89 0x000000010487c260: 4d c8 45 31 d2 45 31 c0 31 c0 4d 89 f7 49 89 ce 0x000000010487c270: 4c 8b 29 49 39 f5 73 0b 49 89 c4 4d 89 c3 4c 89 0x000000010487c280: d3 eb 46 48 85 c0 0f 95 c1 4d 39 ea 0f 96 c3 4d

Register to memory mapping:

RAX=0x000000010f4384c0 is an unknown value RBX=0xffffffffffffffff is an unknown value RCX=0xffffffffffffffff is an unknown value RDX=0x0000000000000000 is an unknown value RSP=0x000070000f759498 is pointing into the stack for thread: 0x00007f9b0500c800 RBP=0x000070000f7594c0 is pointing into the stack for thread: 0x00007f9b0500c800 RSI=0x000000000000000d is an unknown value RDI=0x000000000007d000 is an unknown value R8 =0x000000010f437b00 is an unknown value R9 =0x000000011d80e000 is an unknown value R10=0xffffffffffffffff is an unknown value R11=0x000000010f437b00 is an unknown value R12=0x000000010f4384c0 is an unknown value R13=0xffffffffffffffff is an unknown value R14=0xffffffffffffffff is an unknown value R15=0x000000010f4384c0 is an unknown value

Stack: [0x000070000f65a000,0x000070000f75a000], sp=0x000070000f759498, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.dylib+0x27c270] CodeHeap::search_freelist(unsigned long, bool)+0x40 V [libjvm.dylib+0x27c163] CodeHeap::allocate(unsigned long, bool)+0x2d V [libjvm.dylib+0x1864c6] CodeCache::allocate(int, bool)+0x64 V [libjvm.dylib+0x438b2f] nmethod::new_nmethod(methodHandle, int, int, CodeOffsets*, int, DebugInformationRecorder*, Dependencies*, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, int)+0x195 V [libjvm.dylib+0x14b13a] ciEnv::register_method(ciMethod*, int, CodeOffsets*, int, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, int, bool, bool, RTMState)+0x368 V [libjvm.dylib+0xd4b11] Compilation::install_code(int)+0xc1 V [libjvm.dylib+0xd4ba0] Compilation::compile_method()+0x7c V [libjvm.dylib+0xd4d73] Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*)+0x14f V [libjvm.dylib+0xd585f] Compiler::compile_method(ciEnv*, ciMethod*, int)+0x81 V [libjvm.dylib+0x1a1daa] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x634 V [libjvm.dylib+0x1a12ba] CompileBroker::compiler_thread_loop()+0x268 V [libjvm.dylib+0x52321e] JavaThread::thread_main_inner()+0x82 V [libjvm.dylib+0x5230e3] JavaThread::run()+0x199 V [libjvm.dylib+0x4562e3] java_start(Thread*)+0xfa C [libsystem_pthread.dylib+0x5e65] _pthread_start+0x94 C [libsystem_pthread.dylib+0x183b] thread_start+0xf C 0x0000000000000000

Current CompileTask: C1: 139730 26444 2 com.android.tools.r8.ir.code.InstanceOf::asInstanceOf (2 bytes)

--------------- P R O C E S S ---------------

Java Threads: ( => current thread ) 0x00007f9b08c0c800 JavaThread "ForkJoinPool.commonPool-worker-0" daemon [_thread_in_Java, id=49155, stack(0x0000700013bd2000,0x0000700013cd2000)] 0x00007f9b08483800 JavaThread "Worker Daemon Execution Thread 5" [_thread_blocked, id=48643, stack(0x0000700013acf000,0x0000700013bcf000)] 0x00007f9b07a11000 JavaThread "Worker Daemon Execution Thread 4" [_thread_blocked, id=78083, stack(0x00007000139cc000,0x0000700013acc000)]

...

0x000000010d880000 /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/libnet.dylib 0x000000010d979000 /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/libnio.dylib 0x00000001035e3000 /Users/loulijun/.gradle/native/25/osx-amd64/libnative-platform.dylib 0x000000010d993000 /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/libmanagement.dylib

VM Arguments: jvm_args: -Xmx1536m -Dfile.encoding=UTF-8 -Duser.country=CN -Duser.language=zh -Duser.variant java_command: org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.6 java_class_path (initial): /Users/loulijun/.gradle/wrapper/dists/gradle-4.6-all/bcst21l2brirad8k2ben1letg/gradle-4.6/lib/gradle-launcher-4.6.jar Launcher Type: SUN_STANDARD

Environment Variables: PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Users/loulijun/Library/Android/sdk/platform-tools:/Users/loulijun/Library/Android/sdk/tools:/Users/loulijun/Library/Android/sdk/build-tools/28.0.3:/Users/loulijun/Library/gradle/bin:/Users/loulijun/application/ndk/ SHELL=/bin/zsh

Signal Handlers: SIGSEGV: [libjvm.dylib+0x5609d5], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_ONSTACK|SA_RESTART|SA_SIGINFO SIGBUS: [libjvm.dylib+0x5609d5], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO SIGFPE: [libjvm.dylib+0x458695], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO SIGPIPE: [libjvm.dylib+0x458695], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO SIGXFSZ: [libjvm.dylib+0x458695], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO SIGILL: [libjvm.dylib+0x458695], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none SIGUSR2: [libjvm.dylib+0x458f94], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO SIGHUP: [libjvm.dylib+0x4571b9], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO SIGINT: [libjvm.dylib+0x4571b9], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO SIGTERM: [libjvm.dylib+0x4571b9], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO SIGQUIT: [libjvm.dylib+0x4571b9], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO

--------------- S Y S T E M ---------------

OS:Bsduname:Darwin 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64 rlimit: STACK 8192k, CORE 0k, NPROC 2784, NOFILE 10240, AS infinity load average:20.76 6.70 3.73

CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 94 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, rtm, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx

Memory: 4k page, physical 16777216k(4034028k free)

/proc/meminfo:

vm_info: OpenJDK 64-Bit Server VM (25.212-b4-5784211) for bsd-amd64 JRE (1.8.0_212-release-1586-b4-5784211), built by "android-build" with gcc 4.2.1 Compatible Android (5657785 based on r353983d) Clang 9.0.4 ( https://android.googlesource.com/toolchain/llvm-project 2a90cc9d899e6fe6dcf0da193244b25f75735c7b)

9831 次点击
所在节点    Android
8 条回复
wnpllrzodiac
2020-03-03 19:41:04 +08:00
google 和苹果有仇?
AyaLee
2020-03-03 19:57:38 +08:00
@wnpllrzodiac 笑死
WenhaoWu
2020-03-03 20:18:14 +08:00
哪里下的 Android Studio? 不行的话卸干净了从 brew cask 装吧 : `brew cask install android-studio`
christin
2020-03-03 21:36:24 +08:00
我的 mbp2015 Catalina 装最新版没问题
nicevar
2020-03-03 22:02:01 +08:00
更换 jre/jdk 试试,不行再检查一下磁盘
loulijun
2020-03-04 09:52:04 +08:00
@WenhaoWu google 官方下的 studio,试过卸载重装不行,而且 3.6 版本的没办法更换 jdk 了,比较蛋疼
xingda920813
2020-03-05 02:30:50 +08:00
删除 .app 目录下的 /jre 子目录, 然后配置一个自己的 JAVA_HOME (比如 Java 11), 这样应该可以让 IDEA 强制使用它.
xingda920813
2020-03-05 02:33:05 +08:00
/Applications/Android Studio.app/Contents/jre

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/649517

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX