From owner-svn-src-head@freebsd.org Mon Apr 25 18:40:58 2016 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 DDF39B1CCAF; Mon, 25 Apr 2016 18:40:58 +0000 (UTC) (envelope-from markj@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 901CE1803; Mon, 25 Apr 2016 18:40:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3PIev3A065710; Mon, 25 Apr 2016 18:40:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PIevRb065709; Mon, 25 Apr 2016 18:40:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604251840.u3PIevRb065709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 25 Apr 2016 18:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298589 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace 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.21 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, 25 Apr 2016 18:40:59 -0000 Author: markj Date: Mon Apr 25 18:40:57 2016 New Revision: 298589 URL: https://svnweb.freebsd.org/changeset/base/298589 Log: Allow DOF sections with excessively long probe function components. Without this change, DTrace will refuse to load a DOF section if the function component of any of its probes exceeds DTRACE_FUNCNAMELEN (128). Probes in C++ programs can have very long function components. Rather than rejecting all probes if a single probe exceeds the limit, simply skip the invalid probe and emit a warning. This ensures that valid probes are instantiated. PR: 207735 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Apr 25 18:13:21 2016 (r298588) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Apr 25 18:40:57 2016 (r298589) @@ -9355,6 +9355,10 @@ dtrace_helper_provide_one(dof_helper_t * probe = (dof_probe_t *)(uintptr_t)(daddr + prb_sec->dofs_offset + i * prb_sec->dofs_entsize); + /* See the check in dtrace_helper_provider_validate(). */ + if (strlen(strtab + probe->dofpr_func) >= DTRACE_FUNCNAMELEN) + continue; + dhpb.dthpb_mod = dhp->dofhp_mod; dhpb.dthpb_func = strtab + probe->dofpr_func; dhpb.dthpb_name = strtab + probe->dofpr_name; @@ -16042,7 +16046,13 @@ dtrace_helper_provider_validate(dof_hdr_ if (strlen(strtab + probe->dofpr_func) >= DTRACE_FUNCNAMELEN) { dtrace_dof_error(dof, "function name too long"); - return (-1); + /* + * Keep going if the function name is too long. + * Unlike provider and probe names, we cannot reasonably + * impose restrictions on function names, since they're + * a property of the code being instrumented. We will + * skip this probe in dtrace_helper_provide_one(). + */ } if (probe->dofpr_name >= str_sec->dofs_size ||