RFR: 8353189: [ASAN] memory leak after 8352184

David Holmes dholmes at openjdk.org
Mon Apr 7 13:14:37 UTC 2025


On Fri, 28 Mar 2025 16:40:44 GMT, SendaoYan <syan at openjdk.org> wrote:

> Hi all,
> 
> This PR will try to fix memory leak after JDK-8352184. which re-do [JDK-8352184](https://bugs.openjdk.org/browse/JDK-8352184) using the original, purely static uses of the various description strings, as [~jiangli] had proposed.
> 
> Additional testing:
> 
> - [ ] jtreg tests(include tier1/2/3 etc.) on linux-x64
> - [ ] jtreg tests(include tier1/2/3 etc.) on linux-aarch64
> - [x] full `java -version` tests, the test shell script show as below.
> 
> [JDK-8353189.sh.txt](https://github.com/user-attachments/files/19632637/JDK-8353189.sh.txt)

You can't just free the result as it may not have always been malloc'd. The intention/expectation was that this was a one-off allocation in VM_version_string that was never freed.

I was also going to suggest caching the vm_info string as it should be the same all the time. I think you have discovered a bug in the way the info is being requested before arguments (like Xcomp) have been processed. That would cause the wrong info string to be recorded by the early callers.

I think I should file a separate bug to deal with the problem that the info string can be used before its true value is actually known.

After looking into the details ([JDK-8353595](https://bugs.openjdk.org/browse/JDK-8353595)) I don't think there is any choice but to re-do [JDK-8352184](https://bugs.openjdk.org/browse/JDK-8352184) using the original, purely static uses of the various description strings, as [~jiangli] had proposed.

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

PR Comment: https://git.openjdk.org/jdk/pull/24299#issuecomment-2764934750
PR Comment: https://git.openjdk.org/jdk/pull/24299#issuecomment-2771197885
PR Comment: https://git.openjdk.org/jdk/pull/24299#issuecomment-2771572452
PR Comment: https://git.openjdk.org/jdk/pull/24299#issuecomment-2781692889


More information about the hotspot-dev mailing list