Go to file
Thiago Macieira 928ce402a4 QHash & QRandomGenerator: cooperate to provide a simpler initial seed
Instead of initializing the whole QRandomGenerator::system(), which in
turn gets to checking CPUID and whether the HWRNG works, trust the
operating system functions for an initial value. On Linux, we'll use 4
or 8 of the 16 bytes of random data that the kernel populates for us on
AT_RANDOM.

This should make Qt applications not stall on an early system launch
without an RNG daemon, if compiled without getentropy() support. And
avoids silly mistakes causing recursion, like QTBUG-78007 found.

Additionally, qt_random_initial_value() will most likely not throw
either. It's marked noexcept, even though SystemGenerator::fillBuffer
could throw on Linux, if the current thread is canceled, but Linux also
has AT_RANDOM. That leaves the other Unix systems without getentropy()
(read: macOS, since the BSDs have getentropy()).

Fixes: QTBUG-69555
Change-Id: Id2983978ad544ff79911fffd1671fca1a9f9044d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-23 12:08:43 -07:00
.github/workflows Github Actions: many minor updates 2021-01-22 18:48:54 +01:00
bin CMake: Allow usage of QtStandaloneTestTemplateProject as package component 2021-04-23 13:31:04 +02:00
cmake Add _qt_module_interface_name for 3rdparty libraries 2021-05-23 16:16:09 +02:00
coin Allow overriding CMake build timeout values 2021-05-18 07:02:52 +03:00
config.tests Add runtime ARM64 AES check 2021-05-20 18:31:05 +00:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Rewrite the fetchmore example 2021-04-23 12:43:28 +00:00
examples Small fix to the notepad example 2021-05-18 20:57:25 +02:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
libexec CMake: Make qt-internal-configure-tests relocatable 2021-04-26 23:11:28 +02:00
mkspecs qmake: Pick default architecture on macOS based on uname 2021-05-21 17:45:28 +00:00
qmake qmake: fix MSVC build error when QT_FEATURE_static_runtime is ON 2021-05-19 04:03:46 +08:00
src QHash & QRandomGenerator: cooperate to provide a simpler initial seed 2021-05-23 12:08:43 -07:00
tests Introduce QHashSeed and switch to size_t seeds 2021-05-23 12:08:42 -07:00
util Remove unused functions from enumdata.py 2021-05-18 20:57:25 +02:00
.cmake.conf Bump version 2021-02-18 07:20:21 +02:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore .gitignore: Qt Creator files cleanup 2020-09-25 07:50:15 +02:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.prev_configure.cmake Add runtime ARM64 AES check 2021-05-20 18:31:05 +00:00
.prev_qt_cmdline.cmake CMake: Regenerate configure.cmake files 2020-09-28 15:48:17 +02:00
.qmake.conf Bump version 2021-02-18 07:20:21 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
CMakeLists.txt Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
config_help.txt Allow to load -developer-build without configurations into an IDE 2021-05-07 21:06:58 +02:00
configure Remove the -qmake and -cmake configure arguments 2021-03-11 16:39:50 +01:00
configure.bat Remove superfluous variable assignments from configure.bat 2021-03-11 16:39:54 +01:00
configure.cmake Add runtime ARM64 AES check 2021-05-20 18:31:05 +00:00
configure.json Add runtime ARM64 AES check 2021-05-20 18:31:05 +00:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
INSTALL INSTALL: Remove outdated reference to Windows CE 2019-02-13 13:01:57 +00:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPLv3 Remove LICENSE.GPLv3, LICENSE.LGPLv21, LGPL_EXCEPTION.txt 2018-04-16 11:02:14 +00:00
LICENSE.QT-LICENSE-AGREEMENT Update enterprise license agreement v4.2.1 2019-12-18 13:07:19 +02:00
qt_cmdline.cmake CMake: Build minimal subset of tests in desktop static builds 2021-04-06 09:15:37 +01:00
sync.profile Generate QUtf8StringView header file from qutf8stringview.h 2020-11-07 08:35:11 +00:00