<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 3, 2019 at 12:11 AM Jan Stancek <<a href="mailto:jstancek@redhat.com">jstancek@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
----- Original Message -----<br>
> On Mon, Jul 1, 2019 at 7:01 PM Jan Stancek <<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.com</a>> wrote:<br>
> <br>
> ><br>
> ><br>
> > ----- Original Message -----<br>
> > > Signed-off-by: Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>><br>
> > > Cc: Jan Stancek <<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.com</a>><br>
> > > ---<br>
> > > include/tst_safe_macros.h | 16 ++++++++++++++++<br>
> > > testcases/kernel/security/umip/umip_basic_test.c | 2 ++<br>
> > > testcases/kernel/syscalls/ipc/shmat/shmat01.c | 16 +++-------------<br>
> > > 3 files changed, 21 insertions(+), 13 deletions(-)<br>
> > ><br>
> > > diff --git a/include/tst_safe_macros.h b/include/tst_safe_macros.h<br>
> > > index 53a888c80..110e2984f 100644<br>
> > > --- a/include/tst_safe_macros.h<br>
> > > +++ b/include/tst_safe_macros.h<br>
> > > @@ -394,6 +394,22 @@ static inline int safe_setrlimit(const char *file,<br>
> > const<br>
> > > int lineno,<br>
> > > #define SAFE_SETRLIMIT(resource, rlim) \<br>
> > > safe_setrlimit(__FILE__, __LINE__, (resource), (rlim))<br>
> > ><br>
> > > +/*<br>
> > > + * Crash is expected, avoid dumping corefile.<br>
> > > + * 1 is a special value, that disables core-to-pipe.<br>
> > > + * At the same time it is small enough value for<br>
> > > + * core-to-file, so it skips creating cores as well.<br>
> > > + */<br>
> > > +static inline void tst_no_corefile(void)<br>
> > > +{<br>
> > > + struct rlimit r;<br>
> > > +<br>
> > > + r.rlim_cur = 1;<br>
> > > + r.rlim_max = 1;<br>
> > > + SAFE_SETRLIMIT(RLIMIT_CORE, &r);<br>
> > > + tst_res(TINFO, "Avoid dumping corefile in following test");<br>
> ><br>
> > I'm fine with helper func. Maybe I'd print also current pid.<br>
> > It could be little spammy if there are many children, but we could<br>
> > address that later (if needed) with a parameter to control verbosity.<br>
> ><br>
> <br>
> To add a parameter (int verbose) sounds good to me.<br>
> <br>
> Btw, should we add some note/comment in the<br>
> document(test-writing-guidelines.txt)? I take a rough look but not sure<br>
> which line is the best position for that.<br>
<br>
How about we extend "2.2.10 Signal handlers" to "2.2.10 Signals and signal handlers"<br>
and put a note there?</blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Good point.</div><div class="gmail_default" style="font-size:small"><br></div>Since that core file dumping is(sometimes) a response for signal SIGSEGV in process, we purpose to change that behavior and avoid to generate a dump that <span class="gmail_default" style="font-size:small">related</span> to this topic.</div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>