diff --git a/hphp/runtime/base/zend/zend_rand.cpp b/hphp/runtime/base/zend/zend_rand.cpp index f9c52bc88..17a9c9c1b 100644 --- a/hphp/runtime/base/zend/zend_rand.cpp +++ b/hphp/runtime/base/zend/zend_rand.cpp @@ -254,6 +254,10 @@ double math_combined_lcg() { } int64_t math_generate_seed() { +#ifdef VALGRIND + // valgrind treats memory from RAND_bytes as uninitialized + return GENERATE_SEED(); +#endif int64_t value; if (RAND_bytes((unsigned char *)&value, sizeof(value)) < 1) { return GENERATE_SEED();