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

mvm-on: hang on linux-i586 waiting on an exit code in handle_exit()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2 P2
    • mvm-6u18
    • mvm-6u18
    • hotspot
    • None
    • generic
    • linux

      Running jdk6u18-hs16 latest MVM code. Observing a hang on linux-i586,
      running a simple test...

      1) start MServer
      2) launch JDK demo app1 and exit (64 times)
         launch JDK demo app2 and exit (64 times)
         ...
         launch JDK demo appN and exit (64 times)

      The hang typically happens on the *first* launch of the next demo app. From gdb, it sure looks like the MServer is hung up waiting on an exit code. The exit type is sent, but no exit code is ever provided. A likely race condition somewhere. Easily reproducible.


      (gdb) where
      #0 0xb76e3422 in __kernel_vsyscall ()
      #1 0xb7622aab in poll () from /lib/tls/i686/cmov/libc.so.6
      #2 0x0804fa4b in read_bytes ()
      #3 0x0804fad0 in read_int ()
      #4 0x0804f6b8 in handle_exit ()
      #5 0x0804f883 in jlogin ()
      #6 0x08049ae5 in main ()



      From read_bytes() in j2se/src/solaris/bin/jlogin_md.c

      static void read_bytes(MServerConnection cHandle, void *buf, int len) {
          struct pollfd pollfd;
          pollfd.fd = cHandle;
          pollfd.events = POLLIN;
          while (len > 0) {
      int rc = poll(&pollfd, 1, -1); <----------- stuck here, I believe
      if (rc < 0 && errno == EINTR) {
                  continue;
      }
              int x = read(cHandle, buf, len);
      if (x == 0) {
                  // Socket was closed. The MServer likely died unexpectedly
                  exit(-1);
      } else if (x < 0) {
                  error_exit("Problems with reading from a socket.");
      } else {
                  len -= x;
                  buf = (void *)((char *)buf + x);
      }
          }
      }
      Here is a stack trace from JDK7-hs16. I believe this is related to
      re-using task ids as the hang always happens around the maximum task
      limit, no matter how many different apps are launched.

      ¿(gdb) where
      #0 0xb782e422 in __kernel_vsyscall ()
      #1 0xb780cbe7 in pthread_join () from /lib/tls/i686/cmov/libpthread.so.0
      #2 0xb77f67aa in ContinueInNewThread0 (continuation=0xb77f27c0 <JavaMain>,
          stack_size=327680, args=0xbfaf0278)
          at ../../../src/solaris/bin/java_md.c:1087
      #3 0xb77f5adc in JLI_Launch (argc=0, argv=0x0, jargc=1, jargv=0x0,
          appclassc=1, appclassv=0x0,
          fullversion=0x80486f0 "1.7.0-2010-04-14-123720.ab23780.mvm_baseline-fastdebug-jprtadm_2010_04_14_16_34-b00", dotversion=0x80486e4 "1.7",
          pname=0x80486e8 "java", lname=0x80486e8 "java", mname=0x0,
          javaargs=0 '\0', cpwildcard=1 '\001', javaw=<value optimized out>, ergo=0)
          at ../../../src/share/bin/java.c:2401
      #4 0x080485e5 in main (argc=4, argv=0x0)
          at ../../../../src/share/bin/main.c:104
      ¿Additional info. This appears to be specific to running Java2Demo...

      (gdb) where
      #0 0xb775d422 in __kernel_vsyscall ()
      #1 0xb773bbe7 in pthread_join () from /lib/tls/i686/cmov/libpthread.so.0
      #2 0xb77257aa in ContinueInNewThread0 (continuation=0xb77217c0 <JavaMain>,
          stack_size=327680, args=0xbf8d0238)
          at ../../../src/solaris/bin/java_md.c:1087
      #3 0xb7724adc in JLI_Launch (argc=0, argv=0x0, jargc=1, jargv=0x0,
          appclassc=1, appclassv=0x0,
          fullversion=0x80486f0 "1.7.0-2010-04-14-123720.ab23780.mvm_baseline-fastdebug-jprtadm_2010_04_14_16_34-b00", dotversion=0x80486e4 "1.7",
          pname=0x80486e8 "java", lname=0x80486e8 "java", mname=0x0,
          javaargs=0 '\0', cpwildcard=1 '\001', javaw=<value optimized out>, ergo=0)
          at ../../../src/share/bin/java.c:2401
      #4 0x080485e5 in main (argc=4, argv=0x0)
          at ../../../../src/share/bin/main.c:104


      Here are the steps to reproduce...

      1) unzip to a tmpdir:
         /net/altair-ha1-nfs.east/export/ds01/d105/runtime/tools/mvm/mvmdemo_noglassfish.zip

      2) edit .runmvmrc_jdk to set STARTUP_APPS to only "./demo/jfc/Java2D/Java2Demo.jar"

      3) set JAVA_HOME to JDK under test

      4) Run the following shell script...
         ¿./runmvm -config ./.runmvmrc_jdk -startup -mvm -i 32

      I'm seeing a hang on the 3rd run of Java2Demo. Keep in mind, the demo has been
      altered to System.exit() after loading the demo sub-tests.
      Here is a simple script to reproduce the hang condition. Change JAVA_HOME
      and also use the Java2Demo.jar from the above location. The demo has been
      slightly changed to System.exit() after the sub-tests have been loaded.


      ¿#!/bin/sh

      JAVA_HOME=/home/jmelvin/jdk/jdk7-hs16

      # Start MServer

      ${JAVA_HOME}/bin/java -Dsun.java2d.noddraw=true -XX:+ShowMessageBoxOnError -XRunMServer &
      sleep 10

      # Start app several times until it hangs

      while [ true ]; do
        ${JAVA_HOME}/bin/java -XUseMServer -Dsun.java2d.noddraw=true -Dsun.java2d.remote=true -jar ./demo/jfc/Java2D/Java2Demo.jar -exit
        sleep 5
      done

            kamg Keith Mcguigan (Inactive)
            jmelvin James Melvin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: