From owner-freebsd-bugs@FreeBSD.ORG Thu Feb 20 12:20:01 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 622D6A65 for ; Thu, 20 Feb 2014 12:20:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48A5C192D for ; Thu, 20 Feb 2014 12:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s1KCK0O4018167 for ; Thu, 20 Feb 2014 12:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s1KCK0fJ018166; Thu, 20 Feb 2014 12:20:00 GMT (envelope-from gnats) Date: Thu, 20 Feb 2014 12:20:00 GMT Message-Id: <201402201220.s1KCK0fJ018166@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Fedor Indutny Subject: Re: misc/186821: dtrace_dof_init() crashes when there is no probes section X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Fedor Indutny List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 12:20:01 -0000 The following reply was made to PR misc/186821; it has been noted by GNATS. From: Fedor Indutny To: bug-followup@freebsd.org, fedor@indutny.com Cc: Subject: Re: misc/186821: dtrace_dof_init() crashes when there is no probes section Date: Thu, 20 Feb 2014 16:10:27 +0400 --089e0153673e53437b04f2d565b7 Content-Type: text/plain; charset=ISO-8859-1 Sorry, initial version of patch was very superficial. And it was only covering the actual problem, submitting proper patch as an attachment here. --089e0153673e53437b04f2d565b7 Content-Type: application/octet-stream; name="proper-drti.patch" Content-Disposition: attachment; filename="proper-drti.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hrvzmzvo0 Y29tbWl0IGM0Njc4NmY0NzQ4M2U3ZmMyMTg3MjdhYTUyY2Y2YjIyNzhhNDUwNTMKQXV0aG9yOiBG ZWRvciBJbmR1dG55IDxmZWRvci5pbmR1dG55QGdtYWlsLmNvbT4KRGF0ZTogICBNb24gRmViIDE3 IDAxOjE2OjEzIDIwMTQgKzA0MDAKCiAgICBkdHJhY2U6IHByb3BlciBzeW1ib2wgZml4dXAgYW5k IGltcG9ydCBpbiBkcnRpCiAgICAKICAgIEFwcGxpY2F0aW9uIG1heSBjb250YWluIG11bHRpcGxl IERPRnMsIG1lcmdlZCBpbnRvIG9uZSAuX1NVTldfZG9mIEVMRgogICAgc2VjdGlvbi4gUHJvY2Vz cyBhbGwgb2YgdGhlbSBhbmQgZml4IHN5bWJvbHMgb25seSBpbiB0aG9zZSBvbmVzIHRoYXQKICAg IGFjdGF1bGx5IGRlZmluZSBhIHByb3ZpZGVyLiBVc2UgcHJvcGVyIHN0cnRhYiBmb3IgcmVzb2x2 aW5nIHN5bWJvbHMuCgpkaWZmIC0tZ2l0IGEvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL2xpYi9s aWJkdHJhY2UvY29tbW9uL2RydGkuYyBiL2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy9saWIvbGli ZHRyYWNlL2NvbW1vbi9kcnRpLmMKaW5kZXggM2I0YTM4Yy4uZTQ3Y2ZiNGQgMTAwNjQ0Ci0tLSBh L2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy9saWIvbGliZHRyYWNlL2NvbW1vbi9kcnRpLmMKKysr IGIvY2RkbC9jb250cmliL29wZW5zb2xhcmlzL2xpYi9saWJkdHJhY2UvY29tbW9uL2RydGkuYwpA QCAtMj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