RFR: 8337221: CompileFramework: test library to conveniently compile java and jasm sources for fuzzing

Emanuel Peter epeter at openjdk.org
Thu Sep 12 15:57:28 UTC 2024


On Mon, 29 Jul 2024 06:27:20 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/lib/compile_framework/CompileFramework.java line 28:
>> 
>>> 26: import compiler.lib.compile_framework.SourceCode;
>>> 27: import compiler.lib.compile_framework.CompileFrameworkException;
>>> 28: import compiler.lib.compile_framework.InternalCompileFrameworkException;
>> 
>> Not needed?
>
> What do you mean? I have multiple uses in the file.

I want to separate exceptions where the user is responsible, and internal exceptions that should never happen (otherwise there is a bug in the CompileFramework).

>> test/hotspot/jtreg/compiler/lib/compile_framework/CompileFramework.java line 87:
>> 
>>> 85:         final String sourceDir;
>>> 86:         try {
>>> 87:             sourceDir = "compile-framework-sources-" + ProcessTools.getProcessId();
>> 
>> Make it MT-safe, say by utilising the `File.createTempFile(prefix, suffix, directory)`?
>
> I would like the generated and saved files to be available int the `JTWork/scratch` directory. This allows us to download the source-code of a reproducer from our CI pipeline when there is a failure. Is that possible with `File.createTempFile` as well?

But what exactly could go wrong here? The "compile" method is to be called in a single-threaded way. This thread should have a unique `ProcessTools.getProcessId`, right? So no two processes should be generating the same directory.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20184#discussion_r1694853936
PR Review Comment: https://git.openjdk.org/jdk/pull/20184#discussion_r1694784308


More information about the hotspot-compiler-dev mailing list