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

VMConnection.open blocks if child process has lots of output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • core-svc
    • None

      Test case (fails on Windows only):

      make test-only \
        TEST=open/test/jdk/com/sun/jdi/cds/CDSBreakpointTest.java \
        JTREG_JAVA_OPTIONS=-XX:ArchiveRelocationMode=1

      The test will timeout because BreakpointTest.java gets stuck while trying to launch a debugee VM:

      =============
         JavaThread state: _thread_blocked
      at java.lang.Object.wait0(java.base@21-internal/Native Method)
      - waiting on <0x00000000ef99f518> (a com.sun.tools.jdi.AbstractLauncher$Helper)
      at java.lang.Object.wait(java.base@21-internal/Object.java:366)
      at java.lang.Object.wait(java.base@21-internal/Object.java:339)
      at com.sun.tools.jdi.AbstractLauncher$Helper.launchAndAccept(jdk.jdi@21-internal/AbstractLauncher.java:197)
      - locked <0x00000000ef99f518> (a com.sun.tools.jdi.AbstractLauncher$Helper)
      at com.sun.tools.jdi.AbstractLauncher.launch(jdk.jdi@21-internal/AbstractLauncher.java:140)
      at com.sun.tools.jdi.SunCommandLineLauncher.launch(jdk.jdi@21-internal/SunCommandLineLauncher.java:233)
      at VMConnection.launchTarget(VMConnection.java:314)
      at VMConnection.open(VMConnection.java:149)
      - locked <0x00000000efa00300> (a VMConnection)
      at TestScaffold.connect(TestScaffold.java:652)
      at TestScaffold.startUp(TestScaffold.java:367)
      at TestScaffold.startTo(TestScaffold.java:377)
      at TestScaffold.startToMain(TestScaffold.java:372)
      at BreakpointTest.runTests(BreakpointTest.java:129)
      at TestScaffold.startTests(TestScaffold.java:434)
      at BreakpointTest.main(BreakpointTest.java:82)
      ===============

      But the debugee VM is stuck while it tries to write to the stdout, which isn't drained by BreakpointTest:

      =================
      LogFileStreamOutput::flush() Line 93
      LogFileStreamOutput::write(const LogDecorations & decorations, const char * msg) Line 166
      LogTagSet::log(LogLevel::type level, const char * msg) Line 84
      LogTagSet::vwrite(LogLevel::type level, const char * fmt, char * args) Line 149
      LogImpl<14,107,0,0,0,0>::vwrite(LogLevel::type level, const char * fmt, char * args) Line 149
      LogImpl<14,107,0,0,0,0>::write<3>(const char * fmt, ...) Line 143
      SharedClassPathEntry::validate(bool is_class_path) Line 423
      FileMapInfo::validate_shared_path_table() Line 1067
      MetaspaceShared::map_archive(FileMapInfo * mapinfo, char * mapped_base_address, ReservedSpace rs) Line 1397
      MetaspaceShared::map_archives(FileMapInfo * static_mapinfo, FileMapInfo * dynamic_mapinfo, bool use_requested_addr) Line 1095
      MetaspaceShared::initialize_runtime_shared_and_meta_spaces() Line 922
      Metaspace::global_initialize() Line 757
      universe_init() Line 792
      init_globals() Line 124
      Threads::create_vm(JavaVMInitArgs * args, bool * canTryAgain) Line 568
      JNI_CreateJavaVM_inner(JavaVM_ * * vm, void * * penv, void * args) Line 3588
      JNI_CreateJavaVM(JavaVM_ * * vm, void * * penv, void * args) Line 3674
      InitializeJVM(const JNIInvokeInterface_ * * * pvm, const JNINativeInterface_ * * * penv, InvocationFunctions * ifn) Line 1459
      JavaMain(void * _args) Line 413
      ThreadJavaMain(void * args) Line 705
      =================

            Unassigned Unassigned
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: