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

[Graal] occasional timeout in java/lang/StringBuffer/TestSynchronization.java with loom

XMLWordPrintable

    • b07

      We have seen five timeouts of this test where it seems like the test thread is being starved. These are all with the options -Duse.JTREG_TEST_THREAD_FACTORY=Virtual -XX:-VerifyContinuations -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler and other configurations don't seem to fail.

      The test forks a thread that calls a unsynchronized StringBuffer method while holding the lock on the object and then spins calling Thread.yield until the thread exits. Looking at the processes.html for all of these failures, the main thread seems to be in Thread.yield while all the other threads are attempting to come to a safepoint. The call stack generally looks like the below with thread thread busy in callees of freeze_internal.

      0x0000ffffb04f7c2c CodeHeap::find_blob(void*) const + 0x68
      0x0000ffffb01ed818 frame::frame(long*, long*, long*, unsigned char*) + 0x48
      0x0000ffffb01d2a3c monitors_on_stack(JavaThread*) + 0xbdc
      0x0000ffffb01e9164 int freeze_internal<Config<(oop_kind)0, G1BarrierSet> >(JavaThread*, long*) + 0x4c4
      0x0000ffffb01e940c int freeze<Config<(oop_kind)0, G1BarrierSet> >(JavaThread*, long*) + 0x5c
      0x0000ffff9839f144 jdk.internal.vm.Continuation.doYield() + 0x44 (Native method)
      0x0000ffff9849b484 * jdk.internal.vm.Continuation.yield0(jdk.internal.vm.ContinuationScope, jdk.internal.vm.Continuation) bci:18 line:360 (Compiled frame)
                         * jdk.internal.vm.Continuation.yield(jdk.internal.vm.ContinuationScope) bci:69 line:351 (Compiled frame)
                         * java.lang.VirtualThread.yieldContinuation() bci:8 line:449 (Compiled frame)
                         * java.lang.VirtualThread.tryYield() bci:30 line:782 (Compiled frame)
                         * java.lang.Thread.yield() bci:17 line:448 (Compiled frame)
                         * TestSynchronization.isSynchronized(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) bci:84 line:272 (Compiled frame)

      I downloaded all the proceses.html and examined them a bit. The windows failure wasn't very useful because jstack timed out a lot. In the others, every call stack showed all threads waiting to safepoint except the test thread calling yield which was in various callees of freeze_internal.

      0x0000ffffb0cc2c80 resource_allocate_bytes(unsigned long, AllocFailStrategy::AllocFailEnum) + 0x50
      0x0000ffffb0ce9698 ScopeDesc::decode_body() + 0x58
      0x0000ffffb0cea084 ScopeDesc::sender() const + 0x54
      0x0000ffffb01d24b8 monitors_on_stack(JavaThread*) + 0x658
      0x0000ffffb01e9164 int freeze_internal<Config<(oop_kind)0, G1BarrierSet> >(JavaThread*, long*) + 0x4c4

      0x0000ffffb0b1770c linear_search(int, bool, PcDesc*, PcDesc*) + 0x6c
      0x0000ffffb0b1f0d8 nmethod::scope_desc_at(unsigned char*) + 0x78
      0x0000ffffb01d249c monitors_on_stack(JavaThread*) + 0x63c
      0x0000ffffb01e9164 int freeze_internal<Config<(oop_kind)0, G1BarrierSet> >(JavaThread*, long*) + 0x4c4

      0x0000ffffb01c4148 Continuation::continuation_scope(oop) + 0x28
      0x0000ffffb01e911c int freeze_internal<Config<(oop_kind)0, G1BarrierSet> >(JavaThread*, long*) + 0x47c

      0x0000ffffb036429c frame::interpreter_frame_sender_sp() const + 0x4c
      0x0000ffffb0367284 frame::sender_for_interpreter_frame(RegisterMap*) const + 0x44
      0x0000ffffb01c9d8c ContinuationEntry::assert_entry_frame_laid_out(JavaThread*) + 0x34c
      0x0000ffffb01e90b4 int freeze_internal<Config<(oop_kind)0, G1BarrierSet> >(JavaThread*, long*) + 0x414

      0x0000ffffb04f7c2c CodeHeap::find_blob(void*) const + 0x68
      0x0000ffffb01ed818 frame::frame(long*, long*, long*, unsigned char*) + 0x48
      0x0000ffffb01d2a3c monitors_on_stack(JavaThread*) + 0xbdc
      0x0000ffffb01e90b4 int freeze_internal<Config<(oop_kind)0, G1BarrierSet> >(JavaThread*, long*) + 0x414

      Since this has only been seen with +UseJVMCICompiler I've filed it as a Graal failure but I don't see anything suggesting why it would be Graals fault.

        1. TestSynchronization.java
          13 kB
          Tom Rodriguez
        2. ThreadYield.java
          2 kB
          Patricio Chilano Mateo

            pchilanomate Patricio Chilano Mateo
            never Tom Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: