malformed symbol

Mark Johnston markj at FreeBSD.org
Mon Dec 19 00:47:45 UTC 2016


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


More information about the freebsd-dtrace mailing list