Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/sys The bytes_transfer_piod_read_auxv test us...



details:   https://anonhg.NetBSD.org/src/rev/c1fdd690ff2c
branches:  trunk
changeset: 319443:c1fdd690ff2c
user:      kre <kre%NetBSD.org@localhost>
date:      Wed May 30 05:09:11 2018 +0000

description:
The bytes_transfer_piod_read_auxv test uses 4096 for the size param
to bytes_transfer() which asserted that the size is < the size of 512 AuxInfo
structs.   On a 32 bit system, an AuxInfo is 8 bytes, and 512 AuxInfo
structs is thus 4096 bytes, and 4096 is not < 4096, so the assertion
failed.   It would probably work as a <= assert, but I am not confident
enough with this test case to make that call, so instead increase the
array size to be 513 instead, 4096 is < 513*8 so happiness should return
and all should be right with the world.   At least for this one test.
(There was no problem on 64 bit systems as AuxInfo is bigger there.)

diffstat:

 tests/lib/libc/sys/t_ptrace_wait.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r acd06b247cd9 -r c1fdd690ff2c tests/lib/libc/sys/t_ptrace_wait.c
--- a/tests/lib/libc/sys/t_ptrace_wait.c        Tue May 29 23:34:18 2018 +0000
+++ b/tests/lib/libc/sys/t_ptrace_wait.c        Wed May 30 05:09:11 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ptrace_wait.c,v 1.59 2018/05/29 10:40:54 kamil Exp $ */
+/*     $NetBSD: t_ptrace_wait.c,v 1.60 2018/05/30 05:09:11 kre Exp $   */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.59 2018/05/29 10:40:54 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.60 2018/05/30 05:09:11 kre Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -2021,8 +2021,8 @@
 #if defined(TWAIT_HAVE_STATUS)
        int status;
 #endif
-       /* 512 is more than enough, for the purposes of ATF it's good enough */
-       AuxInfo ai[512], *aip;
+       /* 513 is just enough, for the purposes of ATF it's good enough */
+       AuxInfo ai[513], *aip;
 
        ATF_REQUIRE(size < sizeof(ai));
 



Home | Main Index | Thread Index | Old Index