Add a maximum read buffer size to ExecFuture

Summary:
Ref T4241. Currently, `ExecFuture` may read an arbitrarily large amount of data into memory during execution. In T4241, this arises specifically with `git-upload-pack`, which emits about as much data as the size of the repository. Currently, the subprocess emits this data far faster than we can send it over the network, so we end up with a huge in-process buffer containing the entire repository.

Instead, we want to throttle `git-upload-pack` until the network can catch up. This is the first step in letting that happen.

Test Plan: Added a unit test.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4241

Differential Revision: https://secure.phabricator.com/D7772
Use PhutilRope for Channel write buffers and make write buffer details public

Summary:
Ref T4241. Two changes:

  - Use PhutilRope instead of plain string for the Channel write buffers. This makes it more consistent, and should improve performance in some cases.
  - Expose information about buffer sizes as `public`. We need this in a future diff to be able to throttle reads when we're blocked on writes, since we have to be able to test if a write channel is blocked or not.

Test Plan: Ran `arc unit`. Ran `git` operations over SSH.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4241

Differential Revision: https://secure.phabricator.com/D7773
Add a read buffer size to PhutilChannel

Summary: Ref T4241. See D7772. Just like `ExecFuture`, allow the internal channel buffer to be limited in size so when we're plugging a fast pipe into a slow pipe we don't end up with all of the data in memory (subject to actually using these features).

Test Plan: Added unit tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4241

Differential Revision: https://secure.phabricator.com/D7774
Allow PhutilChannel to select only write sockets, and expose read buffer status

Summary: Ref T4241. Ref T4206. Small API changes to fix T4241 (next diff). See previous diffs for context.

Test Plan: See next revision.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4206, T4241

Differential Revision: https://secure.phabricator.com/D7775
Make all "protected" in ExecFuture into "private"

Summary: This class is final, these are just vestigal from long, long ago.

Test Plan: Unit tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7779
Added a SIGABRT handler that will write a stack trace to /tmp/phabricator_backtrace_[PID]

Summary:
Stack traces are useful for debugging things.  This adds a
signal handler that registers SIGABRT and SIGHUP. In both cases, a
backtrace is written to /tmp/phabricator_backtrace_<PID>.  If SIGABRT
is caught, we terminate the process with extreme prejudice.

Note, however, that any php script that wishes to actually use this
functionality must declare(ticks=1) (or some other value) in the main
script; i.e., setting this value in an included script doesn't appear
to impact the main script.

Test Plan:
<?php
declare(ticks=1);
require_once ('__init_script__.php');
posix_kill(posix_getpid(), SIGABRT);
sleep (1000000);
?>

for both SIGABRT and SIGHUP, did the same with kill -ABRT and kill -HUP.
Observed that it worked as intended.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7797