criu: show excerpt from log file on c/r error#2030
Merged
giuseppe merged 2 commits intocontainers:mainfrom Mar 5, 2026
Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
Ephemeral COPR build failed. @containers/packit-build please check. |
119f93e to
7b81b77
Compare
308cde1 to
22993af
Compare
This comment was marked as outdated.
This comment was marked as outdated.
f3dce20 to
d7c4713
Compare
|
TMT tests failed. @containers/packit-build please check. |
Collaborator
Author
|
Ah, finally got it! |
474d829 to
9c8fab4
Compare
giuseppe
reviewed
Mar 4, 2026
src/libcrun/criu.c
Outdated
| return; | ||
| if (pid == 0) | ||
| { | ||
| char *const args[] = { "grep", "-n", "-B5", "Error", log_path, NULL }; |
Member
There was a problem hiding this comment.
how much information is in the -B5 lines? Without this flag, we could ~easily rewrite this to be a combination of fopen/fgets/has_prefix. The -B5 makes it a bit more difficult (the ring buffer implementation we have accounts for bytes, not lines)
Collaborator
Author
There was a problem hiding this comment.
Not all criu errors are self-explanatory, so -B5 add some context to where the error has happened. Yet I guess just printing errors is better than referring to the log file, so let me work on it.
has_prefix won't work though, as criu log usually contain timestamps.
In case criu_check_mem_track failed, or returned that kernel memory tracking is not supported, don't refer to CRIU log file. Kernel memory tracking is supported since kernel v3.11 (and further improved in v3.18) and so we can assume it's supported. If not, a simple message should be sufficient, and CRIU log _probably_ does not contain any further details. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This is a brute way to see some CRIU logs in CI when C/R fails. The output looks like this: $ sudo /home/kir//git/crun/crun checkpoint 123 2026-03-04T22:28:17.146850Z: --- excerpt from CRIU log `/home/kir/git/runc-tst/checkpoint/dump.log` 2026-03-04T22:28:17.147043Z: (00.138480) Error (criu/files-reg.c:1790): Can't lookup mount=40 for fd=0 path=/dev/pts/5 (deleted) 2026-03-04T22:28:17.147054Z: (00.138490) Error (criu/cr-dump.c:1698): Dump files (pid: 353704) failed with -1 2026-03-04T22:28:17.147061Z: (00.211227) Error (criu/cr-dump.c:2128): Dumping FAILED. 2026-03-04T22:28:17.147074Z: --- end of excerpt 2026-03-04T22:28:17.147222Z: CRIU checkpointing failed: -52: Invalid exchange Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
crui: simplify criu_check_mem_track error message.
In case criu_check_mem_track failed, or returned that kernel memory
tracking is not supported, don't refer to CRIU log file.
Kernel memory tracking is supported since kernel v3.11 (and further
improved in v3.18) and so we can assume it's supported. If not, a
simple message should be sufficient, and CRIU log probably does
not contain any further details.
criu: show excerpt from log file on c/r error
This is a brute way to see some CRIU logs in CI when C/R fails.
The output looks like this: