[crac] RFR: Fix crash after shm_open failure [v2]

Anton Kozlov akozlov at openjdk.java.net
Wed Jun 8 15:46:01 UTC 2022


On Wed, 8 Jun 2022 13:25:49 GMT, Dan Heidinga <heidinga at openjdk.org> wrote:

>> Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Handle read_from returning NULL
>
> src/hotspot/os/linux/os_linux.cpp line 6146:
> 
>> 6144: 
>> 6145:     delete _restore_parameters;
>> 6146:     _restore_parameters = CracRestoreParameters::read_from(shmfd);
> 
> `CracRestoreParameters::read_from` can return NULL.  If we need to ensure `_restore_parameters` is not null, then we need to do something like this instead:
> 
> Suggestion:
> 
>     CracRestoreParameters *original_parameters = _restore_parameters;
>     _restore_parameters = CracRestoreParameters::read_from(shmfd);
>     if (_restore_parameters == NULL) {
>       _restore_parameters = original_parameters;
>     } else {
>       delete original_parameters;
>    }

Indeed, thanks! Fixed

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

PR: https://git.openjdk.java.net/crac/pull/23


More information about the crac-dev mailing list