Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903784

NullPointerException: Cannot read the array length because the return value of "java.io.File.listFiles()" is null

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • jtreg7.5
    • jtreg7.4
    • tools
    • x86_64
    • windows

    Description

      The following test failed in the JDK24 CI:

      jdk/jfr/api/consumer/streaming/TestBaseRepositoryBeforeStart.java

      Here's a snippet from the log file:

      #-----testdescription-----
      $file=C\:\\ade\\mesos\\work_dir\\jib-master\\install\\jdk-24+10-1039\\src.full\\open\\test\\jdk\\jdk\\jfr\\api\\consumer\\streaming\\TestBaseRepositoryBeforeStart.java
      $root=C\:\\ade\\mesos\\work_dir\\jib-master\\install\\jdk-24+10-1039\\src.full\\open\\test\\jdk
      keywords=jfr othervm
      library=/test/lib
      modules=jdk.jfr java.management
      requires=vm.hasJFR
      run=USER_SPECIFIED build jdk.jfr.api.consumer.streaming.Application\r\nUSER_SPECIFIED main/othervm jdk.jfr.api.consumer.streaming.TestBaseRepositoryBeforeStart\r\n
      source=TestBaseRepositoryBeforeStart.java
      title=Test that it is possible to start a stream against a directory, specified on command line, after the application starts

      #-----environment-----

      #-----testresult-----
      end=Tue Aug 06 12\:43\:59 UTC 2024
      execStatus=Error. Unexpected exception caught from test jdk/jfr/api/consumer/streaming/TestBaseRepositoryBeforeStart.java\: java.lang.NullPointerException\: Cannot read the array length because the return value of "java.io.File.listFiles()" is null
      sections=script_messages Details

      #section:script_messages
      ----------messages:(0/0)----------

      #section:Details
      ----------messages:(0/0)----------
      ----------Stack trace:(13/1184)----------
      java.lang.NullPointerException: Cannot read the array length because the return value of "java.io.File.listFiles()" is null
      at com.sun.javatest.regtest.exec.ScratchDirectory.isEmpty(ScratchDirectory.java:331)
      at com.sun.javatest.regtest.exec.ScratchDirectory.deleteFiles(ScratchDirectory.java:226)
      at com.sun.javatest.regtest.exec.ScratchDirectory.deleteFiles(ScratchDirectory.java:217)
      at com.sun.javatest.regtest.exec.ScratchDirectory.deleteFiles(ScratchDirectory.java:217)
      at com.sun.javatest.regtest.exec.ScratchDirectory.deleteFilesWithRetry(ScratchDirectory.java:173)
      at com.sun.javatest.regtest.exec.ScratchDirectory.deleteFiles(ScratchDirectory.java:153)
      at com.sun.javatest.regtest.exec.ScratchDirectory$SimpleScratchDirectory.retainFiles(ScratchDirectory.java:389)
      at com.sun.javatest.regtest.exec.ScratchDirectory$ThreadSafeScratchDir.retainFiles(ScratchDirectory.java:451)
      at com.sun.javatest.regtest.exec.RegressionScript.run(RegressionScript.java:314)
      at com.sun.javatest.Script.run(Script.java:431)
      at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:183)
      at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:76)
      result: Not run. Test running...


      test result: Error. Unexpected exception caught from test jdk/jfr/api/consumer/streaming/TestBaseRepositoryBeforeStart.java: java.lang.NullPointerException: Cannot read the array length because the return value of "java.io.File.listFiles()" is null

      A similar failure with this test was previously addressed via:

      CODETOOLS-7903538 NullPointerException: Cannot read the array length because "<local9>" is null

      According to the task's stdout log, the JTREG version is:

      [2024-08-06T12:28:33,974Z] [jib LOG] JT_HOME=/cygdrive/c/ade/mesos/work_dir/jib-master/install/jtreg/7.4/1/bundles/jtreg-7.4+1.zip/jtreg

      CODETOOLS-7903538 is fixed in jtreg-7.4. Please note
      that I can't set the "Affects Version/s" value to "7.4".

      Attachments

        Issue Links

          Activity

            People

              jpai Jaikiran Pai
              dcubed Daniel Daugherty
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: