[CRIU] [PATCH] Show error messages when failing early in the init process

Nicolas Viennot Nicolas.Viennot at twosigma.com
Thu Sep 19 20:34:25 MSK 2019


Hello,

The commit introducing early log flush (c2cf4cfdc) resolved this issue.

Nico

-----Original Message-----
From: Dmitry Safonov <0x7f454c46 at gmail.com> 
Sent: Wednesday, September 11, 2019 7:47 AM
To: Nicolas Viennot <Nicolas.Viennot at twosigma.com>; Adrian Reber <adrian at lisas.de>
Cc: criu at openvz.org
Subject: Re: [CRIU] [PATCH] Show error messages when failing early in the init process

Hi Nicolas,


On Sat, 7 Sep 2019 at 07:57, Nicolas Viennot <Nicolas.Viennot at twosigma.com> wrote:
[..]
> @@ -162,7 +165,8 @@ int main(int argc, char *argv[], char *envp[])
>                 pr_warn("Stopped and detached shell job will get 
> SIGHUP from OS.\n");
>
>         if (chdir(opts.work_dir)) {
> -               pr_perror("Can't change directory to %s", opts.work_dir);
> +               pr_msg("Error: Can't change directory to %s: %s\n",
> +                      opts.work_dir, strerror(errno));
>                 return 1;
>         }

Please, separate this part from the rest of the patch.
This doesn't look like a proper fix.

Also, I believe it should go into early buffer.
+Cc: Adrian

The reason you don't see the message is probably because criu exits earlier than flushes that early print buffer. I would think that the better fix would be to flush the early buffer in a function with __attribute__((destructor))..

Thanks,
             Dmitry



More information about the CRIU mailing list