[LTP] [Question] Why test C API failed in github CI

Cyril Hrubis chrubis@suse.cz
Tue Dec 21 14:03:43 CET 2021


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.

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.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list