RFR: 8273967: gtest os.dll_address_to_function_and_library_name_vm fails on macOS12 [v2]
Daniel D.Daugherty
dcubed at openjdk.java.net
Thu Nov 4 22:59:39 UTC 2021
> macOS12 has changed the dladdr() function to accept "-1" as a valid address and
> we have functions that use dladdr() to convert DLL addresses into function or
> library names. We also have a gtest that verifies that "-1" is not a valid value to use
> as a symbol address.
>
> As you might imagine, existing code that uses `os::dll_address_to_function_name()`
> or `os::dll_address_to_library_name()` can get quite confused (and sometimes crash)
> if an `addr` parameter of `-1` was allowed to be used.
>
> I've also made two cleanup changes as part of this fix:
>
> 1) In `src/hotspot/os/bsd/os_bsd.cpp` there is some macOS specific code that should
> be properly `#ifdef`'ed. There is also some code that makes sense for ELF format
> files, but not for Mach-O format files so that code needs to be excluded on macOS.
>
> 2) In `src/hotspot/share/runtime/os.cpp` I noticed a simple typo in a comment on an
> `#endif` that I fixed. That typo does not appear anywhere else in the HotSpot code
> base so I'd like to fix it with this bug ID since I'm in related areas.
>
> This fix has been tested with Mach5 Tier[1-6].
Daniel D. Daugherty has updated the pull request incrementally with one additional commit since the last revision:
8273967.cr1.patch
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/6193/files
- new: https://git.openjdk.java.net/jdk/pull/6193/files/f57d7f0d..ecb230d6
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6193&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6193&range=00-01
Stats: 48 lines in 1 file changed: 16 ins; 28 del; 4 mod
Patch: https://git.openjdk.java.net/jdk/pull/6193.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/6193/head:pull/6193
PR: https://git.openjdk.java.net/jdk/pull/6193
More information about the serviceability-dev
mailing list