Bug #74105 [NEW]: PHP hangs when getrandom is not available

From: Date: Thu, 16 Feb 2017 08:32:23 +0000
Subject: Bug #74105 [NEW]: PHP hangs when getrandom is not available
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207396@lists.php.net to get a copy of this message
From: bruno+archlinux at ahennezel dot info Operating system: Linux PHP version: 7.1.2RC1 Package: Reproducible crash Bug Type: Bug Bug description:PHP hangs when getrandom is not available Description: ------------ When PHP is compiled on a recent kernel, it assumes that getrandom is available. When such a PHP build is running on an older kernel, this code throws an exception. cf. pull request 2385 Test script: --------------- <?php $a = random_int(0,10); ?> Expected result: ---------------- Fallback to /dev/urandom and return a number Or Exit with a more explicit error message (checking ENOSYS) Actual result: -------------- PHP Fatal error: Uncaught Exception: Could not gather sufficient random data in -:2 Stack trace: #0 -(2): random_int(0, 200) #1 {main} thrown in - on line 2 -- Edit bug report at https://bugs.php.net/bug.php?id=74105&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74105&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74105&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74105&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74105&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74105&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74105&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74105&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74105&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74105&r=support Expected behavior: https://bugs.php.net/fix.php?id=74105&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74105&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74105&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74105&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74105&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74105&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74105&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74105&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74105&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74105&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74105&r=mysqlcfg

« previous php.bugs (#207396) next »