criu icon indicating copy to clipboard operation
criu copied to clipboard

Report first error from RPC always!

Open xemul opened this issue 7 years ago • 3 comments

In RPC we report back the first error message met. But this is not always the case.

See commit f1a9cd4d. The problem is that pre_dump_using_req() calls fork() to do the pre-dump itself. The called function cr_pre_dump_tasks() calls log_keep_err() to keep the message, then the task exits. Its parent, which sits in the pre_dump_using_req() then tries to get the first err by calling log_first_err(), but there's no error there, it's been set in the child task.

Need some way to get the error back. E.g. by setting up the error message buffer in parent, or by sending the RPC response from child.

xemul avatar Jun 29 '17 08:06 xemul

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Jan 21 '21 00:01 github-actions[bot]

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Apr 04 '21 00:04 github-actions[bot]

Hi there, I have some questions regarding the description of this specific issue. The statement reads, "The called function cr_pre_dump_tasks() calls log_keep_err() to keep the message, then the task exits." This implies that the call chain is pre_dump_using_req() -> fork -> cr_pre_dump_tasks() -> log_keep_err(), which means that the child process initializes the error message, causing the parent process to only be able to return NULL when reporting an error(in log_first_err() ).

However, I found that log_keep_err() is only called by setup_opts_from_req(), with the call chain being pre_dump_using_req() -> fork -> setup_opts_from_req -> log_keep_err(). Therefore, the child process is the one setting the error message.

I would like to know if I am misunderstanding the problem
if there is an error in the issue description
if the issue has already been resolved?

Thank you for all your help. :)

Daz-3ux avatar Apr 03 '23 10:04 Daz-3ux