RFR: 8279887: 2 Null pointer dereference defect groups in os_posix.cpp [v2]

David Holmes dholmes at openjdk.java.net
Wed Jan 19 22:43:49 UTC 2022


On Wed, 19 Jan 2022 19:56:21 GMT, Harold Seigel <hseigel at openjdk.org> wrote:

>> Please review this small fix to prevent possible Null pointer dereferences.  The fix adds a Null check to prevent trying to park a Null thread.  The Null check is needed because UNSAFE_ENTRY calls thread_from_jni_environment(), which returns NULL if the env thread is terminated. 
>> 
>> The fix was tested with Mach5 tiers 1-2 on Linux, Mac OS, and Windows, and Mach5 tiers 3-5 on Linux x64.
>> 
>> Thanks, Harold
>
> Harold Seigel has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add comment

When the static analysis tool is wrong we ignore it and give feedback to the tool authors. We don't pollute our code with unnecessary checks for impossible situations. We have hit this many times in the past with parfait because it could not track state across the Java->VM boundary, for example.

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

PR: https://git.openjdk.java.net/jdk/pull/7129


More information about the hotspot-dev mailing list