From owner-freebsd-testing@FreeBSD.ORG Wed Nov 5 08:22:11 2014 Return-Path: Delivered-To: freebsd-testing@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06AA8947 for ; Wed, 5 Nov 2014 08:22:11 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC64E24B for ; Wed, 5 Nov 2014 08:22:10 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id sA58MAmd076715 for ; Wed, 5 Nov 2014 08:22:10 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-testing@freebsd.org Subject: [Bug 194828] [test] lib.libc.sys.getcontext_test.setcontext_link fails in jenkins; not on FreeBSD/i386 with CURRENT Date: Wed, 05 Nov 2014 08:22:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: ngie@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ngie@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 08:22:11 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194828 --- Comment #4 from Garrett Cooper --- (In reply to Garrett Cooper from comment #3) > Confirmed that this issue happens on a recent copy of amd64: > > $ sudo kyua test getcontext_test > getcontext_test:getcontext_err -> passed [0.006s] > getcontext_test:setcontext_err -> passed [0.006s] > getcontext_test:setcontext_link -> failed: > /usr/src/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c:118: > setcontext(&uc[DEPTH-1]) != 0 [0.005s] > > Results file id is usr_tests_lib_libc_sys.20141105-070522-007241 > Results saved to > /root/.kyua/store/results.usr_tests_lib_libc_sys.20141105-070522-007241.db > > 2/3 passed (1 failed) > $ uname -a > FreeBSD fuji-current-amd64.local 11.0-CURRENT FreeBSD 11.0-CURRENT #1 > r274088+75af1e3(isilon-atf)-dirty: Tue Nov 4 22:27:19 PST 2014 > root@fuji-current-amd64.local:/usr/obj/usr/src/sys/FUJI amd64 > > Rebuilding the kernel again on i386 to see whether or not this occurs there. > If it does, this is a potentially new bug. - The symptom for the failure with the testcase is setcontext(2) is failing with rc == -1, errno == EINVAL on amd64. This isn't documented in setcontext(2), so it's potentially a side effect with the system call. There's an undocumented requirement check in sys_setcontext for uap->ucp == NULL, which will return EINVAL, however. - setcontext still isn't failing on i386. Digging into sys/kern/kern_context.c, there're a few issues that have been revealed with this bug: 1. The testcase might not be setting up required state for setcontext to succeed on FreeBSD. I need to dig into whether or not a fix/workaround was provided for setcontext internally at Isilon. 2. The documentation doesn't note that setcontext can fail with: -- EINVAL in sys_setcontext(2) -- EINVAL in set_mcontext(2) on amd64/i386. -- Whatever copyin would fail with when copying in certain fields from userland when dealing with savecontext(2). Sidenote, there's an additional check in amd64 that's not handled in i386 which could potentially feed back an EINVAL (the "-" context is amd64, the "+" context is i386): - if (mcp->mc_len != sizeof(*mcp) || - (mcp->mc_flags & ~_MC_FLAG_MASK) != 0) + if (mcp->mc_len != sizeof(*mcp)) return (EINVAL); jhb made a recent change to i386, but not amd64 in this syscall. -- You are receiving this mail because: You are on the CC list for the bug.