From owner-svn-src-head@freebsd.org Tue May 16 18:39:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94065D7098C; Tue, 16 May 2017 18:39:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 63634982; Tue, 16 May 2017 18:39:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4GIdNY1067346; Tue, 16 May 2017 18:39:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4GIdNr0067345; Tue, 16 May 2017 18:39:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201705161839.v4GIdNr0067345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 16 May 2017 18:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318360 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 May 2017 18:39:24 -0000 Author: jhb Date: Tue May 16 18:39:23 2017 New Revision: 318360 URL: https://svnweb.freebsd.org/changeset/base/318360 Log: Fix p_endcopy. For p_endcopy to work correctly, it must be the name of the next element in struct proc after the end of the copy region, not the name of the last element in the copy region. Currently, the last element (p_elf_flags) is not being copied. In addition, the p_xexit and p_xsig fields should not be copied on fork, so move them out of the copy region. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D10677 Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue May 16 18:05:34 2017 (r318359) +++ head/sys/sys/proc.h Tue May 16 18:39:23 2017 (r318360) @@ -624,13 +624,13 @@ struct proc { pid_t p_reapsubtree; /* (e) Pid of the direct child of the reaper which spawned our subtree. */ - u_int p_xexit; /* (c) Exit code. */ - u_int p_xsig; /* (c) Stop/kill sig. */ uint16_t p_elf_machine; /* (x) ELF machine type */ uint64_t p_elf_flags; /* (x) ELF flags */ - /* End area that is copied on creation. */ -#define p_endcopy p_elf_flags +#define p_endcopy p_xexit + + u_int p_xexit; /* (c) Exit code. */ + u_int p_xsig; /* (c) Stop/kill sig. */ struct pgrp *p_pgrp; /* (c + e) Pointer to process group. */ struct knlist *p_klist; /* (c) Knotes attached to this proc. */ int p_numthreads; /* (c) Number of threads. */