Bug 198456 - dtrace fails on statically linked binaries
Summary: dtrace fails on statically linked binaries
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-09 15:55 UTC by Bjoern A. Zeeb
Modified: 2015-03-10 02:02 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bjoern A. Zeeb freebsd_committer freebsd_triage 2015-03-09 15:55:56 UTC
# dtrace -c "/rescue/sh -c '/usr/bin/true'"
dtrace: failed to control pid 85198: process exited with status 0


Dtrace seems to have trouble working on statically linked binaries.  Tried with multiple, with and without script provided.

Seen on at least amd64.
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2015-03-09 17:40:54 UTC
This is because libdtrace stops a nascent process by placing a breakpoint on an rtld symbol, which obviously won't be there in a statically-linked binary. If the executable's symbol table is intact we can use main() instead, but that doesn't help for /rescue...

I'll think about how to handle this, but I don't have a good solution at the moment. Note that upstream doesn't support static linking, so there might be other problems.