From owner-freebsd-dtrace@freebsd.org Mon Dec 19 00:47:45 2016 Return-Path: Delivered-To: freebsd-dtrace@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 65A76C72D0D for ; Mon, 19 Dec 2016 00:47:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2009E1DF3; Mon, 19 Dec 2016 00:47:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x244.google.com with SMTP id n21so177562qka.0; Sun, 18 Dec 2016 16:47:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7J54DuIYP507TqVLwVCWRhQKE45UvaqYmAJGor7/8gY=; b=RCequPwLDdJJiXd34V5LdnVlLHmV20waao1P956+FtY7aG8lgO2lt/HmGMYTqHTR8N ivDgZ6O/sPAZku7wcgs/4M2eq6lZs2jjxnhDiKQJlLkNJriPzvkNIZHJjNLyHC7+rjju u2UWK0iH/VIRkbYhSC7A5KQldilsgk2qQZgYNkR/O96fsQ3erJSUBEi5W+i2qwuLzFpr 9GgMM54/ApWjyTUms1mkbZAQtxRxQ/Qthf6fBP8Fayu0WbE4nvlhCR92bamdVQNzN5EA eNLbPXnMeCSxRV2+rNucc90ffilkJqG4VCmMjITC//unee1hlz5im06FBqbf482asrIK 1YIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=7J54DuIYP507TqVLwVCWRhQKE45UvaqYmAJGor7/8gY=; b=GY3uaLrXqq6jpbGZID5NXZY0w5213o79FvxLQHd4EKII+uDM8zONnFwL8cov+COQvL ob+NydVIGs5u3ZnQD3wpqHQN8JEwYcr2Yj3sQbg4EEI+qPQlZWIXwC1luk9q0I3WrNqR fgtbL0YXcftR6GulgaqzvIai9etLWtlUWBvIGGh4Y55qXkISx9C5bng90l3ywGNoeIMD FFT+TqPuS8fQ3Nx0D1iXsMLsARjefHydhmfcARgoSIO2/pIGYxaTNKbkWrQMntXvCT0Y XqXl7CQnDr5PY2exrw7Q4ICt9fKvgRZ1U+NFblpKUbLfI/1Epy0qZP1XOHoy998pzG9M HZPQ== X-Gm-Message-State: AIkVDXJG3XafUTzL081vxtJjDbZwZzwBJJoXPiTqt54SQC+MxyY2uGu7NHTPCuVVohJG3w== X-Received: by 10.55.114.2 with SMTP id n2mr186075qkc.145.1482108464176; Sun, 18 Dec 2016 16:47:44 -0800 (PST) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id f66sm9319741qkj.23.2016.12.18.16.47.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Dec 2016 16:47:43 -0800 (PST) Sender: Mark Johnston Date: Sun, 18 Dec 2016 16:53:42 -0800 From: Mark Johnston To: Robert Mustacchi Cc: freebsd-dtrace@freebsd.org, hrs@FreeBSD.org, swills@FreeBSD.org Subject: Re: malformed symbol Message-ID: <20161219005342.GA57753@wkstn-mjohnston.west.isilon.com> References: <20161215.075124.1459885758696268380.hrs@allbsd.org> <6b0842f5-46e8-e90e-0cc6-ec0cbe74669a@joyent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6b0842f5-46e8-e90e-0cc6-ec0cbe74669a@joyent.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 00:47:45 -0000 On Wed, Dec 14, 2016 at 02:56:12PM -0800, Robert Mustacchi wrote: > On 12/14/16 14:51 , Hiroki Sato wrote: > > This was reproducible on 11.x and 12.x, not on 10.x. Could anyone > > try this and let me know if this is reproducible on your 11.x or 12.x > > box? I guess this is a regression of symbol rewrite routine such as > > s/__/-/ in the dtrace utility while I have not investigated the > > details yet. Or am I missing something here? > > We've seen something similar on illumos that corresponds with newer > binutils versions (2.26). See https://www.illumos.org/issues/6653. I wrote a hacky patch[1] which modifies libdtrace such that it appends the modified symbol name to the strtab instead of modifying the original name, and updates the symbol to point to the new entry. It seems to address the issue. I then wondered why we update the strtab in the first place. The code uses the modified string to look up the probe corresponding to the relocation that designates the probe site. Why can't we copy the symbol name to a buffer, call strhyphenate() on that, and use it for the lookup instead? Once the probe sites are recorded in the DOF, we shouldn't care about the symbol name. I implemented this too[2] and haven't hit any problems with some quick testing. [1] https://people.freebsd.org/~markj/patches/libdtrace_symname_swizzle.diff [2] https://people.freebsd.org/~markj/patches/libdtrace_symname_swizzle2.diff