Module Name:    src
Committed By:   kre
Date:           Wed May 30 05:09:12 UTC 2018

Modified Files:
        src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
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.)


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/tests/lib/libc/sys/t_ptrace_wait.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.59 src/tests/lib/libc/sys/t_ptrace_wait.c:1.60
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.59	Tue May 29 10:40:54 2018
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Wed May 30 05:09:11 2018
@@ -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 @@ bytes_transfer(int operation, size_t siz
 #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));
 

Reply via email to