RFR: 8313816: Accessing jmethodID might lead to spurious crashes [v8]

Jaroslav Bachorik jbachorik at openjdk.org
Fri Nov 24 11:27:08 UTC 2023


On Fri, 24 Nov 2023 05:47:14 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Jaroslav Bachorik has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Reinstate mistakenly deleted comment
>
> This has gotten a lot more complicated. All I was suggesting was if this:
> 
> if (with_method_holders) {
>   method->clear_jmethod_id();
> }
> 
> could be changed to 
> 
> if (method->method_holder() == nullptr) {
>   method->clear_jmethod_id();
> }
> 
> Now I'm not at all sure what you are doing.

@dholmes-ora Unfortunately, I can not just do `method->method_holder() == nullptr` as `method_holder()` is expanding to `Method::constants()->pool_holder()` and `Method::constants()` is expanding to `Method::constMethod()->constants()`. This can cause SIGSEGV if either `Method::_constMethod` or `ConstMethod::_constants` is NULL.

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

PR Comment: https://git.openjdk.org/jdk/pull/16662#issuecomment-1825532431


More information about the hotspot-dev mailing list