Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Mar 2021 14:05:25 GMT
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2726b46353a9 - stable/13 - Fix ptrace_test:ptrace__syscall_args after ATF upgrade
Message-ID:  <202103171405.12HE5PZg086139@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by arichardson:

URL: https://cgit.FreeBSD.org/src/commit/?id=2726b46353a9faa2a0dbdf707693252b33ef5501

commit 2726b46353a9faa2a0dbdf707693252b33ef5501
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-02-23 12:51:35 +0000
Commit:     Alex Richardson <arichardson@FreeBSD.org>
CommitDate: 2021-03-17 12:24:10 +0000

    Fix ptrace_test:ptrace__syscall_args after ATF upgrade
    
    ATF now opens the results file (without CLOEXEC), so the child actually
    has a valid file descriptor 3. To fix this simply use a large number that
    will definitely not be a valid file descriptor.
    
    Reviewed by:    jhb, cem, lwhsu
    Differential Revision: https://reviews.freebsd.org/D28889
    
    (cherry picked from commit 17cc20092cd7a45adb6d772e0f449617007a82d9)
---
 tests/sys/kern/ptrace_test.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c
index c6183ed573fd..944be3d31e04 100644
--- a/tests/sys/kern/ptrace_test.c
+++ b/tests/sys/kern/ptrace_test.c
@@ -3947,7 +3947,8 @@ ATF_TC_BODY(ptrace__syscall_args, tc)
 	if (fpid == 0) {
 		trace_me();
 		kill(getpid(), 0);
-		close(3);
+		/* Close a fd that should not exist. */
+		close(12345);
 		exit(1);
 	}
 
@@ -4049,7 +4050,7 @@ ATF_TC_BODY(ptrace__syscall_args, tc)
 
 	ATF_REQUIRE(ptrace(PT_GET_SC_ARGS, wpid, (caddr_t)args,
 	    sizeof(args)) != -1);
-	REQUIRE_EQ(args[0], 3);
+	REQUIRE_EQ(args[0], 12345);
 
 	REQUIRE_EQ(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0), 0);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103171405.12HE5PZg086139>