javaandroid-studioubuntusegmentation-faultjava-11

Fatal error: SIGSEGV everytime I launch Android studio


When I try to launch android studio, I have this error :

#
#  SIGSEGV (0xb) at pc=0x00007f69987bd512, pid=9119, tid=9160
#
# JRE version: OpenJDK Runtime Environment (11.0.10) (build 11.0.10+0-b96-7249189)
# Java VM: OpenJDK 64-Bit Server VM (11.0.10+0-b96-7249189, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x457512]  metaspace::BlockFreelist::get_block(unsigned long)+0x1a2
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/tiany/core.9119)
#
# An error report file with more information is saved as:
# /root/java_error_in_studio_9119.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
Aborted (core dumped)

Can anyone help me please? PS: Im' using openJDK11 on Ubuntu 20.04.2 lts and it gives the same error sometimes when I try to compile a Java code. Thanks in advance

---------------  S U M M A R Y ------------

Command Line: -Xms256m -Xmx1280m -XX:ReservedCodeCacheSize=512m -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:CICompilerCount=2 -Dsun.io.useCanonCaches=false -Djdk.http.auth.tunneling.disabledSchemes="" -Djdk.attach.allowAttachSelf=true -Djdk.module.illegalAccess.silent=true -Dkotlinx.coroutines.debug=off -Djna.nosys=true -Djna.boot.library.path= -Didea.vendor.name=Google -Dsun.tools.attach.tmp.only=true -XX:ErrorFile=/root/java_error_in_studio_%p.log -XX:HeapDumpPath=/root/java_error_in_studio_.hprof -Didea.vendor.name=Google -Didea.paths.selector=AndroidStudio2020.3 -Djb.vmOptionsFile=/usr/local/android-studio/bin/studio64.vmoptions -Didea.platform.prefix=AndroidStudio -Didea.jre.check=true com.intellij.idea.Main

Host: Intel(R) Core(TM) i5 CPU       M 520  @ 2.40GHz, 4 cores, 3G, Ubuntu 20.04.3 LTS
Time: Mon Sep 27 12:35:42 2021 MDT elapsed time: 3.271945 seconds (0d 0h 0m 3s)

Current thread (0x000000000261e800):  JavaThread "ApplicationImpl pooled thread 6" [_thread_in_vm, id=9160, stack(0x00007f68fc023000,0x00007f68fc124000)]

Stack: [0x00007f68fc023000,0x00007f68fc124000],  sp=0x00007f68fc11f4b0,  free space=1009k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x457512]  metaspace::BlockFreelist::get_block(unsigned long)+0x1a2
V  [libjvm.so+0xb379aa]  metaspace::SpaceManager::allocate(unsigned long)+0x8a
V  [libjvm.so+0xa1ab75]  Metaspace::allocate(ClassLoaderData*, unsigned long, MetaspaceObj::Type, Thread*)+0x75
V  [libjvm.so+0x5e40c7]  ConstantPool::allocate(ClassLoaderData*, int, Thread*)+0x87
V  [libjvm.so+0x5570c5]  ClassFileParser::parse_stream(ClassFileStream const*, Thread*)+0x575
V  [libjvm.so+0x556b10]  ClassFileParser::ClassFileParser(ClassFileStream*, Symbol*, ClassLoaderData*, Handle, InstanceKlass const*, GrowableArray<Handle>*, ClassFileParser::Publicity, Thread*)+0x290
V  [libjvm.so+0x8fce74]  KlassFactory::create_from_stream(ClassFileStream*, Symbol*, ClassLoaderData*, Handle, InstanceKlass const*, GrowableArray<Handle>*, Thread*)+0xb4
V  [libjvm.so+0xb9bfc1]  SystemDictionary::resolve_from_stream(Symbol*, Handle, Handle, ClassFileStream*, Thread*)+0x221
V  [libjvm.so+0x802567]  jvm_define_class_common(JNIEnv_*, char const*, _jobject*, signed char const*, int, _jobject*, char const*, Thread*)+0x2f7
V  [libjvm.so+0x80272b]  JVM_DefineClassWithSource+0x11b
C  [libjava.so+0xcd4e]  Java_java_lang_ClassLoader_defineClass1+0x1be
J 1391  java.lang.ClassLoader.defineClass1(Ljava/lang/ClassLoader;Ljava/lang/String;[BIILjava/security/ProtectionDomain;Ljava/lang/String;)Ljava/lang/Class; java.base@11.0.10 (0 bytes) @ 0x00007f697ffdf0ea [0x00007f697ffdefc0+0x000000000000012a]
J 2368 c1 java.lang.ClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class; java.base@11.0.10 (43 bytes) @ 0x00007f6970686f24 [0x00007f6970686e00+0x0000000000000124]
J 1913 c1 com.intellij.util.lang.UrlClassLoader._defineClass(Ljava/lang/String;[B)Ljava/lang/Class; (10 bytes) @ 0x00007f69705baaac [0x00007f69705baa40+0x000000000000006c]
J 2449 c1 com.intellij.util.lang.UrlClassLoader.defineClass(Ljava/lang/String;Lcom/intellij/util/lang/Resource;)Ljava/lang/Class; (148 bytes) @ 0x00007f69706b7374 [0x00007f69706b7020+0x0000000000000354]
J 1895 c1 com.intellij.util.lang.UrlClassLoader._findClass(Ljava/lang/String;)Ljava/lang/Class; (59 bytes) @ 0x00007f69705b5594 [0x00007f69705b5340+0x0000000000000254]
J 1894 c1 com.intellij.util.lang.UrlClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; (21 bytes) @ 0x00007f69705b4ec4 [0x00007f69705b4e60+0x0000000000000064]
J 1112 c1 java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; java.base@11.0.10 (122 bytes) @ 0x00007f6970439b2c [0x00007f6970439880+0x00000000000002ac]
J 755 c1 java.lang.ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class; java.base@11.0.10 (7 bytes) @ 0x00007f697036353c [0x00007f6970363440+0x00000000000000fc]
v  ~StubRoutines::call_stub

Stack slot to memory mapping:

stack at sp + 0 slots: 0x00007f6994387480 points into unknown readable memory: 0x00007f690c0dc201 | 01 c2 0d 0c 69 7f 00 00

stack at sp + 1 slots: 0x00007f6994391190 points into unknown readable memory: 0x00007f699438e830 | 30 e8 38 94 69 7f 00 00

stack at sp + 2 slots: 0x0000000000000384 is an unknown value

stack at sp + 3 slots: 0x00007f6994306870 points into unknown readable memory: 0x00007f6994387480 | 80 74 38 94 69 7f 00 00

stack at sp + 4 slots: 0x00007f68fc11f510 is pointing into the stack for thread: 0x000000000261e800

stack at sp + 5 slots: 0x00007f6998e9d9aa: <offset 0x0000000000b379aa> in /usr/local/android-studio/jre/lib/server/libjvm.so at 0x00007f6998366000

stack at sp + 6 slots: 0x00007f6994306840 points into unknown readable memory: 0x00007f6900000000 | 00 00 00 00 69 7f 00 00

stack at sp + 7 slots: 0x0 is NULL


Solution

  • It turned out to be a RAM issue. After replacing the faulty memory modules, everything is now functioning correctly. Thank you all for your assistance and suggestions!