From owner-svn-src-stable@freebsd.org Sun Aug 14 22:43:50 2016 Return-Path: Delivered-To: svn-src-stable@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 21AF6BBACD6; Sun, 14 Aug 2016 22:43:50 +0000 (UTC) (envelope-from bapt@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 D6D9B123C; Sun, 14 Aug 2016 22:43:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EMhnkF029278; Sun, 14 Aug 2016 22:43:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EMhnA4029277; Sun, 14 Aug 2016 22:43:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608142243.u7EMhnA4029277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 14 Aug 2016 22:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304104 - stable/11/usr.bin/truss X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Aug 2016 22:43:50 -0000 Author: bapt Date: Sun Aug 14 22:43:48 2016 New Revision: 304104 URL: https://svnweb.freebsd.org/changeset/base/304104 Log: MFC: r303685 truss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall trussinfo->curthread must be initialized before calling enter_syscall(), it is used by t->proc->abi->fetch_args(). Without that truss is segfaulting and the attached program also crash. Submitted by: Nikita Kozlov (nikita@gandi.net) Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D7399 Modified: stable/11/usr.bin/truss/setup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/setup.c ============================================================================== --- stable/11/usr.bin/truss/setup.c Sun Aug 14 22:08:25 2016 (r304103) +++ stable/11/usr.bin/truss/setup.c Sun Aug 14 22:43:48 2016 (r304104) @@ -223,8 +223,10 @@ add_threads(struct trussinfo *info, stru t = new_thread(p, lwps[i]); if (ptrace(PT_LWPINFO, lwps[i], (caddr_t)&pl, sizeof(pl)) == -1) err(1, "ptrace(PT_LWPINFO)"); - if (pl.pl_flags & PL_FLAG_SCE) + if (pl.pl_flags & PL_FLAG_SCE) { + info->curthread = t; enter_syscall(info, t, &pl); + } } free(lwps); }