RFR: 8344883: Force clients to explicitly pass mem_tag value, even if it is mtNone [v7]

Stefan Karlsson stefank at openjdk.org
Wed Apr 2 07:53:22 UTC 2025


On Wed, 2 Apr 2025 07:36:56 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Gerard Ziemski has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove default value parameter if it's false from os::reserve_memory
>
> You keep leaving comments that ExecMem is a parameter. That doesn't make sense. ExecMem is a constant.

> @stefank After changing various `mtNone` tags to `mtTest` we now are seeing build failures:
> 
> ```
> #  Internal Error (/Users/runner/work/jdk/jdk/src/hotspot/share/nmt/virtualMemoryTracker.cpp:427), pid=79835, tid=8707
> #  assert(reserved_rgn->mem_tag() == mtNone) failed: Overwrite memory tag (should be mtNone, is: "Test")
> ```
> 
> I reverted to the last passing commit [40cb438](https://github.com/openjdk/jdk/pull/24282/commits/40cb4384f17ad63c1374ea785f76e415a44eb426) and re-do this step in a follow-up.

The problem was that you didn't do what I suggested. I suggested that you changed one occurrence to be mtMetaspace:
https://github.com/openjdk/jdk/pull/24282#discussion_r2018124074

But you changed it to be mtTest:
https://github.com/openjdk/jdk/pull/24282/commits/f0ccc7f79e5a821cf632d1e0e898dad3254a2f0b

and this causes the crash above.

Do you know that you can just accept the proposed changes in the GitHub UI? I think that would prevent bugs like this.

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

PR Comment: https://git.openjdk.org/jdk/pull/24282#issuecomment-2771625260


More information about the hotspot-dev mailing list