On 04.11.2017 23:03, build...@apache.org wrote:
> The Buildbot has detected a new failure on builder apr-x64-macosx-trunk while 
> building . Full details are available at:
>     https://ci.apache.org/builders/apr-x64-macosx-trunk/builds/49
>
> Buildbot URL: https://ci.apache.org/
>
> Buildslave for this Build: svn-x64-macosx-dgvrs
>
> Build Reason: The AnyBranchScheduler scheduler named 'on-apr-commit' 
> triggered this build
> Build Source Stamp: [branch apr/apr/trunk] 1814326
> Blamelist: ylavic
>
> BUILD FAILED: failed Build
>
> Sincerely,
>  -The Buildbot

>From the buildbot log:

...
checking for getrandom... no
...
checking whether SYS_getrandom is declared... no
checking for arc4random_buf... yes
checking for entropy source... arc4random
...
/bin/sh /Volumes/apr-x64-macosx-trunk/libtool --silent --mode=compile clang -g 
-O2   -DHAVE_CONFIG_H  -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -DDARWIN_10   
-I./include -I/srv/buildbot/slave/apr-x64-macosx-trunk/build/include/arch/unix 
-I./include/arch/unix 
-I/srv/buildbot/slave/apr-x64-macosx-trunk/build/include/arch/unix 
-I/srv/buildbot/slave/apr-x64-macosx-trunk/build/include 
-I/srv/buildbot/slave/apr-x64-macosx-trunk/build/include/private 
-I/Volumes/apr-x64-macosx-trunk/include/private  -o misc/unix/start.lo -c 
/srv/buildbot/slave/apr-x64-macosx-trunk/build/misc/unix/start.c && touch 
misc/unix/start.lo
/srv/buildbot/slave/apr-x64-macosx-trunk/build/misc/unix/rand.c:117:14: 
warning: implicit declaration of function 'getrandom' is invalid in C99 
[-Wimplicit-function-declaration]
        rc = getrandom(buf, length, GRND_NONBLOCK);
             ^
/srv/buildbot/slave/apr-x64-macosx-trunk/build/misc/unix/rand.c:117:37: error: 
use of undeclared identifier 'GRND_NONBLOCK'
        rc = getrandom(buf, length, GRND_NONBLOCK);
                                    ^
1 warning and 1 error generated.


>From apr_private.h:

#define HAVE_ARC4RANDOM_BUF 1
...
#define HAVE_DECL_SYS_GETRANDOM 0
...
/* #undef HAVE_GETRANDOM */


This looks like fallout from r1814326. This part is clearly wrong:

http://svn.apache.org/viewvc/apr/apr/trunk/misc/unix/rand.c?r1=1814326&r2=1814325&pathrev=1814326


The presence of the <sys/random.h> header does *not* mean that you can
use getrandom(); you always have to check HAVE_GETRANDOM explicitly. The
correct check is probably this:

#if defined(HAVE_SYS_RANDOM_H) && HAVE_GETRANDOM
#include <sys/random.h>
#define USE_GETRANDOM
#else ...


Interestingly enough, if this check were correct, APR would choose
arc4random_buf() on OSX 10.12, i.e., it would make use of stsp's patch.


-- Brane

Reply via email to