Fix mcrypt_create_iv(..., MCRYPT_RAND) to auto-seed RNG

Summary: Without seeding the random number generator,
we'll always get the same IV, and that reduces the security
of this function.

Fortunately, f_rand() has all of that logic for auto-seeding
and selection of a suitable initial seed built-in.

Realistically, using MCRYPT_RAND should be deprecated.
I'm going to wait on PHP Internals to make a decision on
https://wiki.php.net/rfc/deprecate_mcrypt_rand
before adding that warning however, so that our test suite
remains consistent.

Credit: Theodore R. Smith of PHP Experts, Inc. <theodorephpexperts.pro>

Closes #3496

Reviewed By: @ptarjan

Differential Revision: D1502435
Print inline frames in `walkstk`

Summary: Now I don't have to type `bt` anymore.

Reviewed By: @edwinsmith

Differential Revision: D1502349
Trim the next file name

Summary: This removes trailing null characters, meaning the `file_put_contents` in `extractAllTo` doesn't error from a path with a null character in it which happened when trying to extract a file with a name over 100 characters long.

Also matches the behaviour of a non-link file where the filename gets trimmed when read from the header.
Closes https://github.com/facebook/hhvm/pull/3408

Reviewed By: @ptarjan

Differential Revision: D1488803

Pulled By: svcscm
apc_add(Array) returns an array of errors

Summary: That array is formed `key=>error number`. Currently there is only -1 for an insertion error
Closes https://github.com/facebook/hhvm/pull/3423

Reviewed By: @ptarjan

Differential Revision: D1488962

Pulled By: svcscm
fix Redis lrem can remove type is string or float

Summary: Fix Redis lrem don't remove in addition to Long value,

Specific content see:

https://github.com/facebook/hhvm/issues/3452
Closes https://github.com/facebook/hhvm/pull/3453

Reviewed By: @ptarjan

Differential Revision: D1494809

Pulled By: svcscm
Dont use SQLite 3.8.4

Summary: Extended the blacklist of 3.8.5 to include all 3.8+ versions. This fixes the same issue as hhvm/hhvm-third-party#4 (if your system SQLite version is 3.8.4).
Closes https://github.com/facebook/hhvm/pull/3473

Reviewed By: @ptarjan

Differential Revision: D1500289

Pulled By: svcscm
Updated cakephp3 to 3.0.0-alpha2 in the framework tests

Summary: We have a higher test pass rate of 98.56% now.
Closes https://github.com/facebook/hhvm/pull/3501

Reviewed By: @ptarjan

Differential Revision: D1502584

Pulled By: svcscm
Re-record zf2 tests and flakey list a file

Summary: Additional follow up to #3454 in addition to #3455.
Closes https://github.com/facebook/hhvm/pull/3489

Reviewed By: @ptarjan

Differential Revision: D1502579

Pulled By: svcscm
Added factory muffin to the framework tests

Summary: Note that the tests don't run correctly on the current 2.0.x tag. They require changes that will land in the 2.1.0 release.
Closes https://github.com/facebook/hhvm/pull/3500

Reviewed By: @ptarjan

Differential Revision: D1502582

Pulled By: svcscm
Move debugger from IDL to HNI

Summary: Part of #1480.

This moves the functions from `debugger.idl.json` to HNI.
Closes https://github.com/facebook/hhvm/pull/3491

Reviewed By: @ptarjan

Differential Revision: D1502583

Pulled By: svcscm
Never call TranslatePath() on filepaths beginning with a wrapper

Summary: When called on a string preceding a wrapper the wrapper turns into an absolute path.
Resulting in file not found most likely
Closes https://github.com/facebook/hhvm/pull/3503

Reviewed By: @ptarjan

Differential Revision: D1502585

Pulled By: svcscm
Create a unified stack for Xenon

Summary: Unifying the PHP and async stacks for Xenon.
Combining the code from the previous Async and PHP stack functions into one.
Eliminating aspets to those functions that we didn't need.
Currently, keeping the async and php stack functions.  Will remove them when
the www side changes land that no longer use them.

Reviewed By: @jano

Differential Revision: D1423082
Parser: Fix decl mode's confusion of type hints and xhp.

Summary: Parser was getting confused when type hints (on function expressions) were used in function bodies of decl'ed files; it interpreted them as xhp tags. This fixes T4531988.

Reviewed By: @elgenie

Differential Revision: D1502296
Flakeylist another joomla test

Summary: Failed on an unrelated PR.

Reviewed By: @JoelMarcey

Differential Revision: D1500876
Fix in headers defines for cygwin

Summary: An update to libcurl exposed this issue
the curl header uses win32 detection instead of proper compiler detection
make sure on cygwin this is undefined before using the curl header

Reviewed By: @JoelMarcey

Differential Revision: D1502088
VASM part 2: call, shuffleArgs, shuffle2, syncpoint, vregs

Summary: Converts more emitter-helper code to use VASM, notably shuffleArgs,
prepXMM, and PhysRegSaver. Start using makeReg() to generate temporary
virtual registers instead of named reserved tmps like rAsm/rCgGP/rCgXMM*.

Reviewed By: @alexmalyshev

Differential Revision: D1460362
VASM part 3: calls and other trickyness

Summary: Convert cgCallHelper to vasm. The two interesting parts of this are
catch edges and LdObjMethod. LdObjMethod requires two special vasm
opcodes that support the alignment and patching that goes on.

Catch blocks are supported by an "unwind" instruction that behaves like
a conditional branch; the taken edge represents a transfer of control
from the callee to the unwinder block. The normal edge represents a
normal return.

This diff starts using vasm for service requests. the service request
opcodes encapsulate more or less all of the corresponding emitReqXXX
helper functions, so they generate more asm after register allocation
and sometimes re-enter Vauto recursively. See t4785959.

Reviewed By: @alexmalyshev

Differential Revision: D1460363
VASM part 4: hoist vasm up to cgInst

Summary: Hoist the creation of the main assembler to cgInst; at this point,
each CodeGenerator cg* function must be fully converted to vasm or
left alone (fully x64-asm).

Reviewed By: @alexmalyshev

Differential Revision: D1460398
VASM part 5: decrefs, cgBinaryIntOp, cgBinaryDblOp, less m_rScratch

Summary: Converted the decref family of functions. Instead of emitting code
with an unpatched forward jump, and patching it later, the vasm version
creates the "done" block early, and passes it down to the various decref
helpers as the target to use if there's no decrement needed. (cleaner).

Converted cgCallNative so all CALL_OPCODE opcodes are converted.
vasm-ified cgBinaryIntOp and cgBinaryDblOp, and simplified them somewhat
by de-inlining special cases (noncommutative or overflow-detecting).
(these look more complicated now, but get simpler again in patches
higher in the stack).

Reviewed By: @alexmalyshev

Differential Revision: D1460408
Move mailparse to HNI

Summary: This pull request moves the functions in mailparse.idl.json to HNI.

Also, `ezmlm_hash` now calculates the hash it should calculate.

Part of #1480
Closes https://github.com/facebook/hhvm/pull/3505

Reviewed By: @ptarjan

Differential Revision: D1502587