From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 17:21:13 2015 Return-Path: Delivered-To: svn-src-all@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 C4DF6B0C; Sat, 18 Apr 2015 17:21:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 B3686930; Sat, 18 Apr 2015 17:21:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IHLDm8072991; Sat, 18 Apr 2015 17:21:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IHLDS4072990; Sat, 18 Apr 2015 17:21:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201504181721.t3IHLDS4072990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 Apr 2015 17:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281696 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 17:21:13 -0000 Author: kib Date: Sat Apr 18 17:21:12 2015 New Revision: 281696 URL: https://svnweb.freebsd.org/changeset/base/281696 Log: Initialize td_sel in the thread_init(). Struct thread is not zeroed on the initial allocation, but seltdinit() assumes that td_sel is NULL or a valid pointer. Note that thread_fini()/seltdfini() also relies on this, but correctly resets td_sel to NULL. Submitted by: luke.tw@gmail.com PR: 199518 MFC after: 1 week Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Apr 18 16:58:33 2015 (r281695) +++ head/sys/kern/kern_thread.c Sat Apr 18 17:21:12 2015 (r281696) @@ -209,6 +209,7 @@ thread_init(void *mem, int size, int fla td->td_sched = (struct td_sched *)&td[1]; umtx_thread_init(td); td->td_kstack = 0; + td->td_sel = NULL; return (0); }