+2023-11-10 Bruno Haible <bruno@clisp.org>
+
+ random: Fix multithread-safety bug in general.
+ * m4/random.m4 (gl_FUNC_RANDOM): Override also macOS, FreeBSD, Solaris,
+ Cygwin, Haiku.
+ * doc/posix-functions/random.texi: Mention the wider scope of the
+ multithread-safety bug.
+
2023-11-09 Bruno Haible <bruno@clisp.org>
sigsegv: Improve port to CHERI.
This function is only defined as an inline function on some platforms:
Android 4.4.
@item
-This function crashes when used in multithreaded programs on some platforms:
-CheriBSD.
+This function is not multithread-safe on some platforms:
+macOS 12.5, FreeBSD 13.2, Solaris 11.4, Cygwin 3.4.6, Haiku.
@end itemize
Portability problems not fixed by Gnulib:
-# random.m4 serial 7
+# random.m4 serial 8
dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
future*) REPLACE_SETSTATE=1 ;;
esac
fi
- dnl On CheriBSD, random() lacks locking, leading to an out-of-bounds read
- dnl inside random_r.
+ dnl On several platforms, random() is not multithread-safe.
if test $ac_cv_func_initstate = no || test $ac_cv_func_setstate = no \
- || case "$host" in aarch64c-*-freebsd*) true;; *) false;; esac; then
+ || case "$host_os" in \
+ darwin* | freebsd* | solaris* | cygwin* | haiku*) true ;; \
+ *) false ;; \
+ esac
+ then
dnl In order to define initstate or setstate, we need to define all the
dnl functions at once.
REPLACE_RANDOM=1