[crac] RFR: 8378446: [CRaC] Replace libcrexec with libcriuengine [v3]
Radim Vansa
rvansa at openjdk.org
Fri Feb 27 08:34:04 UTC 2026
On Fri, 27 Feb 2026 07:45:18 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:
>> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Address review comments
>
> src/java.base/linux/native/libcriuengine/criuengine.cpp line 109:
>
>> 107: }
>> 108:
>> 109: class ArgsBuilder {
>
> The class could've been more robust:
> - Non-copyable (or with proper copying implemented)
> - Initialize `_args[0]` to null, or just the whole array instead of managing last-is-null dynamically
> - Assert that `append_all` is not used multiple times (`_from_env` and `_from_opts` are null)
> - Assert that no methods are called when `_failed` is true
>
> But since, as far as I can see, currently it is used in a way that the above won't fail I don't insist.
While generally safer, I dislike polluting the code with prohibited copy constructor & operator. That makes sense for public classes, but not really for internal utilities like this.
`memset(_args, ...)` is a good point. I had the terminating `nullptr` set in `argv()` but that breaks the constness.
> src/java.base/linux/native/libcriuengine/criuengine.cpp line 119:
>
>> 117: void fill_args(const char* from, char* copy) {
>> 118: char* saveptr = nullptr;
>> 119: char* arg = strtok_r(copy, " ", &saveptr);
>
> Strange to have both `char*` and `char *` in the same class
My bad. We need a linter; otherwise my eyes don't get triggered by `char *` but with `char* `.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/297#discussion_r2863163862
PR Review Comment: https://git.openjdk.org/crac/pull/297#discussion_r2863168213
More information about the crac-dev
mailing list