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

awt screencast robot spin and sync issues with native libpipewire api

    XMLWordPrintable

Details

    • b27

    Description

      [ filed on behalf of Anton Bobrov who has not yet got a JBS account ]

      The current implementation of the screencast robot has various synchronization
      issues in its implementation with the native libpipewire API which leads to
      cpu burn spinning and occasional hanging in the native
      Java_sun_awt_screencast_ScreencastHelper_getRGBPixelsImpl
      function when trying to run jtreg swing tests. This causes related tests to
      timeout and fail.

      This is easily reproducible on a stock Fedora 38 when running something like

      make test TEST="javax/swing/plaf/nimbus/TestNimbusBGColor.java" JTREG="JAVA_OPTIONS=-Dawt.robot.screenshotMethod=dbusScreencast -Dawt.robot.screenshotDebug=true"

      which does succeed sometimes but most of the time just timeouts and fails.

      The root cause is that the synchronization for the libpipewire API thread loop
      is not correctly implemented in the screencast robot native code, specifically
      around the pw_thread_loop_wait API and associated condition variables. In fact
      it is rather surprising it works at all sometimes in the current implementation.

      There will be PR to address these issues that can hopefully highlight them more
      clearly in the code so the reason for filing this issue is to get that PR going.

      Attachments

        Issue Links

          Activity

            People

              jdowland Jonathan Dowland
              jdowland Jonathan Dowland
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: