OS-5946: Avoid modifying the object string table when patching USDT probes


Issue Type:Bug
Priority:4 - Normal
Created at:2017-02-09T13:54:04.000Z
Updated at:2017-12-14T17:24:38.866Z


Created by:Former user
Reported by:Former user
Assigned to:Former user


Fixed: A fix for this issue is checked into the tree and tested.
(Resolution Date: 2017-02-14T16:54:23.000Z)

Fix Versions

2017-02-16 JAMAICA DECOY (Release Date: 2017-02-16)

Related Issues


See illumos#6653.

This is issues was already fixed in FreeBSD. Here is their summary:

dtrace converts pairs of consecutive underscores in a probe name to dashes.
When dtrace -G processes relocations corresponding to USDT probe sites, it 
performs this conversion on the corresponding symbol names prior to looking 
up the resulting probe names in the USDT provider definition. However, in so 
doing it would actually modify the input object's string table, which breaks the 
string suffix merging done by recent binutils. Because we don't care about the 
symbol name once the probe site is recorded, just perform the probe lookup 
using a temporary copy.


Comment by Former user
Created at 2017-02-13T15:37:36.000Z
Updated at 2017-12-14T17:24:38.850Z

Tested by building Dave's Apache usdt module on a platform running this change and verifying that the names are still correct.

Comment by Former user
Created at 2017-02-14T13:34:59.000Z
Updated at 2017-12-14T17:23:48.665Z

Here is the failures from a dtest run. These are apparently known failures, except for 20 and 23:

# ./bin/dtfailures 
#   KIND       TEST                            DETAILS
0   cpc        tst.allcpus.ksh                 
1   ip         tst.ipv4localicmp.ksh           
2   ip         tst.ipv4remoteicmp.ksh          
3   ip         tst.ipv6remoteicmp.ksh          remote IPv6 host.
4   ip         tst.localtcpstate.ksh           
5   ip         tst.remotetcpstate.ksh          
6   java_api   tst.Abort.ksh                   ... 6 more
7   java_api   tst.Bean.ksh                    ... 6 more
8   java_api   tst.Close.ksh                   ... 6 more
9   java_api   tst.Drop.ksh                    ... 6 more
10  java_api   tst.Enable.ksh                  ... 6 more
11  java_api   tst.FunctionLookup.ksh          ... 6 more
12  java_api   tst.GetAggregate.ksh            ... 6 more
13  java_api   tst.MaxConsumers.ksh            ... 6 more
14  java_api   tst.MultiAggPrinta.ksh          ... 6 more
15  java_api   tst.ProbeData.ksh               ... 6 more
16  java_api   tst.ProbeDescription.ksh        ... 1 more
17  java_api   tst.StateMachine.ksh            ... 6 more
18  java_api   tst.StopLock.ksh                ... 6 more
19  misc       tst.include.ksh                 
20  pid        tst.utf8probefunc.ksh           dtrace failed in /var/tmp/dtest.2
21  pragma     tst.temporal.ksh                Usage: head [-qv] [-n lines] [-c
22  preprocessor err.ifdefnotendif.d             
23  ustack     tst.unpriv.ksh                  dtrace: failed to open output fil

Failure 20 was due to the version of gcc installed. OS-5960 has been filed to track this. It is unclear why 23 failed since I don't know what directory the code was running in during that test, but I ran the following from within the failure.23 directory and the tst.unpriv.ksh test passes.

# pwd
# cp ../tst/common/ustack/tst.unpriv.exe .
# ksh ./tst.unpriv.ksh /usr/sbin/dtrace 
dtrace: script '/dev/stdin' matched 4 probes
dtrace: allowing destructive actions
dtrace: pid 56286 has exited

Comment by Former user
Created at 2017-02-14T16:54:07.000Z

illumos-joyent commit 53eadd7 (branch master, by Jerry Jelinek)

OS-5946 Avoid modifying the object string table when patching USDT probes
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>