Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8315369

[JVMCI] failure to attach to a libgraal isolate during shutdown should not be fatal

    XMLWordPrintable

Details

    • b14

    Description

      <internal:core> core/errno.rb:48:in `handle': Too many open files - socket(2) (Errno::EMFILE)
      from /home/chaeubl/feature/graal/sdk/mxbuild/linux-amd64/GRAALVM_RUBY_JAVA21/graalvm-ruby-openjdk-21+35.1/languages/ruby/lib/truffle/socket/socket.rb:318:in `initialize'
      from -e:1:in `block in <main>'
      from <internal:core> core/kernel.rb:414:in `<unknown>'
      from <internal:core> core/kernel.rb:409:in `loop'
      from -e:1:in `<main>'
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (jvmciEnv.cpp:257), pid=138577, tid=138577
      # fatal error: Error attaching current thread (main) to JVMCI shared library JNI interface
      #
      # JRE version: OpenJDK Runtime Environment GraalVM CE 21-dev+35.1 (21.0+35) (build 21+35-jvmci-23.1-b14)
      # Java VM: OpenJDK 64-Bit Server VM GraalVM CE 21-dev+35.1 (21+35-jvmci-23.1-b14, mixed mode, sharing, tiered, jvmci, jvmci compiler, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xa2bfe8]
      #
      # Core dump will be written. Default location: core.138577 (may not exist)
      #
      # Can not save log file, dump to screen..
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (jvmciEnv.cpp:257), pid=138577, tid=138577
      # fatal error: Error attaching current thread (main) to JVMCI shared library JNI interface
      #
      # JRE version: OpenJDK Runtime Environment GraalVM CE 21-dev+35.1 (21.0+35) (build 21+35-jvmci-23.1-b14)
      # Java VM: OpenJDK 64-Bit Server VM GraalVM CE 21-dev+35.1 (21+35-jvmci-23.1-b14, mixed mode, sharing, tiered, jvmci, jvmci compiler, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xa2bfe8]
      #

      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xa2bfe8] JVMCIEnv::init_env_mode_runtime(JavaThread*, JNIEnv_*, bool)
      V [libjvm.so+0xa662b2] JVMCIRuntime::shutdown()
      V [libjvm.so+0x9d7c5c] JVMCI::shutdown(JavaThread*)
      V [libjvm.so+0x8dbba0] before_exit(JavaThread*, bool)
      V [libjvm.so+0x9ad44c] JVM_Halt+0x6c
      j java.lang.Shutdown.halt0(I)V+0 java.base@21
      j java.lang.Shutdown.halt(I)V+7 java.base@21
      j java.lang.Shutdown.exit(I)V+16 java.base@21
      j java.lang.Runtime.exit(I)V+14 java.base@21
      j java.lang.System.exit(I)V+4 java.base@21
      j org.truffleruby.launcher.RubyLauncher.launch(Lorg/graalvm/polyglot/Context$Builder;)V+25 org.graalvm.ruby.launcher
      j org.graalvm.launcher.AbstractLanguageLauncher.launch(Ljava/util/List;Ljava/util/Map;Z)V+212 org.graalvm.launcher
      j org.graalvm.launcher.AbstractLanguageLauncher.launch([Ljava/lang/String;)V+14 org.graalvm.launcher
      j org.graalvm.launcher.AbstractLanguageLauncher.runLauncher([[BIJZ)V+123 org.graalvm.launcher
      v ~StubRoutines::call_stub 0x00007f9d08e76cc6
      V [libjvm.so+0x8dd7e5]
      V [libjvm.so+0x983da0]
      V [libjvm.so+0x986817]
      C [ruby+0x4783a]
      C [ruby+0x45092]
      C [ruby+0x449f1]

      HotSpot wants to do an orderly shutdown of all libgraal isolates during VM shutdown so that libgraal shutdown hooks are run, metric summaries are dumped etc. To do this, the shutdown thread needs to attach to each libgraal isolate and run some shutdown code in the isolate. In the case where the VM process has run out of file descriptors, attaching may fail on Linux. It needs to determine the stack boundaries which involves calling pthread_getattr_np which, in turn, may try to open files such as /proc/self/maps.

      Attachments

        Issue Links

          Activity

            People

              dnsimon Douglas Simon
              dnsimon Douglas Simon
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: