Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-69423

QRandomGenerator not random on certain Windows installations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P1: Critical P1: Critical
    • 5.12.6, 5.13.2, 5.14.0 Beta 1
    • 5.10.1, 5.11.0
    • Core: Other
    • None
    • Win7
      Win10
    • Windows
    • 6543f5053 (dev), 30d40a889 (6.8), 5a685653b (dev), f21f2bef1 (dev), 29d68f23c (6.10), 6bc4d5e8e (6.10), 2392fd448 (tqtc/lts-6.8), 4d0e04543 (tqtc/lts-6.5), 1a6ec63b9 (dev), b37af6422 (6.10)

      I currently use QTemporaryFile on to generate unique names (template length of 8 X). On some win 7 & 10 systems I get bonkers results:

      LHILHILH.pdf
      OtNOtNOt.pdf
      ZLsZLsZL.pdf
      

      As you can see the template repeats after three characters. Reading the source code at https://github.com/qt/qtbase/blob/4ba535616b8d3dfda7fbe162c6513f3008c1077a/src/corelib/io/qtemporaryfile.cpp#L168 it becomes clear that one call to QRandomGenerator::generate serves as randomness for 3 characters. This is fine; but the issue I am seeing here is that subsequent calls generate the same random number. This happens only for on customer and I do not even know where to start debugging this...

        1. error.png
          error.png
          208 kB
        2. hwcheck.png
          hwcheck.png
          197 kB
        3. hwtest.cpp
          5 kB
        4. results.png
          results.png
          22 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            apollo13 Florian Apolloner
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: