From jjg at openjdk.org Thu Sep 1 00:39:23 2022 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 1 Sep 2022 00:39:23 GMT Subject: RFR: 7903229: ParameterFilter - check initFiles for any File with an empty path In-Reply-To: References: Message-ID: On Sat, 2 Jul 2022 16:20:10 GMT, Dmitry Bessonov wrote: > ParameterFilter.java : method `update` could check check initFiles (which is result of `stringsToFiles()` call) for any File with an empty path src/com/sun/javatest/ParameterFilter.java line 241: > 239: if (file.getPath().isEmpty()) { > 240: throw new IllegalArgumentException("The passed configuration parameters contain an empty path " + > 241: "identifying a test or a folder of tests within the test suite to be run"); This check seems later than it could be. You have a set of Strings (`initStrings`), that get converted to files (`initFiles`) that get converted to back to paths (file.getPath`). Why not just check that the strings are not blank in the first place? That being said, how does this code relate to the comment on lines 232,233, that a null or empty check has already been done. Finally, what are the implications of throwing unchecked exceptions, like `IllegalArgumentException` in this code? ------------- PR: https://git.openjdk.org/jtharness/pull/33 From jjg at openjdk.org Thu Sep 1 00:46:27 2022 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 1 Sep 2022 00:46:27 GMT Subject: RFR: Fix NullPointerException on a parallel run [v3] In-Reply-To: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> References: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> Message-ID: On Wed, 24 Aug 2022 14:10:14 GMT, Jan Kratochvil wrote: >> Error: Unexpected exception occurred! java.lang.NullPointerException >> java.lang.NullPointerException >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) >> at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) >> at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) >> at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) >> at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) >> at com.sun.javatest.TestFinder.read(TestFinder.java:433) >> at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) >> at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) >> at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) >> at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) >> at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) >> at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) >> at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) >> at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) >> at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) >> at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) >> at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) >> at com.sun.javatest.regtest.Main.main(Main.java:46) >> >> >> Some debug output showing the problem: >> >> scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir >> processFile file=/resultdir isAbsolute=true >> TestFinder.java read file=/resultdir isAbsolute=true >> scanFile caller file=/resultdir >> scanFile File=/resultdir >> TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> >> This happens with jtreg using `-w:resultdir` . `getRootRelativePath()` returns empty `""` path. Other option would be to return `"."` but in such case it broke some other code. >> >> This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: >> >> seq 1 100000|xargs -n1 -P64 ./runtest >> #! /bin/bash >> dir=result-test$$ >> rm -rf $dir >> mkdir $dir >> set -o pipefail >> (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 >> rm -rf $dir >> >> >> Unforunately I am not yet Author so I do not yet have a JBS account so I cannot file it to JBS (Java Bug System). > > Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: > > Fix NullPointerException on a parallel run > > Error: Unexpected exception occurred! java.lang.NullPointerException > java.lang.NullPointerException > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) > at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) > at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) > at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) > at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) > at com.sun.javatest.TestFinder.read(TestFinder.java:433) > at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) > at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) > at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) > at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) > at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) > at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) > at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) > at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) > at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) > at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) > at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) > at com.sun.javatest.regtest.Main.main(Main.java:46) > > Some debug output showing the problem: > scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir > processFile file=/resultdir isAbsolute=true > TestFinder.java read file=/resultdir isAbsolute=true > scanFile caller file=/resultdir > scanFile File=/resultdir > TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > > This happens with jtreg using -w:resultdir . getRootRelativePath() > returns empty "" path. Other option would be to return "." but in such > case it broke some other code. > > This problem does not happen during a single run. It happens only when > jtreg is being run in parallel, in my case: > seq 1 100000|xargs -n1 -P64 ./runtest > #! /bin/bash > dir=result-test$$ > rm -rf $dir > mkdir $dir > set -o pipefail > (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 > rm -rf $dir src/com/sun/javatest/TRT_TreeNode.java line 808: > 806: String path = TestResultTable.getRootRelativePath(this); > 807: processFile(new File( "".equals(path) // Zero length string if the node is a root > 808: ? filesToScan[i] : (path + File.separator + filesToScan[i]) )); Pretty ugly code, containing a complex expression inside the `new File`, and even path string computation instead of using a better `File` constructor. I suggest something like: processFile(path.isEmpty() // Zero length string if the node is a root ? new File(filesToScan[i]) : new File(path, filesToScan[i])); ------------- PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 00:46:27 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 00:46:27 GMT Subject: RFR: Fix NullPointerException on a parallel run [v3] In-Reply-To: References: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> Message-ID: On Thu, 1 Sep 2022 00:42:10 GMT, Jonathan Gibbons wrote: >> Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: >> >> Fix NullPointerException on a parallel run >> >> Error: Unexpected exception occurred! java.lang.NullPointerException >> java.lang.NullPointerException >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) >> at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) >> at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) >> at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) >> at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) >> at com.sun.javatest.TestFinder.read(TestFinder.java:433) >> at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) >> at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) >> at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) >> at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) >> at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) >> at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) >> at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) >> at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) >> at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) >> at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) >> at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) >> at com.sun.javatest.regtest.Main.main(Main.java:46) >> >> Some debug output showing the problem: >> scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir >> processFile file=/resultdir isAbsolute=true >> TestFinder.java read file=/resultdir isAbsolute=true >> scanFile caller file=/resultdir >> scanFile File=/resultdir >> TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> >> This happens with jtreg using -w:resultdir . getRootRelativePath() >> returns empty "" path. Other option would be to return "." but in such >> case it broke some other code. >> >> This problem does not happen during a single run. It happens only when >> jtreg is being run in parallel, in my case: >> seq 1 100000|xargs -n1 -P64 ./runtest >> #! /bin/bash >> dir=result-test$$ >> rm -rf $dir >> mkdir $dir >> set -o pipefail >> (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 >> rm -rf $dir > > src/com/sun/javatest/TRT_TreeNode.java line 808: > >> 806: String path = TestResultTable.getRootRelativePath(this); >> 807: processFile(new File( "".equals(path) // Zero length string if the node is a root >> 808: ? filesToScan[i] : (path + File.separator + filesToScan[i]) )); > > Pretty ugly code, containing a complex expression inside the `new File`, and even path string computation instead of using a better `File` constructor. > > I suggest something like: > > > processFile(path.isEmpty() // Zero length string if the node is a root > ? new File(filesToScan[i]) > : new File(path, filesToScan[i])); What if `path` is null ? ------------- PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 00:49:29 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 00:49:29 GMT Subject: RFR: Fix NullPointerException on a parallel run [v3] In-Reply-To: References: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> Message-ID: <5rMRRQ7Zj6AOeLmUlea53JZhhQlYtZo4oKg-uzI7Z_g=.6a0bd7f8-61b5-484d-936c-748d548bdd9b@github.com> On Thu, 1 Sep 2022 00:44:22 GMT, Dmitry Bessonov wrote: >> src/com/sun/javatest/TRT_TreeNode.java line 808: >> >>> 806: String path = TestResultTable.getRootRelativePath(this); >>> 807: processFile(new File( "".equals(path) // Zero length string if the node is a root >>> 808: ? filesToScan[i] : (path + File.separator + filesToScan[i]) )); >> >> Pretty ugly code, containing a complex expression inside the `new File`, and even path string computation instead of using a better `File` constructor. >> >> I suggest something like: >> >> >> processFile(path.isEmpty() // Zero length string if the node is a root >> ? new File(filesToScan[i]) >> : new File(path, filesToScan[i])); > > What if `path` is null ? Also, it might be better not to pull in an additional constructor that was not used before, but rather maximally stick with the existing code and APi calls it does ------------- PR: https://git.openjdk.org/jtharness/pull/35 From jjg at openjdk.org Thu Sep 1 01:17:25 2022 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 1 Sep 2022 01:17:25 GMT Subject: RFR: Fix NullPointerException on a parallel run [v3] In-Reply-To: <5rMRRQ7Zj6AOeLmUlea53JZhhQlYtZo4oKg-uzI7Z_g=.6a0bd7f8-61b5-484d-936c-748d548bdd9b@github.com> References: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> <5rMRRQ7Zj6AOeLmUlea53JZhhQlYtZo4oKg-uzI7Z_g=.6a0bd7f8-61b5-484d-936c-748d548bdd9b@github.com> Message-ID: On Thu, 1 Sep 2022 00:47:23 GMT, Dmitry Bessonov wrote: >> What if `path` is null ? > > Also, it might be better not to pull in an additional constructor that was not used before, but rather maximally stick with the existing code and APi calls it does If `null` is a possibility, check for it. ?? I don't understand the concern about referencing a different constructor that has been around since the beginning of Java time, and why it is better to do string arithmetic to construct a file path. ------------- PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 01:30:22 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 01:30:22 GMT Subject: RFR: Fix NullPointerException on a parallel run [v3] In-Reply-To: References: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> <5rMRRQ7Zj6AOeLmUlea53JZhhQlYtZo4oKg-uzI7Z_g=.6a0bd7f8-61b5-484d-936c-748d548bdd9b@github.com> Message-ID: On Thu, 1 Sep 2022 01:13:42 GMT, Jonathan Gibbons wrote: >> Also, it might be better not to pull in an additional constructor that was not used before, but rather maximally stick with the existing code and APi calls it does > > If `null` is a possibility, check for it. > > ?? I don't understand the concern about referencing a different constructor that has been around since the beginning of Java time, and why it is better to do string arithmetic to construct a file path. Implicitly checking for `null` here below. If we could keep the existing approaches and API calls in the legacy code base, let's not pull anything new without necessity. I guess we don't have necessity to call an API that is new to this context. processFile("".equals(path) // Zero length string if the node is a root ? new File(filesToScan[i]) : new File(path + File.separator + filesToScan[i])); ------------- PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 01:31:22 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 01:31:22 GMT Subject: RFR: 7903229: ParameterFilter - check initFiles for any File with an empty path In-Reply-To: References: Message-ID: <0qkrhr_aFKCnL32Zm4Gw9QC1jhUZC1ugaN0qXokUt3I=.c690b2fd-cf2c-4d25-8624-95831e7977b8@github.com> On Thu, 1 Sep 2022 00:35:55 GMT, Jonathan Gibbons wrote: >> ParameterFilter.java : method `update` could check check initFiles (which is result of `stringsToFiles()` call) for any File with an empty path > > src/com/sun/javatest/ParameterFilter.java line 241: > >> 239: if (file.getPath().isEmpty()) { >> 240: throw new IllegalArgumentException("The passed configuration parameters contain an empty path " + >> 241: "identifying a test or a folder of tests within the test suite to be run"); > > This check seems later than it could be. > > You have a set of Strings (`initStrings`), that get converted to files (`initFiles`) that get converted to back to paths (file.getPath`). > > Why not just check that the strings are not blank in the first place? That being said, how does this code relate to the comment on lines 232,233, that a null or empty check has already been done. > > Finally, what are the implications of throwing unchecked exceptions, like `IllegalArgumentException` in this code? This specific approach was suggested earlier as-is. Please see https://bugs.openjdk.org/browse/CODETOOLS-7903229 IAE is a common scenario for this code - e.g. `new InitialUrlFilter(..)` called soon after the check perfectly throws IAE if needed. ------------- PR: https://git.openjdk.org/jtharness/pull/33 From dbessono at openjdk.org Thu Sep 1 01:38:18 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 01:38:18 GMT Subject: RFR: Fix NullPointerException on a parallel run [v3] In-Reply-To: References: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> <5rMRRQ7Zj6AOeLmUlea53JZhhQlYtZo4oKg-uzI7Z_g=.6a0bd7f8-61b5-484d-936c-748d548bdd9b@github.com> Message-ID: On Thu, 1 Sep 2022 01:26:36 GMT, Dmitry Bessonov wrote: >> If `null` is a possibility, check for it. >> >> ?? I don't understand the concern about referencing a different constructor that has been around since the beginning of Java time, and why it is better to do string arithmetic to construct a file path. > > Implicitly checking for `null` here below. > If we could keep the existing approaches and API calls in the legacy code base, let's not pull anything new without necessity. I guess we don't have necessity to call an API that is new to this context. > > > processFile("".equals(path) // Zero length string if the node is a root > ? new File(filesToScan[i]) > : new File(path + File.separator + filesToScan[i])); If needed, refactoring like `File` constructors call optimizations deserves to be better done with a separate commit. ------------- PR: https://git.openjdk.org/jtharness/pull/35 From duke at openjdk.org Thu Sep 1 08:08:24 2022 From: duke at openjdk.org (Jan Kratochvil) Date: Thu, 1 Sep 2022 08:08:24 GMT Subject: RFR: Fix NullPointerException on a parallel run [v3] In-Reply-To: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> References: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> Message-ID: On Wed, 24 Aug 2022 14:10:14 GMT, Jan Kratochvil wrote: >> Error: Unexpected exception occurred! java.lang.NullPointerException >> java.lang.NullPointerException >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) >> at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) >> at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) >> at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) >> at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) >> at com.sun.javatest.TestFinder.read(TestFinder.java:433) >> at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) >> at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) >> at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) >> at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) >> at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) >> at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) >> at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) >> at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) >> at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) >> at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) >> at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) >> at com.sun.javatest.regtest.Main.main(Main.java:46) >> >> >> Some debug output showing the problem: >> >> scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir >> processFile file=/resultdir isAbsolute=true >> TestFinder.java read file=/resultdir isAbsolute=true >> scanFile caller file=/resultdir >> scanFile File=/resultdir >> TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> >> This happens with jtreg using `-w:resultdir` . `getRootRelativePath()` returns empty `""` path. Other option would be to return `"."` but in such case it broke some other code. >> >> This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: >> >> seq 1 100000|xargs -n1 -P64 ./runtest >> #! /bin/bash >> dir=result-test$$ >> rm -rf $dir >> mkdir $dir >> set -o pipefail >> (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 >> rm -rf $dir >> >> >> Unforunately I am not yet Author so I do not yet have a JBS account so I cannot file it to JBS (Java Bug System). > > Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: > > Fix NullPointerException on a parallel run > > Error: Unexpected exception occurred! java.lang.NullPointerException > java.lang.NullPointerException > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) > at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) > at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) > at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) > at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) > at com.sun.javatest.TestFinder.read(TestFinder.java:433) > at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) > at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) > at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) > at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) > at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) > at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) > at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) > at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) > at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) > at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) > at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) > at com.sun.javatest.regtest.Main.main(Main.java:46) > > Some debug output showing the problem: > scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir > processFile file=/resultdir isAbsolute=true > TestFinder.java read file=/resultdir isAbsolute=true > scanFile caller file=/resultdir > scanFile File=/resultdir > TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > > This happens with jtreg using -w:resultdir . getRootRelativePath() > returns empty "" path. Other option would be to return "." but in such > case it broke some other code. > > This problem does not happen during a single run. It happens only when > jtreg is being run in parallel, in my case: > seq 1 100000|xargs -n1 -P64 ./runtest > #! /bin/bash > dir=result-test$$ > rm -rf $dir > mkdir $dir > set -o pipefail > (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 > rm -rf $dir `getRootRelativePath()` can never return `null`: https://github.com/openjdk/jtharness/blob/b9f4a2c03135208608b7e1a6586be6fe57a062d6/src/com/sun/javatest/TestResultTable.java#L338 The `NullPointerException` happens later in the code because the wrongly computed filename does not exist. (That could be an unrelated bug whether it should not be handled better, for example in the case someone deletes such file underneath.) ------------- PR: https://git.openjdk.org/jtharness/pull/35 From duke at openjdk.org Thu Sep 1 08:11:40 2022 From: duke at openjdk.org (Jan Kratochvil) Date: Thu, 1 Sep 2022 08:11:40 GMT Subject: RFR: Fix NullPointerException on a parallel run [v4] In-Reply-To: References: Message-ID: > Error: Unexpected exception occurred! java.lang.NullPointerException > java.lang.NullPointerException > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) > at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) > at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) > at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) > at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) > at com.sun.javatest.TestFinder.read(TestFinder.java:433) > at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) > at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) > at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) > at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) > at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) > at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) > at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) > at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) > at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) > at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) > at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) > at com.sun.javatest.regtest.Main.main(Main.java:46) > > > Some debug output showing the problem: > > scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir > processFile file=/resultdir isAbsolute=true > TestFinder.java read file=/resultdir isAbsolute=true > scanFile caller file=/resultdir > scanFile File=/resultdir > TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > > This happens with jtreg using `-w:resultdir` . `getRootRelativePath()` returns empty `""` path. Other option would be to return `"."` but in such case it broke some other code. > > This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: > > seq 1 100000|xargs -n1 -P64 ./runtest > #! /bin/bash > dir=result-test$$ > rm -rf $dir > mkdir $dir > set -o pipefail > (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 > rm -rf $dir > > > Unforunately I am not yet Author so I do not yet have a JBS account so I cannot file it to JBS (Java Bug System). Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: Fix NullPointerException on a parallel run Error: Unexpected exception occurred! java.lang.NullPointerException java.lang.NullPointerException at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) at com.sun.javatest.TestFinder.read(TestFinder.java:433) at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) at com.sun.javatest.regtest.Main.main(Main.java:46) Some debug output showing the problem: scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir processFile file=/resultdir isAbsolute=true TestFinder.java read file=/resultdir isAbsolute=true scanFile caller file=/resultdir scanFile File=/resultdir TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ This happens with jtreg using -w:resultdir . getRootRelativePath() returns empty "" path. Other option would be to return "." but in such case it broke some other code. This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: seq 1 100000|xargs -n1 -P64 ./runtest #! /bin/bash dir=result-test$$ rm -rf $dir mkdir $dir set -o pipefail (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 rm -rf $dir ------------- Changes: - all: https://git.openjdk.org/jtharness/pull/35/files - new: https://git.openjdk.org/jtharness/pull/35/files/92f964d3..90532525 Webrevs: - full: https://webrevs.openjdk.org/?repo=jtharness&pr=35&range=03 - incr: https://webrevs.openjdk.org/?repo=jtharness&pr=35&range=02-03 Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jtharness/pull/35.diff Fetch: git fetch https://git.openjdk.org/jtharness pull/35/head:pull/35 PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 10:25:27 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 10:25:27 GMT Subject: RFR: Fix NullPointerException on a parallel run [v3] In-Reply-To: References: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> Message-ID: On Thu, 1 Sep 2022 08:05:07 GMT, Jan Kratochvil wrote: >> Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. Incremental views are not available. > > `getRootRelativePath()` can never return `null`: https://github.com/openjdk/jtharness/blob/b9f4a2c03135208608b7e1a6586be6fe57a062d6/src/com/sun/javatest/TestResultTable.java#L338 > The `NullPointerException` happens later in the code because the wrongly computed filename does not exist. (That could be an unrelated bug whether it should not be handled better, for example in the case someone deletes such file underneath.) @jankratochvil thanks for the update. I guess even if some method now doesn't return null, we'd be better prepared if it starts in future due to some refactoring. Can see that the recent change failed jcheck Check failure on line 808 in src/com/sun/javatest/TRT_TreeNode.java openjdk / jcheck Whitespace error Column 50: trailing whitespace Once jcheck is OK, I guess we might be good to go to resolve the issues you are facing with a parallel run ------------- PR: https://git.openjdk.org/jtharness/pull/35 From duke at openjdk.org Thu Sep 1 11:41:47 2022 From: duke at openjdk.org (Jan Kratochvil) Date: Thu, 1 Sep 2022 11:41:47 GMT Subject: RFR: Fix NullPointerException on a parallel run [v5] In-Reply-To: References: Message-ID: > Error: Unexpected exception occurred! java.lang.NullPointerException > java.lang.NullPointerException > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) > at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) > at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) > at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) > at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) > at com.sun.javatest.TestFinder.read(TestFinder.java:433) > at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) > at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) > at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) > at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) > at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) > at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) > at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) > at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) > at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) > at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) > at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) > at com.sun.javatest.regtest.Main.main(Main.java:46) > > > Some debug output showing the problem: > > scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir > processFile file=/resultdir isAbsolute=true > TestFinder.java read file=/resultdir isAbsolute=true > scanFile caller file=/resultdir > scanFile File=/resultdir > TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > > This happens with jtreg using `-w:resultdir` . `getRootRelativePath()` returns empty `""` path. Other option would be to return `"."` but in such case it broke some other code. > > This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: > > seq 1 100000|xargs -n1 -P64 ./runtest > #! /bin/bash > dir=result-test$$ > rm -rf $dir > mkdir $dir > set -o pipefail > (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 > rm -rf $dir > > > Unforunately I am not yet Author so I do not yet have a JBS account so I cannot file it to JBS (Java Bug System). Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: Fix NullPointerException on a parallel run Error: Unexpected exception occurred! java.lang.NullPointerException java.lang.NullPointerException at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) at com.sun.javatest.TestFinder.read(TestFinder.java:433) at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) at com.sun.javatest.regtest.Main.main(Main.java:46) Some debug output showing the problem: scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir processFile file=/resultdir isAbsolute=true TestFinder.java read file=/resultdir isAbsolute=true scanFile caller file=/resultdir scanFile File=/resultdir TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ This happens with jtreg using -w:resultdir . getRootRelativePath() returns empty "" path. Other option would be to return "." but in such case it broke some other code. This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: seq 1 100000|xargs -n1 -P64 ./runtest #! /bin/bash dir=result-test$$ rm -rf $dir mkdir $dir set -o pipefail (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 rm -rf $dir ------------- Changes: - all: https://git.openjdk.org/jtharness/pull/35/files - new: https://git.openjdk.org/jtharness/pull/35/files/90532525..c52f73a4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jtharness&pr=35&range=04 - incr: https://webrevs.openjdk.org/?repo=jtharness&pr=35&range=03-04 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jtharness/pull/35.diff Fetch: git fetch https://git.openjdk.org/jtharness pull/35/head:pull/35 PR: https://git.openjdk.org/jtharness/pull/35 From duke at openjdk.org Thu Sep 1 11:42:57 2022 From: duke at openjdk.org (Jan Kratochvil) Date: Thu, 1 Sep 2022 11:42:57 GMT Subject: RFR: Fix NullPointerException on a parallel run [v3] In-Reply-To: References: <7jz5KPbyPqb3JfHj3jQkkc4iBI2yzMXmvhIggFiCkqU=.0cb07d4d-d533-4378-bc1e-a0191d4a96cc@github.com> Message-ID: On Thu, 1 Sep 2022 10:23:16 GMT, Dmitry Bessonov wrote: >> `getRootRelativePath()` can never return `null`: https://github.com/openjdk/jtharness/blob/b9f4a2c03135208608b7e1a6586be6fe57a062d6/src/com/sun/javatest/TestResultTable.java#L338 >> The `NullPointerException` happens later in the code because the wrongly computed filename does not exist. (That could be an unrelated bug whether it should not be handled better, for example in the case someone deletes such file underneath.) > > @jankratochvil thanks for the update. I guess even if some method now doesn't return null, we'd be better prepared if it starts in future due to some refactoring. > > Can see that the recent change failed jcheck > > Check failure on line 808 in src/com/sun/javatest/TRT_TreeNode.java > openjdk / jcheck > > Whitespace error > > Column 50: trailing whitespace > > > > Once jcheck is OK, I guess we might be good to go to resolve the issues you are facing with a parallel run @dbessono I am not sure - is this patch OK or should I check whether `getRootRelativePath()` has returned `null`? Otherwise I have fixed the whitespace, sorry for not noticing the `jcheck` error, it sends no mails. ------------- PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 12:03:23 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 12:03:23 GMT Subject: RFR: Fix NullPointerException on a parallel run [v5] In-Reply-To: References: Message-ID: On Thu, 1 Sep 2022 11:41:47 GMT, Jan Kratochvil wrote: >> Error: Unexpected exception occurred! java.lang.NullPointerException >> java.lang.NullPointerException >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) >> at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) >> at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) >> at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) >> at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) >> at com.sun.javatest.TestFinder.read(TestFinder.java:433) >> at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) >> at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) >> at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) >> at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) >> at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) >> at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) >> at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) >> at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) >> at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) >> at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) >> at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) >> at com.sun.javatest.regtest.Main.main(Main.java:46) >> >> >> Some debug output showing the problem: >> >> scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir >> processFile file=/resultdir isAbsolute=true >> TestFinder.java read file=/resultdir isAbsolute=true >> scanFile caller file=/resultdir >> scanFile File=/resultdir >> TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> >> This happens with jtreg using `-w:resultdir` . `getRootRelativePath()` returns empty `""` path. Other option would be to return `"."` but in such case it broke some other code. >> >> This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: >> >> seq 1 100000|xargs -n1 -P64 ./runtest >> #! /bin/bash >> dir=result-test$$ >> rm -rf $dir >> mkdir $dir >> set -o pipefail >> (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 >> rm -rf $dir >> >> >> Unforunately I am not yet Author so I do not yet have a JBS account so I cannot file it to JBS (Java Bug System). > > Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: > > Fix NullPointerException on a parallel run > > Error: Unexpected exception occurred! java.lang.NullPointerException > java.lang.NullPointerException > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) > at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) > at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) > at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) > at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) > at com.sun.javatest.TestFinder.read(TestFinder.java:433) > at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) > at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) > at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) > at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) > at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) > at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) > at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) > at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) > at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) > at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) > at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) > at com.sun.javatest.regtest.Main.main(Main.java:46) > > Some debug output showing the problem: > scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir > processFile file=/resultdir isAbsolute=true > TestFinder.java read file=/resultdir isAbsolute=true > scanFile caller file=/resultdir > scanFile File=/resultdir > TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > > This happens with jtreg using -w:resultdir . getRootRelativePath() > returns empty "" path. Other option would be to return "." but in such > case it broke some other code. > > This problem does not happen during a single run. It happens only when > jtreg is being run in parallel, in my case: > seq 1 100000|xargs -n1 -P64 ./runtest > #! /bin/bash > dir=result-test$$ > rm -rf $dir > mkdir $dir > set -o pipefail > (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 > rm -rf $dir The current patch takes possible `null` value into account and won't generate NPE, as per https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#equals-java.lang.Object- ------------- PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 12:15:28 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 12:15:28 GMT Subject: RFR: Fix NullPointerException on a parallel run [v5] In-Reply-To: References: Message-ID: <1OhB_7UE4qr1Ae0TjWqvYLbzWof5NqLReyPj2mTh2l8=.32c93aa7-f24f-48a1-8f24-1a4a7edc6085@github.com> On Thu, 1 Sep 2022 11:41:47 GMT, Jan Kratochvil wrote: >> Error: Unexpected exception occurred! java.lang.NullPointerException >> java.lang.NullPointerException >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) >> at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) >> at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) >> at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) >> at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) >> at com.sun.javatest.TestFinder.read(TestFinder.java:433) >> at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) >> at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) >> at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) >> at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) >> at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) >> at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) >> at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) >> at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) >> at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) >> at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) >> at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) >> at com.sun.javatest.regtest.Main.main(Main.java:46) >> >> >> Some debug output showing the problem: >> >> scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir >> processFile file=/resultdir isAbsolute=true >> TestFinder.java read file=/resultdir isAbsolute=true >> scanFile caller file=/resultdir >> scanFile File=/resultdir >> TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> >> This happens with jtreg using `-w:resultdir` . `getRootRelativePath()` returns empty `""` path. Other option would be to return `"."` but in such case it broke some other code. >> >> This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: >> >> seq 1 100000|xargs -n1 -P64 ./runtest >> #! /bin/bash >> dir=result-test$$ >> rm -rf $dir >> mkdir $dir >> set -o pipefail >> (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 >> rm -rf $dir >> >> >> Unforunately I am not yet Author so I do not yet have a JBS account so I cannot file it to JBS (Java Bug System). > > Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: > > Fix NullPointerException on a parallel run > > Error: Unexpected exception occurred! java.lang.NullPointerException > java.lang.NullPointerException > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) > at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) > at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) > at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) > at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) > at com.sun.javatest.TestFinder.read(TestFinder.java:433) > at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) > at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) > at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) > at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) > at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) > at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) > at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) > at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) > at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) > at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) > at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) > at com.sun.javatest.regtest.Main.main(Main.java:46) > > Some debug output showing the problem: > scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir > processFile file=/resultdir isAbsolute=true > TestFinder.java read file=/resultdir isAbsolute=true > scanFile caller file=/resultdir > scanFile File=/resultdir > TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > > This happens with jtreg using -w:resultdir . getRootRelativePath() > returns empty "" path. Other option would be to return "." but in such > case it broke some other code. > > This problem does not happen during a single run. It happens only when > jtreg is being run in parallel, in my case: > seq 1 100000|xargs -n1 -P64 ./runtest > #! /bin/bash > dir=result-test$$ > rm -rf $dir > mkdir $dir > set -o pipefail > (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 > rm -rf $dir Marked as reviewed by dbessono (Committer). ------------- PR: https://git.openjdk.org/jtharness/pull/35 From duke at openjdk.org Thu Sep 1 12:15:29 2022 From: duke at openjdk.org (Jan Kratochvil) Date: Thu, 1 Sep 2022 12:15:29 GMT Subject: RFR: Fix NullPointerException on a parallel run [v5] In-Reply-To: References: Message-ID: On Thu, 1 Sep 2022 11:41:47 GMT, Jan Kratochvil wrote: >> Error: Unexpected exception occurred! java.lang.NullPointerException >> java.lang.NullPointerException >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) >> at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) >> at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) >> at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) >> at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) >> at com.sun.javatest.TestFinder.read(TestFinder.java:433) >> at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) >> at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) >> at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) >> at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) >> at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) >> at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) >> at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) >> at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) >> at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) >> at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) >> at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) >> at com.sun.javatest.regtest.Main.main(Main.java:46) >> >> >> Some debug output showing the problem: >> >> scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir >> processFile file=/resultdir isAbsolute=true >> TestFinder.java read file=/resultdir isAbsolute=true >> scanFile caller file=/resultdir >> scanFile File=/resultdir >> TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> >> This happens with jtreg using `-w:resultdir` . `getRootRelativePath()` returns empty `""` path. Other option would be to return `"."` but in such case it broke some other code. >> >> This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: >> >> seq 1 100000|xargs -n1 -P64 ./runtest >> #! /bin/bash >> dir=result-test$$ >> rm -rf $dir >> mkdir $dir >> set -o pipefail >> (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 >> rm -rf $dir >> >> >> Unforunately I am not yet Author so I do not yet have a JBS account so I cannot file it to JBS (Java Bug System). > > Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: > > Fix NullPointerException on a parallel run > > Error: Unexpected exception occurred! java.lang.NullPointerException > java.lang.NullPointerException > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) > at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) > at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) > at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) > at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) > at com.sun.javatest.TestFinder.read(TestFinder.java:433) > at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) > at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) > at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) > at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) > at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) > at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) > at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) > at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) > at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) > at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) > at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) > at com.sun.javatest.regtest.Main.main(Main.java:46) > > Some debug output showing the problem: > scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir > processFile file=/resultdir isAbsolute=true > TestFinder.java read file=/resultdir isAbsolute=true > scanFile caller file=/resultdir > scanFile File=/resultdir > TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > > This happens with jtreg using -w:resultdir . getRootRelativePath() > returns empty "" path. Other option would be to return "." but in such > case it broke some other code. > > This problem does not happen during a single run. It happens only when > jtreg is being run in parallel, in my case: > seq 1 100000|xargs -n1 -P64 ./runtest > #! /bin/bash > dir=result-test$$ > rm -rf $dir > mkdir $dir > set -o pipefail > (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 > rm -rf $dir It won't generate NPE but it will produce `String "null/filename"`. Which will produce NPE later in the code like the original problem this patch tries to fix. But then we do not know what return value `null` from `getRootRelativePath()` should mean. So we do not know what to do with such return value anyway. But I prefer it this way, thanks for the approval. ------------- PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 12:19:27 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 12:19:27 GMT Subject: RFR: Fix NullPointerException on a parallel run [v5] In-Reply-To: References: Message-ID: On Thu, 1 Sep 2022 12:12:12 GMT, Jan Kratochvil wrote: > It won't generate NPE but it will produce `String "null/filename"`. Which will produce NPE later in the code like the original problem this patch tries to fix. But then we do not know what return value `null` from `getRootRelativePath()` should mean. So we do not know what to do with such return value anyway. But I prefer it this way, thanks for the approval. you are right, as a follow up I'd update the code to processFile(path == null || path.isEmpty() // Zero length string if the node is a root ------------- PR: https://git.openjdk.org/jtharness/pull/35 From duke at openjdk.org Thu Sep 1 12:29:31 2022 From: duke at openjdk.org (Jan Kratochvil) Date: Thu, 1 Sep 2022 12:29:31 GMT Subject: Integrated: Fix NullPointerException on a parallel run In-Reply-To: References: Message-ID: On Wed, 17 Aug 2022 13:12:28 GMT, Jan Kratochvil wrote: > Error: Unexpected exception occurred! java.lang.NullPointerException > java.lang.NullPointerException > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) > at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) > at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) > at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) > at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) > at com.sun.javatest.TestFinder.read(TestFinder.java:433) > at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) > at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) > at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) > at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) > at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) > at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) > at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) > at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) > at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) > at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) > at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) > at com.sun.javatest.regtest.Main.main(Main.java:46) > > > Some debug output showing the problem: > > scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir > processFile file=/resultdir isAbsolute=true > TestFinder.java read file=/resultdir isAbsolute=true > scanFile caller file=/resultdir > scanFile File=/resultdir > TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > > This happens with jtreg using `-w:resultdir` . `getRootRelativePath()` returns empty `""` path. Other option would be to return `"."` but in such case it broke some other code. > > This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: > > seq 1 100000|xargs -n1 -P64 ./runtest > #! /bin/bash > dir=result-test$$ > rm -rf $dir > mkdir $dir > set -o pipefail > (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 > rm -rf $dir > > > Unforunately I am not yet Author so I do not yet have a JBS account so I cannot file it to JBS (Java Bug System). This pull request has now been integrated. Changeset: 2b3e2b68 Author: Jan Kratochvil Committer: Dmitry Bessonov URL: https://git.openjdk.org/jtharness/commit/2b3e2b6837651dbaa3a01e228394e6441ff571ed Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Fix NullPointerException on a parallel run Reviewed-by: dbessono ------------- PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 12:58:41 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 12:58:41 GMT Subject: RFR: 7903263: Feature Tests - Adding five JavaTest GUI legacy automated test scripts In-Reply-To: References: Message-ID: On Fri, 26 Aug 2022 13:49:21 GMT, gollayadav wrote: > Adding below automated legacy JavaTest GUI feature Test Scripts to the Jemmy regression suite and tested locally on three platforms(Linux, Windows, Mac OS) and working fine. > > 1.New3.java > 2.New5.java > 3.New6.java > 4.New7.java > 5.New8.java Marked as reviewed by dbessono (Committer). thanks for more tests, double checked with JDK8/MacOS ------------- PR: https://git.openjdk.org/jtharness/pull/36 From duke at openjdk.org Thu Sep 1 13:10:32 2022 From: duke at openjdk.org (Jan Kratochvil) Date: Thu, 1 Sep 2022 13:10:32 GMT Subject: RFR: Fix NullPointerException on a parallel run [v5] In-Reply-To: References: Message-ID: On Thu, 1 Sep 2022 11:41:47 GMT, Jan Kratochvil wrote: >> Error: Unexpected exception occurred! java.lang.NullPointerException >> java.lang.NullPointerException >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) >> at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) >> at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) >> at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) >> at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) >> at com.sun.javatest.TestFinder.read(TestFinder.java:433) >> at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) >> at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) >> at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) >> at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) >> at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) >> at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) >> at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) >> at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) >> at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) >> at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) >> at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) >> at com.sun.javatest.regtest.Main.main(Main.java:46) >> >> >> Some debug output showing the problem: >> >> scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir >> processFile file=/resultdir isAbsolute=true >> TestFinder.java read file=/resultdir isAbsolute=true >> scanFile caller file=/resultdir >> scanFile File=/resultdir >> TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> >> This happens with jtreg using `-w:resultdir` . `getRootRelativePath()` returns empty `""` path. Other option would be to return `"."` but in such case it broke some other code. >> >> This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: >> >> seq 1 100000|xargs -n1 -P64 ./runtest >> #! /bin/bash >> dir=result-test$$ >> rm -rf $dir >> mkdir $dir >> set -o pipefail >> (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 >> rm -rf $dir >> >> >> Unforunately I am not yet Author so I do not yet have a JBS account so I cannot file it to JBS (Java Bug System). > > Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: > > Fix NullPointerException on a parallel run > > Error: Unexpected exception occurred! java.lang.NullPointerException > java.lang.NullPointerException > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) > at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) > at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) > at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) > at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) > at com.sun.javatest.TestFinder.read(TestFinder.java:433) > at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) > at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) > at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) > at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) > at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) > at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) > at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) > at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) > at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) > at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) > at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) > at com.sun.javatest.regtest.Main.main(Main.java:46) > > Some debug output showing the problem: > scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir > processFile file=/resultdir isAbsolute=true > TestFinder.java read file=/resultdir isAbsolute=true > scanFile caller file=/resultdir > scanFile File=/resultdir > TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > > This happens with jtreg using -w:resultdir . getRootRelativePath() > returns empty "" path. Other option would be to return "." but in such > case it broke some other code. > > This problem does not happen during a single run. It happens only when > jtreg is being run in parallel, in my case: > seq 1 100000|xargs -n1 -P64 ./runtest > #! /bin/bash > dir=result-test$$ > rm -rf $dir > mkdir $dir > set -o pipefail > (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 > rm -rf $dir I see you have already done the `path == null ||` part so we are done, thanks! ------------- PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 13:10:33 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 13:10:33 GMT Subject: RFR: Fix NullPointerException on a parallel run [v5] In-Reply-To: References: Message-ID: On Thu, 1 Sep 2022 13:05:22 GMT, Jan Kratochvil wrote: > I see you have already done the `path == null ||` part so we are done, thanks! yep, could you please check that the current state of the main JTH branch allows you to unblock the testing in the configuration you are performing. ------------- PR: https://git.openjdk.org/jtharness/pull/35 From duke at openjdk.org Thu Sep 1 13:50:31 2022 From: duke at openjdk.org (gollayadav) Date: Thu, 1 Sep 2022 13:50:31 GMT Subject: RFR: 7903263: Feature Tests - Adding five JavaTest GUI legacy automated test scripts In-Reply-To: References: Message-ID: On Thu, 1 Sep 2022 12:56:21 GMT, Dmitry Bessonov wrote: > thanks for more tests, double checked with JDK8/MacOS Thank You for your time in reviewing the test scripts. ------------- PR: https://git.openjdk.org/jtharness/pull/36 From duke at openjdk.org Thu Sep 1 13:52:58 2022 From: duke at openjdk.org (gollayadav) Date: Thu, 1 Sep 2022 13:52:58 GMT Subject: Integrated: 7903263: Feature Tests - Adding five JavaTest GUI legacy automated test scripts In-Reply-To: References: Message-ID: On Fri, 26 Aug 2022 13:49:21 GMT, gollayadav wrote: > Adding below automated legacy JavaTest GUI feature Test Scripts to the Jemmy regression suite and tested locally on three platforms(Linux, Windows, Mac OS) and working fine. > > 1.New3.java > 2.New5.java > 3.New6.java > 4.New7.java > 5.New8.java This pull request has now been integrated. Changeset: 9149bb77 Author: golla.yadav at oracle.com Committer: Dmitry Bessonov URL: https://git.openjdk.org/jtharness/commit/9149bb776f4df5435a6f97d6bbf9b30af1086d5a Stats: 314 lines in 5 files changed: 314 ins; 0 del; 0 mod 7903263: Feature Tests - Adding five JavaTest GUI legacy automated test scripts Reviewed-by: dbessono ------------- PR: https://git.openjdk.org/jtharness/pull/36 From duke at openjdk.org Thu Sep 1 16:30:27 2022 From: duke at openjdk.org (Jan Kratochvil) Date: Thu, 1 Sep 2022 16:30:27 GMT Subject: RFR: Fix NullPointerException on a parallel run [v5] In-Reply-To: References: Message-ID: On Thu, 1 Sep 2022 11:41:47 GMT, Jan Kratochvil wrote: >> Error: Unexpected exception occurred! java.lang.NullPointerException >> java.lang.NullPointerException >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) >> at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) >> at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) >> at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) >> at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) >> at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) >> at com.sun.javatest.TestFinder.read(TestFinder.java:433) >> at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) >> at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) >> at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) >> at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) >> at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) >> at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) >> at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) >> at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) >> at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) >> at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) >> at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) >> at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) >> at com.sun.javatest.regtest.Main.main(Main.java:46) >> >> >> Some debug output showing the problem: >> >> scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir >> processFile file=/resultdir isAbsolute=true >> TestFinder.java read file=/resultdir isAbsolute=true >> scanFile caller file=/resultdir >> scanFile File=/resultdir >> TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ >> >> This happens with jtreg using `-w:resultdir` . `getRootRelativePath()` returns empty `""` path. Other option would be to return `"."` but in such case it broke some other code. >> >> This problem does not happen during a single run. It happens only when jtreg is being run in parallel, in my case: >> >> seq 1 100000|xargs -n1 -P64 ./runtest >> #! /bin/bash >> dir=result-test$$ >> rm -rf $dir >> mkdir $dir >> set -o pipefail >> (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 >> rm -rf $dir >> >> >> Unforunately I am not yet Author so I do not yet have a JBS account so I cannot file it to JBS (Java Bug System). > > Jan Kratochvil has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: > > Fix NullPointerException on a parallel run > > Error: Unexpected exception occurred! java.lang.NullPointerException > java.lang.NullPointerException > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntryInternal(TestProperties.java:515) > at com.sun.javatest.regtest.config.TestProperties$Cache.getEntry(TestProperties.java:502) > at com.sun.javatest.regtest.config.TestProperties.getEntry(TestProperties.java:170) > at com.sun.javatest.regtest.config.TestProperties.getTestNGRoot(TestProperties.java:123) > at com.sun.javatest.regtest.config.RegressionTestFinder.scanFile(RegressionTestFinder.java:143) > at com.sun.javatest.finder.TagTestFinder.scan(TagTestFinder.java:115) > at com.sun.javatest.TestFinder.read(TestFinder.java:433) > at com.sun.javatest.TRT_TreeNode.processFile(TRT_TreeNode.java:1259) > at com.sun.javatest.TRT_TreeNode.scanIfNeeded(TRT_TreeNode.java:807) > at com.sun.javatest.TRT_TreeNode.getTreeNode(TRT_TreeNode.java:616) > at com.sun.javatest.TestResultTable.findNode(TestResultTable.java:400) > at com.sun.javatest.TestResultTable.lookupNode(TestResultTable.java:533) > at com.sun.javatest.TestResultTable.lookupInitURL(TestResultTable.java:571) > at com.sun.javatest.TestResultTable.validatePath(TestResultTable.java:1000) > at com.sun.javatest.regtest.config.TestManager.validatePath(TestManager.java:299) > at com.sun.javatest.regtest.config.TestManager.getTests(TestManager.java:271) > at com.sun.javatest.regtest.tool.Tool.createParameters(Tool.java:1659) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1293) > at com.sun.javatest.regtest.tool.Tool.run(Tool.java:1082) > at com.sun.javatest.regtest.tool.Tool.main(Tool.java:155) > at com.sun.javatest.regtest.Main.main(Main.java:46) > > Some debug output showing the problem: > scanIfNeeded getRootRelativePath= separator=/ filesToScan[i]=resultdir > processFile file=/resultdir isAbsolute=true > TestFinder.java read file=/resultdir isAbsolute=true > scanFile caller file=/resultdir > scanFile File=/resultdir > TestProperties.java:dir=/ rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > TestProperties.java:dir=null rootDir=/home/azul/azul/zulu11-git/test/hotspot/jtreg file2=/resultdir file2.getParentFile()=/ > > This happens with jtreg using -w:resultdir . getRootRelativePath() > returns empty "" path. Other option would be to return "." but in such > case it broke some other code. > > This problem does not happen during a single run. It happens only when > jtreg is being run in parallel, in my case: > seq 1 100000|xargs -n1 -P64 ./runtest > #! /bin/bash > dir=result-test$$ > rm -rf $dir > mkdir $dir > set -o pipefail > (JAVA_HOME=$HOME/azul/zulu11-git/build/linux-x86_64-normal-server-release/images/jdk/; $JAVA_HOME/bin/java -classpath $HOME/azul/jtreg/build/images/jtreg/lib/jtreg.jar:$HOME/azul/jtreg/build/images/jtreg/lib/javatest.jar:$HOME/azul/jtreg/build/images/jtreg/lib/asmtools.jar com.sun.javatest.regtest.Main -testjdk:$JAVA_HOME -othervm -verbose -ignore:quiet -retain:all -a -conc:1 -timeout:10 -vmoptions:-XX:+UnlockExperimentalVMOptions -w:$dir -noreport -dir:$JAVA_HOME/../../../../test/jdk/ -nativepath:$JAVA_HOME/../test/hotspot/jtreg/native ../hotspot/jtreg/vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java |& tee $dir/err) || exit 255 > rm -rf $dir I have verified: https://github.com/jankratochvil/jtharness/tree/badnpe (=before this commit) does throw NPE https://github.com/jankratochvil/jtharness/tree/master does not throw NPE ------------- PR: https://git.openjdk.org/jtharness/pull/35 From dbessono at openjdk.org Thu Sep 1 17:28:23 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Thu, 1 Sep 2022 17:28:23 GMT Subject: RFR: Fix NullPointerException on a parallel run [v5] In-Reply-To: References: Message-ID: <_CTXdHSxf_m-IhV4zhQfaKr_w2w5JrUMkDx7MgmSrwM=.2487ae76-1702-4ef3-8833-56c048345c0b@github.com> On Thu, 1 Sep 2022 16:27:08 GMT, Jan Kratochvil wrote: > I have verified: https://github.com/jankratochvil/jtharness/tree/badnpe (=before this commit) does throw NPE https://github.com/jankratochvil/jtharness/tree/master does not throw NPE Thank you! Looks we could add a tag for b24 ------------- PR: https://git.openjdk.org/jtharness/pull/35 From djelinski at openjdk.org Mon Sep 19 12:20:26 2022 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Mon, 19 Sep 2022 12:20:26 GMT Subject: RFR: 6734346: harness reads too many files Message-ID: This patch fixes a long-standing issue where jtreg reads every java file under a test root (like test/jdk) when generating reports for jobs running a subset of tests. On a Windows machine, this reduces the time required to run a single (fast) test and generate report from 15-20 seconds to 1-3 seconds. Verified that the generated report looks correct; the report only contains tests that were actually run, so the extra work in scanning every java file was unnecessary. Did not verify if the existing tests still pass; I'm new to ant, and couldn't get it to run the tests. Are there any instructions I could use? ------------- Commit messages: - Avoid scanning the entire test root during report generation Changes: https://git.openjdk.org/jtharness/pull/38/files Webrev: https://webrevs.openjdk.org/?repo=jtharness&pr=38&range=00 Issue: https://bugs.openjdk.org/browse/CODETOOLS-6734346 Stats: 50 lines in 5 files changed: 19 ins; 27 del; 4 mod Patch: https://git.openjdk.org/jtharness/pull/38.diff Fetch: git fetch https://git.openjdk.org/jtharness pull/38/head:pull/38 PR: https://git.openjdk.org/jtharness/pull/38 From shade at openjdk.org Mon Sep 19 12:31:46 2022 From: shade at openjdk.org (Aleksey Shipilev) Date: Mon, 19 Sep 2022 12:31:46 GMT Subject: RFR: 6734346: harness reads too many files In-Reply-To: References: Message-ID: On Mon, 19 Sep 2022 12:12:31 GMT, Daniel Jeli?ski wrote: > This patch fixes a long-standing issue where jtreg reads every java file under a test root (like test/jdk) when generating reports for jobs running a subset of tests. > On a Windows machine, this reduces the time required to run a single (fast) test and generate report from 15-20 seconds to 1-3 seconds. > > Verified that the generated report looks correct; the report only contains tests that were actually run, so the extra work in scanning every java file was unnecessary. > > Did not verify if the existing tests still pass; I'm new to ant, and couldn't get it to run the tests. Are there any instructions I could use? For large suites, I work around the similar trouble with `JTREG="OPTIONS=-report:executed"` -- maybe we should (additionally?) change the default for `-report`? ------------- PR: https://git.openjdk.org/jtharness/pull/38 From djelinski at openjdk.org Mon Sep 19 13:27:58 2022 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Mon, 19 Sep 2022 13:27:58 GMT Subject: RFR: 6734346: harness reads too many files In-Reply-To: References: Message-ID: On Mon, 19 Sep 2022 12:28:12 GMT, Aleksey Shipilev wrote: >> This patch fixes a long-standing issue where jtreg reads every java file under a test root (like test/jdk) when generating reports for jobs running a subset of tests. >> On a Windows machine, this reduces the time required to run a single (fast) test and generate report from 15-20 seconds to 1-3 seconds. >> >> Verified that the generated report looks correct; the report only contains tests that were actually run, so the extra work in scanning every java file was unnecessary. >> >> Did not verify if the existing tests still pass; I'm new to ant, and couldn't get it to run the tests. Are there any instructions I could use? > > For large suites, I work around the similar trouble with `JTREG="OPTIONS=-report:executed"` -- maybe we should (additionally?) change the default for `-report`? Thanks @shipilev for pointing out that option; I completely missed that part of the code. Indeed, using `-report:executed` provides comparable performance. Checked out [CODETOOLS-7902474](https://bugs.openjdk.org/browse/CODETOOLS-7902474) where the `-report` option was introduced. It appears that the current behavior of scanning the entire directory is intentional, and my fix is incorrect. I'll withdraw this PR. IMO `-report:executed` should be the default, mostly because `all-executed` is too costly to be the default. ------------- PR: https://git.openjdk.org/jtharness/pull/38 From djelinski at openjdk.org Mon Sep 19 13:27:59 2022 From: djelinski at openjdk.org (Daniel =?UTF-8?B?SmVsacWEc2tp?=) Date: Mon, 19 Sep 2022 13:27:59 GMT Subject: Withdrawn: 6734346: harness reads too many files In-Reply-To: References: Message-ID: On Mon, 19 Sep 2022 12:12:31 GMT, Daniel Jeli?ski wrote: > This patch fixes a long-standing issue where jtreg reads every java file under a test root (like test/jdk) when generating reports for jobs running a subset of tests. > On a Windows machine, this reduces the time required to run a single (fast) test and generate report from 15-20 seconds to 1-3 seconds. > > Verified that the generated report looks correct; the report only contains tests that were actually run, so the extra work in scanning every java file was unnecessary. > > Did not verify if the existing tests still pass; I'm new to ant, and couldn't get it to run the tests. Are there any instructions I could use? This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jtharness/pull/38 From shade at openjdk.org Mon Sep 19 17:13:09 2022 From: shade at openjdk.org (Aleksey Shipilev) Date: Mon, 19 Sep 2022 17:13:09 GMT Subject: RFR: 6734346: harness reads too many files In-Reply-To: References: Message-ID: On Mon, 19 Sep 2022 12:12:31 GMT, Daniel Jeli?ski wrote: > This patch fixes a long-standing issue where jtreg reads every java file under a test root (like test/jdk) when generating reports for jobs running a subset of tests. > On a Windows machine, this reduces the time required to run a single (fast) test and generate report from 15-20 seconds to 1-3 seconds. > > Verified that the generated report looks correct; the report only contains tests that were actually run, so the extra work in scanning every java file was unnecessary. > > Did not verify if the existing tests still pass; I'm new to ant, and couldn't get it to run the tests. Are there any instructions I could use? Yeah, we need to seriously consider defaulting to `-report:executed`. ------------- PR: https://git.openjdk.org/jtharness/pull/38 From duke at openjdk.org Sun Sep 25 20:35:32 2022 From: duke at openjdk.org (gollayadav) Date: Sun, 25 Sep 2022 20:35:32 GMT Subject: RFR: 7903330: Feature Tests - Adding five JavaTest GUI legacy automated test scripts Message-ID: 7903330: Feature Tests - Adding five JavaTest GUI legacy automated test scripts ------------- Commit messages: - 7903330: Feature Tests - Adding five JavaTest GUI legacy automated feature test scripts Changes: https://git.openjdk.org/jtharness/pull/39/files Webrev: https://webrevs.openjdk.org/?repo=jtharness&pr=39&range=00 Issue: https://bugs.openjdk.org/browse/CODETOOLS-7903330 Stats: 345 lines in 7 files changed: 345 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jtharness/pull/39.diff Fetch: git fetch https://git.openjdk.org/jtharness pull/39/head:pull/39 PR: https://git.openjdk.org/jtharness/pull/39 From dbessono at openjdk.org Fri Sep 30 00:08:48 2022 From: dbessono at openjdk.org (Dmitry Bessonov) Date: Fri, 30 Sep 2022 00:08:48 GMT Subject: RFR: 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) Message-ID: 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) Noticed when running a test suite: java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Objects.java:233) at java.logging/java.util.logging.Logger.addHandler(Logger.java:2064) at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1481) at com.sun.javatest.TestSuite.createLog(TestSuite.java:1303) at com.sun.javatest.services.Service.createLog(Service.java:325) at com.sun.javatest.services.ServiceManager.setParameters(ServiceManager.java:133) at com.sun.javatest.services.ServiceManager.setHarness(ServiceManager.java:126) at com.sun.javatest.TestSuite.starting(TestSuite.java:546) at com.sun.jck.lib.JCKTestSuite.starting(JCKTestSuite.java:268) at com.sun.javatest.Harness.runTests(Harness.java:751) at com.sun.javatest.Harness.batch(Harness.java:447) at com.sun.javatest.batch.RunTestsCommand.run(RunTestsCommand.java:116) at com.sun.javatest.tool.CommandContext.runCommands(CommandContext.java:198) at com.sun.javatest.tool.Main.run(Main.java:427) at com.sun.javatest.tool.Main.main0(Main.java:139) at com.sun.javatest.tool.Main.main(Main.java:117) ------------- Commit messages: - 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) Changes: https://git.openjdk.org/jtharness/pull/40/files Webrev: https://webrevs.openjdk.org/?repo=jtharness&pr=40&range=00 Issue: https://bugs.openjdk.org/browse/CODETOOLS-7903336 Stats: 9 lines in 1 file changed: 2 ins; 2 del; 5 mod Patch: https://git.openjdk.org/jtharness/pull/40.diff Fetch: git fetch https://git.openjdk.org/jtharness pull/40/head:pull/40 PR: https://git.openjdk.org/jtharness/pull/40 From lkuskov at openjdk.org Fri Sep 30 01:55:29 2022 From: lkuskov at openjdk.org (Leonid Kuskov) Date: Fri, 30 Sep 2022 01:55:29 GMT Subject: RFR: 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 00:01:15 GMT, Dmitry Bessonov wrote: > 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) > > Noticed when running a test suite: > > java.lang.NullPointerException > at java.base/java.util.Objects.requireNonNull(Objects.java:233) > at java.logging/java.util.logging.Logger.addHandler(Logger.java:2064) > at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) > at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1481) > at com.sun.javatest.TestSuite.createLog(TestSuite.java:1303) > at com.sun.javatest.services.Service.createLog(Service.java:325) > at com.sun.javatest.services.ServiceManager.setParameters(ServiceManager.java:133) > at com.sun.javatest.services.ServiceManager.setHarness(ServiceManager.java:126) > at com.sun.javatest.TestSuite.starting(TestSuite.java:546) > at com.sun.jck.lib.JCKTestSuite.starting(JCKTestSuite.java:268) > at com.sun.javatest.Harness.runTests(Harness.java:751) > at com.sun.javatest.Harness.batch(Harness.java:447) > at com.sun.javatest.batch.RunTestsCommand.run(RunTestsCommand.java:116) > at com.sun.javatest.tool.CommandContext.runCommands(CommandContext.java:198) > at com.sun.javatest.tool.Main.run(Main.java:427) > at com.sun.javatest.tool.Main.main0(Main.java:139) > at com.sun.javatest.tool.Main.main(Main.java:117) src/com/sun/javatest/TestSuite.java line 1487: > 1485: private GeneralPurposeLogger(String name, WorkDirectory wd, String resourceBundleName, TestSuite ts) { > 1486: super(name, resourceBundleName); > 1487: this.logFileName = wd.getLogFileName(); hmm, this.logFileName = wd.getLogFileName(); ``` and the next line if wd != null Does this mean than wd can be null. if yes line 1486 provokes NPE ------------- PR: https://git.openjdk.org/jtharness/pull/40 From lkuskov at openjdk.org Fri Sep 30 02:01:31 2022 From: lkuskov at openjdk.org (Leonid Kuskov) Date: Fri, 30 Sep 2022 02:01:31 GMT Subject: RFR: 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 00:01:15 GMT, Dmitry Bessonov wrote: > 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) > > Noticed when running a test suite: > > java.lang.NullPointerException > at java.base/java.util.Objects.requireNonNull(Objects.java:233) > at java.logging/java.util.logging.Logger.addHandler(Logger.java:2064) > at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) > at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1481) > at com.sun.javatest.TestSuite.createLog(TestSuite.java:1303) > at com.sun.javatest.services.Service.createLog(Service.java:325) > at com.sun.javatest.services.ServiceManager.setParameters(ServiceManager.java:133) > at com.sun.javatest.services.ServiceManager.setHarness(ServiceManager.java:126) > at com.sun.javatest.TestSuite.starting(TestSuite.java:546) > at com.sun.jck.lib.JCKTestSuite.starting(JCKTestSuite.java:268) > at com.sun.javatest.Harness.runTests(Harness.java:751) > at com.sun.javatest.Harness.batch(Harness.java:447) > at com.sun.javatest.batch.RunTestsCommand.run(RunTestsCommand.java:116) > at com.sun.javatest.tool.CommandContext.runCommands(CommandContext.java:198) > at com.sun.javatest.tool.Main.run(Main.java:427) > at com.sun.javatest.tool.Main.main0(Main.java:139) > at com.sun.javatest.tool.Main.main(Main.java:117) src/com/sun/javatest/TestSuite.java line 1489: > 1487: this.logFileName = wd.getLogFileName(); > 1488: > 1489: if (wd != null) { then if wd always isn't null Then in the next codeblock `logFIleName` can be used instead of `wd.getLogFileName();` ------------- PR: https://git.openjdk.org/jtharness/pull/40 From lkuskov at openjdk.org Fri Sep 30 02:08:34 2022 From: lkuskov at openjdk.org (Leonid Kuskov) Date: Fri, 30 Sep 2022 02:08:34 GMT Subject: RFR: 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 00:01:15 GMT, Dmitry Bessonov wrote: > 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) > > Noticed when running a test suite: > > java.lang.NullPointerException > at java.base/java.util.Objects.requireNonNull(Objects.java:233) > at java.logging/java.util.logging.Logger.addHandler(Logger.java:2064) > at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) > at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1481) > at com.sun.javatest.TestSuite.createLog(TestSuite.java:1303) > at com.sun.javatest.services.Service.createLog(Service.java:325) > at com.sun.javatest.services.ServiceManager.setParameters(ServiceManager.java:133) > at com.sun.javatest.services.ServiceManager.setHarness(ServiceManager.java:126) > at com.sun.javatest.TestSuite.starting(TestSuite.java:546) > at com.sun.jck.lib.JCKTestSuite.starting(JCKTestSuite.java:268) > at com.sun.javatest.Harness.runTests(Harness.java:751) > at com.sun.javatest.Harness.batch(Harness.java:447) > at com.sun.javatest.batch.RunTestsCommand.run(RunTestsCommand.java:116) > at com.sun.javatest.tool.CommandContext.runCommands(CommandContext.java:198) > at com.sun.javatest.tool.Main.run(Main.java:427) > at com.sun.javatest.tool.Main.main0(Main.java:139) > at com.sun.javatest.tool.Main.main(Main.java:117) src/com/sun/javatest/TestSuite.java line 1491: > 1489: if (!handlersMap.containsKey(wd.getLogFileName())) { > 1490: WorkDirLogHandler wdlh = new WorkDirLogHandler(ts.getObservedFile(wd)); > 1491: handlersMap.put(wd.getLogFileName(), wdlh); Actually HashMap might have `null` (unlike `ConcurrentHashMap`) value i.e. wdhl can be null. So if wdlh is null this fact will be only seen in line 1494. Where agains isn't needed to get wdlh which is already known in line 1409. src/com/sun/javatest/TestSuite.java line 1494: > 1492: } > 1493: > 1494: addHandler(handlersMap.get(wd.getLogFileName())); this line could be `addHandler(wdlh);` ------------- PR: https://git.openjdk.org/jtharness/pull/40 From lkuskov at openjdk.org Fri Sep 30 02:14:31 2022 From: lkuskov at openjdk.org (Leonid Kuskov) Date: Fri, 30 Sep 2022 02:14:31 GMT Subject: RFR: 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 00:01:15 GMT, Dmitry Bessonov wrote: > 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) > > Noticed when running a test suite: > > java.lang.NullPointerException > at java.base/java.util.Objects.requireNonNull(Objects.java:233) > at java.logging/java.util.logging.Logger.addHandler(Logger.java:2064) > at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) > at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1481) > at com.sun.javatest.TestSuite.createLog(TestSuite.java:1303) > at com.sun.javatest.services.Service.createLog(Service.java:325) > at com.sun.javatest.services.ServiceManager.setParameters(ServiceManager.java:133) > at com.sun.javatest.services.ServiceManager.setHarness(ServiceManager.java:126) > at com.sun.javatest.TestSuite.starting(TestSuite.java:546) > at com.sun.jck.lib.JCKTestSuite.starting(JCKTestSuite.java:268) > at com.sun.javatest.Harness.runTests(Harness.java:751) > at com.sun.javatest.Harness.batch(Harness.java:447) > at com.sun.javatest.batch.RunTestsCommand.run(RunTestsCommand.java:116) > at com.sun.javatest.tool.CommandContext.runCommands(CommandContext.java:198) > at com.sun.javatest.tool.Main.run(Main.java:427) > at com.sun.javatest.tool.Main.main0(Main.java:139) > at com.sun.javatest.tool.Main.main(Main.java:117) src/com/sun/javatest/TestSuite.java line 1493: > 1491: handlersMap.computeIfAbsent( > 1492: wd.getLogFileName(), fileName -> new WorkDirLogHandler(ts.getObservedFile(wd)) > 1493: ) This new code block garanties a thread safe puting pair `this.logFIleName` & `wdlh`into Map. But `handlersMap.computeIfAbsent` will throw NPE if `new WorkDirLogHandler(ts.getObservedFile(wd)` is null, because `null` value in `ConcurrentHashMap` isn't allowed. ------------- PR: https://git.openjdk.org/jtharness/pull/40 From lkuskov at openjdk.org Fri Sep 30 02:19:33 2022 From: lkuskov at openjdk.org (Leonid Kuskov) Date: Fri, 30 Sep 2022 02:19:33 GMT Subject: RFR: 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 00:01:15 GMT, Dmitry Bessonov wrote: > 7903336: java.lang.NullPointerException: at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) > > Noticed when running a test suite: > > java.lang.NullPointerException > at java.base/java.util.Objects.requireNonNull(Objects.java:233) > at java.logging/java.util.logging.Logger.addHandler(Logger.java:2064) > at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1494) > at com.sun.javatest.TestSuite$GeneralPurposeLogger.(TestSuite.java:1481) > at com.sun.javatest.TestSuite.createLog(TestSuite.java:1303) > at com.sun.javatest.services.Service.createLog(Service.java:325) > at com.sun.javatest.services.ServiceManager.setParameters(ServiceManager.java:133) > at com.sun.javatest.services.ServiceManager.setHarness(ServiceManager.java:126) > at com.sun.javatest.TestSuite.starting(TestSuite.java:546) > at com.sun.jck.lib.JCKTestSuite.starting(JCKTestSuite.java:268) > at com.sun.javatest.Harness.runTests(Harness.java:751) > at com.sun.javatest.Harness.batch(Harness.java:447) > at com.sun.javatest.batch.RunTestsCommand.run(RunTestsCommand.java:116) > at com.sun.javatest.tool.CommandContext.runCommands(CommandContext.java:198) > at com.sun.javatest.tool.Main.run(Main.java:427) > at com.sun.javatest.tool.Main.main0(Main.java:139) > at com.sun.javatest.tool.Main.main(Main.java:117) >From my point of view the corner case isn't "non thread safe" HashMap but it is potential null of `new WorkDirLogHandler(ts.getObservedFile(wd)` . This code can use only 2 HashMap commands: 1. ` if (!handlersMap.containsKey(logFileName) {` and 2. ` handlersMap.put(logFileName, wdlh);` if wdlh isn't `null` 3. and the last command of the block is `addHandler(wdlh);` ------------- PR: https://git.openjdk.org/jtharness/pull/40