From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/kill11: add a check between hard limit and MIN_RLIMIT_CORE
Date: Wed, 12 Feb 2020 14:11:17 +0800 [thread overview]
Message-ID: <5E439705.4010303@cn.fujitsu.com> (raw)
In-Reply-To: <1581486286-13615-1-git-send-email-xuyang2018.jy@cn.fujitsu.com>
On 2020/2/12 13:44, Yang Xu wrote:
> Currently, running this case will report EINVAL error if I run "ulimit -c
> 1023" command firstly. From setrlimit(2)manpage, it got EINVAL error because
> rlim->rlim_cur was greater than rlim->rlim_max. So add a check for it before
> setrlimit.
Hi Xu,
It seems better to fix the issue by setting both rlim_cur and rlimit_max
to the MIN_RLIMIT_CORE.
Thanks,
Xiao Yang
> Reported-by: Pankaj Vinadrao Joshi<Pankaj.VJ@exaleapsemi.com>
> Signed-off-by: Yang Xu<xuyang2018.jy@cn.fujitsu.com>
> ---
> testcases/kernel/syscalls/kill/kill11.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/testcases/kernel/syscalls/kill/kill11.c b/testcases/kernel/syscalls/kill/kill11.c
> index 83fba5beb..5f70b0a07 100644
> --- a/testcases/kernel/syscalls/kill/kill11.c
> +++ b/testcases/kernel/syscalls/kill/kill11.c
> @@ -201,6 +201,9 @@ void setup(void)
>
> SAFE_GETRLIMIT(NULL, RLIMIT_CORE,&rlim);
>
> + if (rlim.rlim_max< MIN_RLIMIT_CORE)
> + tst_brkm(TCONF, NULL, "hard limit(%lu)less than MIN_RLIMT_CORE(%i)",
> + rlim.rlim_max, MIN_RLIMIT_CORE);
> if (rlim.rlim_cur< MIN_RLIMIT_CORE) {
> tst_resm(TINFO, "Adjusting RLIMIT_CORE to %i", MIN_RLIMIT_CORE);
> rlim.rlim_cur = MIN_RLIMIT_CORE;
next prev parent reply other threads:[~2020-02-12 6:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-12 5:44 [LTP] [PATCH] syscalls/kill11: add a check between hard limit and MIN_RLIMIT_CORE Yang Xu
2020-02-12 6:11 ` Xiao Yang [this message]
2020-02-12 6:41 ` Yang Xu
2020-02-12 13:32 ` Jan Stancek
2020-02-13 1:43 ` Yang Xu
2020-02-13 8:35 ` Jan Stancek
2020-02-13 8:41 ` Yang Xu
2020-02-13 10:11 ` Yang Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5E439705.4010303@cn.fujitsu.com \
--to=yangx.jy@cn.fujitsu.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox