From owner-freebsd-testing@FreeBSD.ORG Fri Nov 21 20:23:23 2014 Return-Path: Delivered-To: freebsd-testing@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39DA7F2C for ; Fri, 21 Nov 2014 20:23:23 +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 21B2C757 for ; Fri, 21 Nov 2014 20:23:23 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id sALKNNFI050522 for ; Fri, 21 Nov 2014 20:23:23 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 on amd64, not i386 Date: Fri, 21 Nov 2014 20:23:22 +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: jhb@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: Fri, 21 Nov 2014 20:23:23 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194828 --- Comment #13 from John Baldwin --- Eh, I had to build the test by hand so I could get debug symbols and then just ran getcontext_test under gdb. The error is that the test requires unsupported behavior for amd64. amd64 passes the first 6 args in registers and the remainder on the stack. makecontext() on amd64 only handles args in registers. If you ask it to pass more than 6 arguments (this test asks for 10) to the function, it sabotages the ucontext so that the subsequent setcontext() will fail by setting mc_len to 0. I noticed this by stepping in gdb and noting that mc_len went to zero after makecontext() was called. i386 doesn't have this check, so I suspect it will not break with the fix I suggested applied to the kernel. Relevant code in amd64's makecontext: else if ((argc < 0) || (argc > 6) || (ucp->uc_stack.ss_sp == NULL) || (ucp->uc_stack.ss_size < MINSIGSTKSZ)) { /* * This should really return -1 with errno set to ENOMEM * or something, but the spec says that makecontext is * a void function. At least make sure that the context * isn't valid so it can't be used without an error. */ ucp->uc_mcontext.mc_len = 0; return; } With the test patched to only pass 6 arguments on amd64 it now passes. -- You are receiving this mail because: You are on the CC list for the bug.