cadets / freebsd-old

FreeBSD src tree http://www.FreeBSD.org/
Other
12 stars 7 forks source link

Produce CTF for ports #3

Open arunthomas opened 8 years ago

arunthomas commented 8 years ago

It would be nice if we could set a config option and produce CTF for all -- or a large subset -- of the FreeBSD ports. I'm particularly interested in CTF for nginx.

arunthomas commented 8 years ago

More info here: http://dtrace.org/blogs/rm/2013/11/14/userland-ctf-in-dtrace/

davidchisnall commented 8 years ago

A more general question is whether we should continue to use CTF for DTrace in the longer term. CTF is less expressive than DWARF, which has up sides (it's not Turing-complete, so parsing it is guaranteed to terminate) and down sides (good luck trying to use it for anything other than pure ISO C). We should investigate what Apple does (they don't have ctfconvert, but DTrace does work on userland processes on OS X, so they may have taught it to speak DWARF).

gvnn3 commented 8 years ago

We talked about this at the DevSummit yesterday and people who deal with ports are overwhelming in favor of moving to DWARF. I started reading over the ctf.h file where they describe CTF but I'm no expert on CTF or DWARF, just a user. I think the question isn't "if" but "when" so how shall we proceed?

arunthomas commented 8 years ago

@davidchisnall DWARF sounds reasonable to me. Do we know any Apple DTrace engineers? It would be nice to have a prototype of this in the next couple months, but that's probably not be realistic.

arunthomas commented 8 years ago

We will want CTF/DWARF in time for the adversarial engagement, so raising the priority. The code freeze for TA2/TA3 integration is July 1, so we may want to opt for CTF as it offers a quicker path. I'm ok with this being a CADETS-specific solution that isn't upstreamable. We can look into an upstreamable solution based on DWARF after the code freeze.

If DWARF is doable in the timeframe, that's fine too. We would likely want to complete this feature by mid-May.

gvnn3 commented 8 years ago

It turns out that what is needed is only to install ports with DEBUG turned on by default. If we want USDTs that's also possible and postgresql has an example of that. I'm enabling DEBUG for the various ports we want for the project.

arunthomas commented 8 years ago

Re-opening this issue, since we also want to be able to use the type information from CTF/DWARF in D scripts. We'd like this: http://dtrace.org/blogs/rm/2013/11/14/userland-ctf-in-dtrace/