Integrated: JDK-8303069: Memory leak in CompilerOracle::parse_from_line
Damon Fenacci
duke at openjdk.org
Fri Mar 17 13:28:34 UTC 2023
On Thu, 16 Mar 2023 14:08:13 GMT, Damon Fenacci <duke at openjdk.org> wrote:
> A memory leak has been detected using *lsan* when running the `compiler/blackhole/BlackholeExperimentalUnlockTest.java` test.
>
> This happens when parsing the *blackhole* *CompileCommand*. There is a check for the `-XX:+UnlockExperimentalVMOptions` flag being enabled when *blackhole* is used. If this flag is not set, a warning gets printed and the *CompileCommand* is not taken.
>
> Unfortunately this happens in `register_commands` where commands are supposed to be added to a list. In this case we bail out and the option is neither added nor deleted.
>
> https://github.com/openjdk/jdk/blob/f629152021d4ce0288119c47d5a111b87dce1de6/src/hotspot/share/compiler/compilerOracle.cpp#L310-L313
>
> So, this changes deletes the `matcher` object before returning. This is done in `register_commands` (the callee) mainly because a couple of other similar checks are also done in this function.
>
> The other option would have been to move the check to the caller (the only one for this case) before `register_command`:
> https://github.com/openjdk/jdk/blob/f629152021d4ce0288119c47d5a111b87dce1de6/src/hotspot/share/compiler/compilerOracle.cpp#L915-L917
> but it seemed less appropriate (no other similar checks).
>
> Letting it handle like other experimental flags (code below) is not an option either since in this case we have to do with a `CompileCommand`.
> https://github.com/openjdk/jdk/blob/f629152021d4ce0288119c47d5a111b87dce1de6/src/hotspot/share/runtime/flags/jvmFlag.cpp#L112-L118
This pull request has now been integrated.
Changeset: 384a8b85
Author: Damon Fenacci <damon.fenacci at oracle.com>
Committer: Tobias Hartmann <thartmann at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/384a8b85a7266b920242ea73baf578577ca588ec
Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod
8303069: Memory leak in CompilerOracle::parse_from_line
Reviewed-by: thartmann, jcking
-------------
PR: https://git.openjdk.org/jdk/pull/13060
More information about the hotspot-compiler-dev
mailing list