From owner-svn-src-head@freebsd.org Mon Oct 5 21:39:08 2015 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 15F4C9B93F3; Mon, 5 Oct 2015 21:39:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.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 04A1C33D; Mon, 5 Oct 2015 21:39:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t95Ld7qp013373; Mon, 5 Oct 2015 21:39:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t95Ld7Ic013372; Mon, 5 Oct 2015 21:39:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510052139.t95Ld7Ic013372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 5 Oct 2015 21:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288903 - head/usr.bin/truss 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.20 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: Mon, 05 Oct 2015 21:39:08 -0000 Author: bdrewery Date: Mon Oct 5 21:39:07 2015 New Revision: 288903 URL: https://svnweb.freebsd.org/changeset/base/288903 Log: Fix crash if a process sends itself a SIGTRAP. Just forward it as expected. MFC after: 2 weeks [needs rewrite] Relnotes: yes Modified: head/usr.bin/truss/setup.c Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Mon Oct 5 21:36:53 2015 (r288902) +++ head/usr.bin/truss/setup.c Mon Oct 5 21:39:07 2015 (r288903) @@ -564,15 +564,12 @@ eventloop(struct trussinfo *info) } find_thread(info, si.si_pid, pl.pl_lwpid); - if (si.si_status == SIGTRAP) { + if (si.si_status == SIGTRAP && + (pl.pl_flags & (PL_FLAG_SCE|PL_FLAG_SCX)) != 0) { if (pl.pl_flags & PL_FLAG_SCE) enter_syscall(info, &pl); else if (pl.pl_flags & PL_FLAG_SCX) exit_syscall(info, &pl); - else - errx(1, - "pl_flags %x contains neither PL_FLAG_SCE nor PL_FLAG_SCX", - pl.pl_flags); pending_signal = 0; } else if (pl.pl_flags & PL_FLAG_CHILD) { if ((info->flags & COUNTONLY) == 0)