[LTP] [Question] Why test C API failed in github CI
Li Wang
liwang@redhat.com
Wed Dec 22 07:35:27 CET 2021
On Tue, Dec 21, 2021 at 9:02 PM Cyril Hrubis <chrubis@suse.cz> wrote:
> Hi!
> > Firstly, I'm sorry to push the patchset about oom protection cursorily.
>
> No problem.
>
> > The GitHub CI complained about the following failures, I feel confused
> > when I add a bit of debug code in my private branch then. It gets passed
> > in access(score_path, R_OK|W_OK) but failed in closing the file and
> > give no EACCESS errno, that's wired.
> >
> > Did I miss anything?
> >
> > https://github.com/wangli5665/ltp/runs/4594473907?check_suite_focus=true
>
> It does fail the same for me locally when I run the test05 under an
> unpriviledged user. I guess that the error when we write negative number
> to the file actually manifests when we attempt to close the file because
> we use the FILE interface in safe_file_printf(). That way the actuall
> write is buffered and deffered until the fclose() call.
>
Sounds possible.
>
> So it looks like writing negative value to the file does return with
> error for an unprivileged user.
>
> I was looking at file_printf() as a potential solution, but that one
> does produce warnings. But it looks like we do not actually use the
> file_printf() function anywhere in the code so we may as well change it
> so that it just returns if the operation was successful or not and make
> it silent so that it does not produce any messages at all.
>
+1 It makes sense to keep silent when the operation is not successful.
That needs an explicit difference between safe_file_printf() I guess.
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20211222/c3d6abbc/attachment.htm>
More information about the ltp
mailing list