[crac] RFR: Print better diagnostics for spawning CRIU
Jan Kratochvil
jkratochvil at openjdk.org
Fri Aug 4 06:28:57 UTC 2023
On Wed, 2 Aug 2023 17:15:17 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:
>> It was always a mystery why it does not work this time as there are no error messages printed.
>> Still may system call errors are currently not reported but those errors at least do not happen commonly.
>> In fact `os::exec_child_process_and_wait` should be more verbose but that is already a part of OpenJDK so I did not modify it.
>> It would be much easier if `criuengine.c` was in C++. I was considering to switch it but then I wrote it already in C.
>> I understand this code will become obsolete after planned integration of CRIU into JVM but it may not yet be soon enough.
>
> src/java.base/unix/native/criuengine/criuengine.c line 101:
>
>> 99: char *retval;
>> 100: if (path2[0] == '/') {
>> 101: retval = strdup(path2);
>
> path_join apparently uses path1 only if path2 is relative, otherwise just returns path2. It's unclear from the function name. This looks more like
>
> static char *path_from(const char *cwd, const char *path) {
> // compute abs path to `path` with the workdir `cwd` assumed
> }
The function name corresponds to: https://docs.python.org/3/library/os.path.html#os.path.join
> If a segment is an absolute path, then all previous segments are ignored and joining continues from the absolute path segment.
The function first parameter is not always used for `cwd`.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/97#discussion_r1284032585
More information about the crac-dev
mailing list