Fix insignificant CRTP bug

Summary:

@override-unit-failures
Flaky unit tests passed on the second try, but the git hook still
complains

Test Plan: iobuf_cursor_test

Reviewed By: philipp@fb.com

FB internal diff: D948768
x86intrinsic seems to be problematic for clang

Summary: fbinject (clang code parser) throws some errors when
including the x86intrinsic header.

Test Plan:
D929356 compiles after this diff.  It adds a dep on RWSpinLock.

Reviewed By: beng@fb.com

FB internal diff: D950285
abort instead of throwing an exception on bad format strings

Summary:
Errors that happen during format are almost always programmer
error in the form of a bad format string. Abort instead of throwing in
these cases.

Test Plan: automated tests, added a couple new tests

Reviewed By: tudorb@fb.com

FB internal diff: D947470
folly: disable address sanitizer warnings on fbstring

Summary:
The fbstring constructor does word-aligned copies which may creep
past the end of the C string, which address sanitizer doesn't like.

This also adds a address-sanitizer-disabling-attribute to both
Portability.h (for general use) and a (gross) copy in FBString.h
since it gets put into libstdc++.

Test Plan: ran address sanitizer on folly tests

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D950586
Some fixes for building stuff with clang

@override-unit-failures

Summary: Not that much.

Test Plan:
Compiled hphp with clang.

Reviewed By: oyamauchi@fb.com

FB internal diff: D954663
fix heap-buffer-overflow (asan) in EliasFanoCoding

Test Plan:
fbconfig folly/experimental/test:elias_fano_test && fbmake runtests_opt

Reviewed By: tudorb@fb.com

FB internal diff: D962971
disable asan for qfind_first_byte_of_needles16

Summary:
It's expected to read past the string (within the same memory
page).

Test Plan: .

Reviewed By: tudorb@fb.com

FB internal diff: D962974
range checks in DynamicConverter

Summary:
Add range-checking to convertTo for small numeric types.

Internally, dynamics represent a numeric with an int64_t or a double.
When converting to a smaller numeric type, DynamicConverter uses a
static_cast. This causes some confusion (re D936940). The code now uses
folly::to, which throws a std::range_error on overflow.

While working on this I also added some light comments to the new
toDynamic section, for consistency with the original convertTo
commenting. I also renamed the internal trait is_associative_container
to is_map, since is_associative_container is looking for a mapped_type
typedef and hence excludes such associative containers as sets.

While adding the overflow tests, I also augmented the typetraits test to
include the is_map and is_range traits, which hitherto had no test
coverage.

Test Plan: build and run tests, both in dbg and opt

Reviewed By: cberner@fb.com

FB internal diff: D961605
folly: don't inline functions with ASAN disabled

Summary:
The address sanitizer disabling attribute has some issues in gcc when
the function is inlined.

Test Plan: Built and ran tao tests with ASAN.

Reviewed By: philipp@fb.com

FB internal diff: D962930
fix memcpy-param-overlap (asan) in GroupVarint

Test Plan: .

Reviewed By: tudorb@fb.com

FB internal diff: D962972
AsyncIO::initializeContext() should provide more debug output when io_queue_init fails

Summary: It would be good idea to provide more information if the io_queue_init() failed due to resource allocation.

Test Plan:
Run standart tests + manual testing
1. fbconfig -r folly/experimental/ && fbmake runtests
2. Ask a capacity larger than aio_max_nr and check failure messages

Reviewed By: agartrell@fb.com

FB internal diff: D965260
fix minor typo in comment

Test Plan: n/a

Reviewed By: delong.j@fb.com

FB internal diff: D970791
Remove problematic log lines from folly JSON test.

Summary: We are logging UTF-8 data in this test. This makes the test infra fail (when using `fbmake runtests` for example).

Test Plan: Run existing JSON tests.

Reviewed By: shreehari@fb.com

FB internal diff: D975249
Make folly::Uri::port() return uint16_t instead of uint32_t.

Summary: We can safely assume that ports are always going to be 16bit (TCP or UDP), so no need to have a uint32_t here.

Test Plan: Ran tests in folly/tests.

Reviewed By: tudorb@fb.com

FB internal diff: D973291
Parametrize allocator in AtomicHash{Array,Map}

Summary: Maybe at some point somebody won't want malloc, e.g. me.

Test Plan: Ran AtomicHashArrayTest using an mmap allocator.

Reviewed By: delong.j@fb.com

FB internal diff: D960192
Fixed-size atomic bitset

Summary: No magic; what it says on the package.

Test Plan: atomic_bitset_test

Reviewed By: delong.j@fb.com

FB internal diff: D971875
Add various functions to wrapNoInt

Test Plan: used them

Reviewed By: soren@fb.com

FB internal diff: D976393
Fix small race in subprocess_test

Summary:
It is possible for subprocess_test_parent_death_helper's child to signal
the parent between the check for "caught" and the call to "pause()", and
therefore pause() blocks forever.

Test Plan: ran the test in a loop

Reviewed By: delong.j@fb.com

FB internal diff: D979872
deprecating boost::shared_ptr

Summary:
Replacing boost::shared_ptr with std::shared_ptr.

Test Plan: .

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D932119
Add an authority() method to folly::Uri.

Summary: facebook::strings::URL has an authority() method. Having the same thing for folly::Uri help converting users of the URL class. This method just takes username, password, host, and port, and builds a string in the form <username>:<password>@<host>:<port>.

Test Plan: None.

Reviewed By: rajat@fb.com

FB internal diff: D977450