Hi!
> mprotect02 triggered an expected SIGSEGV in test, but it puts this
> information in dmesg, which might cause confusion when checking results:
>
> mprotect02[11416]: segfault at 7f9ca0060000 ip 0000003a8e3382ff sp
> 00007fff7aeecb68 error 6 in libc-2.12.so[3a8e200000+197000]
>
> This patch hides the sigfault information from dmesg.
>
> Signed-off-by: Caspar Zhang <[email protected]>
> ---
> testcases/kernel/syscalls/mprotect/mprotect02.c | 20 +++++++++++++-------
> 1 files changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/mprotect/mprotect02.c
> b/testcases/kernel/syscalls/mprotect/mprotect02.c
> index 97250c5..1d1fad0 100644
> --- a/testcases/kernel/syscalls/mprotect/mprotect02.c
> +++ b/testcases/kernel/syscalls/mprotect/mprotect02.c
> @@ -60,6 +60,7 @@
>
> #include "safe_macros.h"
>
> +static void sighandler(int sig);
> static void cleanup(void);
> static void setup(void);
>
> @@ -121,13 +122,6 @@ int main(int ac, char **av)
> if (waitpid(pid, &status, 0) == -1)
> tst_brkm(TBROK|TERRNO, cleanup, "waitpid failed");
>
> - if (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV)
> - tst_resm(TPASS, "got SIGSEGV as expected");
> - else
> - tst_brkm(TBROK, cleanup,
> - "child exited abnormally; wait status = %d",
> - status);
> -
> /* Change the protection to WRITE. */
> TEST(mprotect(addr, sizeof(buf), PROT_WRITE));
>
> @@ -185,9 +179,21 @@ int main()
>
> #endif /* UCLINUX */
>
> +static void sighandler(int sig)
> +{
> + if (sig == SIGSEGV) {
> + tst_resm(TPASS, "got SIGSEGV as expected");
> + tst_exit();
> + } else
> + tst_brkm(TBROK, cleanup, "child exited abnormally: %d",
> + sig);
> +}
Same as previous, please use the signal to propagete the return value to
parent using _exit().
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it.
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list