php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70999 php_random_bytes: called object is not a function
Submitted: 2015-11-30 10:54 UTC Modified: 2015-12-13 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: cyrus at safe-mail dot net Assigned:
Status: No Feedback Package: Compile Failure
PHP Version: 7.0.0RC8 OS: Solaris 11 (x86 and sparc)
Private report: No CVE-ID: None
 [2015-11-30 10:54 UTC] cyrus at safe-mail dot net
Description:
------------
<path>/php-7.0.0RC8/ext/standard/random.c: In function 'php_random_bytes':
<path>/php-7.0.0RC8/ext/standard/random.c:145:26: error: called object '20480' is not a function
*** Error code 1
make: Fatal error: Command failed for target `ext/standard/random.lo'

----------
occurs only on Solaris (x86/sparc)
works well on RHEL 6/7


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-30 12:04 UTC] laruence@php.net
I delete my wrong comments, anyway, here comes the right one , could you please try does this path works?

diff --git a/ext/standard/random.c b/ext/standard/random.c
index 7056879..43e2984 100644
--- a/ext/standard/random.c
+++ b/ext/standard/random.c
@@ -145,7 +145,7 @@ static int php_random_bytes(void *bytes, size_t size)
                /* Does the file exist and is it a character device? */
                if (fstat(fd, &st) != 0 ||
 # ifdef S_IFNAM
-                !(S_IFNAM(st.st_mode) || S_ISCHR(st.st_mode))
+                !((((st.st_mode) & S_IFNAM) == S_IFNAM) || S_ISCHR(st.st_mode))
 # else
                 !S_ISCHR(st.st_mode)
 # endif
 [2015-11-30 12:05 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2015-11-30 15:59 UTC] cyrus at safe-mail dot net
This fix works well with Solaris 11 x86.
It seems it works also with Solaris 11 sparc.
I discovered another error, but in my eyes it did not stand in relation to this issue.

Is it possible to include this fix in next or final release?
THX a lot!
 [2015-12-04 07:52 UTC] eugene at zhegan dot in
Same here, Solaris 11.2 x86. Patch does help, thanks a lot.
Build is successful.
 [2015-12-06 10:18 UTC] rainer dot jung at kippdata dot de
Problem also occurs on Solaris 10 (and will occur on every platform that has S_IFNAM defined). Patch works well also on Solaris 10. Thanks.
 [2015-12-13 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2015-12-17 09:38 UTC] cyrus at safe-mail dot net
Provided fix works well.
Please commit/push to git...
Thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC