{"thread":{"id":"62752","subject":"[BUG] Git 2.48.0-rc2 - Test t0610.26 Fails","startedAt":"2025-01-07T01:42:59Z","lastAt":"2025-01-07T06:51:58Z","messageCount":2,"participants":["rsbecker@nexbridge.com","Patrick Steinhardt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"510039","messageId":"002c01db60a5$7a367060$6ea35120$@nexbridge.com","threadId":"62752","inReplyTo":null,"subject":"[BUG] Git 2.48.0-rc2 - Test t0610.26 Fails","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-01-07T01:42:51Z","receivedAt":"2025-01-07T01:42:59Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"The following breaks at rc2. It worked correctly at rc1 on x86 but\napparently not on ia64.\n\nThe OpenSSL random generator on ia64 uses PRNGD. On x86, the hardware\nrandomizer\nis used. Nonetheless, this is not working properly:\n\nexpecting success of 0610.47 'ref transaction: many concurrent writers':\n        test_when_finished \"rm -rf repo\" &&\n        git init repo &&\n        (\n                cd repo &&\n                # Set a high timeout. While a couple of seconds should be\n                # plenty, using the address sanitizer will significantly\nslow\n                # us down here. So we are aiming way higher than you would\never\n                # think is necessary just to keep us from flaking. We could\n                # also lock indefinitely by passing -1, but that could\n                # potentially block CI jobs indefinitely if there was a bug\n                # here.\n                git config set reftable.lockTimeout 300000 &&\n                test_commit --no-tag initial &&\n\n                head=$(git rev-parse HEAD) &&\n                for i in $(test_seq 100)\n                do\n                        printf \"%s commit\\trefs/heads/branch-%s\\n\" \"$head\"\n\"$i\" ||\n                        return 1\n                done >expect &&\n                printf \"%s commit\\trefs/heads/main\\n\" \"$head\" >>expect &&\n\n                for i in $(test_seq 100)\n                do\n                        { git update-ref refs/heads/branch-$i HEAD& } ||\n                        return 1\n                done &&\n\n                wait &&\n                git for-each-ref --sort=v:refname >actual &&\n                test_cmp expect actual\n        )\n\n+ test_when_finished rm -rf repo\n+ git init repo\nInitialized empty Git repository in\n/home/ituglib/randall/jenkins/.jenkins/workspace/Git_Pipeline/t/trash\ndirectory.t0610-reftable-basics/repo/.git/\n+ cd repo\n+ git config set reftable.lockTimeout 300000\n+ test_commit --no-tag initial\n[main (root-commit) 68d032e] initial\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 initial.t\n+ + git rev-parse HEAD\nhead=68d032e9edd3481ac96382786ececc37ec28709e\n+ 1> expect\n+ test_seq 100\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 1\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 2\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 3\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 4\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 5\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 6\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 7\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 8\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 9\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 10\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 11\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 12\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 13\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 14\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 15\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 16\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 17\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 18\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 19\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 20\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 21\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 22\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 23\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 24\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 25\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 26\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 27\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 28\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 29\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 30\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 31\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 32\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 33\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 34\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 35\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 36\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 37\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 38\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 39\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 40\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 41\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 42\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 43\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 44\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 45\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 46\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 47\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 48\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 49\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 50\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 51\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 52\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 53\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 54\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 55\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 56\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 57\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 58\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 59\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 60\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 61\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 62\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 63\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 64\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 65\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 66\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 67\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 68\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 69\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 70\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 71\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 72\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 73\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 74\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 75\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 76\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 77\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 78\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 79\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 80\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 81\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 82\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 83\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 84\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 85\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 86\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 87\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 88\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 89\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 90\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 91\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 92\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 93\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 94\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 95\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 96\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 97\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 98\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 99\n+ printf %s commit\\trefs/heads/branch-%s\\n\n68d032e9edd3481ac96382786ececc37ec28709e 100\n+ printf %s commit\\trefs/heads/main\\n\n68d032e9edd3481ac96382786ececc37ec28709e\n+ 1>> expect\n+ test_seq 100\n+ git update-ref refs/heads/branch-1 HEAD\n+ git update-ref refs/heads/branch-2 HEAD\n+ git update-ref refs/heads/branch-7 HEAD\n+ git update-ref refs/heads/branch-3 HEAD\n+ git update-ref refs/heads/branch-5 HEAD\n+ git update-ref refs/heads/branch-6 HEAD\n+ git update-ref refs/heads/branch-4 HEAD\n+ git update-ref refs/heads/branch-8 HEAD\n+ git update-ref refs/heads/branch-9 HEAD\n+ git update-ref refs/heads/branch-10 HEAD\n+ git update-ref refs/heads/branch-11 HEAD\n+ git update-ref refs/heads/branch-12 HEAD\n+ git update-ref refs/heads/branch-13 HEAD\n+ git update-ref refs/heads/branch-14 HEAD\n+ git update-ref refs/heads/branch-15 HEAD\n+ git update-ref refs/heads/branch-16 HEAD\n+ git update-ref refs/heads/branch-17 HEAD\n+ git update-ref refs/heads/branch-18 HEAD\n+ git update-ref refs/heads/branch-19 HEAD\n+ git update-ref refs/heads/branch-20 HEAD\n+ git update-ref refs/heads/branch-21 HEAD\n+ git update-ref refs/heads/branch-22 HEAD\n+ git update-ref refs/heads/branch-23 HEAD\n+ git update-ref refs/heads/branch-24 HEAD\n+ git update-ref refs/heads/branch-25 HEAD\n+ git update-ref refs/heads/branch-26 HEAD\n+ git update-ref refs/heads/branch-27 HEAD\n+ git update-ref refs/heads/branch-28 HEAD\n+ git update-ref refs/heads/branch-29 HEAD\n+ git update-ref refs/heads/branch-31 HEAD\n+ git update-ref refs/heads/branch-30 HEAD\n+ git update-ref refs/heads/branch-34 HEAD\n+ git update-ref refs/heads/branch-37 HEAD\n+ git update-ref refs/heads/branch-38 HEAD\n+ git update-ref refs/heads/branch-35 HEAD\n+ git update-ref refs/heads/branch-36 HEAD\n+ git update-ref refs/heads/branch-39 HEAD\n+ git update-ref refs/heads/branch-40 HEAD\n+ git update-ref refs/heads/branch-41 HEAD\n+ git update-ref refs/heads/branch-32 HEAD\n+ git update-ref refs/heads/branch-42 HEAD\n+ git update-ref refs/heads/branch-33 HEAD\n+ git update-ref refs/heads/branch-43 HEAD\n+ git update-ref refs/heads/branch-44 HEAD\n+ git update-ref refs/heads/branch-45 HEAD\n+ git update-ref refs/heads/branch-46 HEAD\n+ git update-ref refs/heads/branch-47 HEAD\n+ git update-ref refs/heads/branch-48 HEAD\n+ git update-ref refs/heads/branch-49 HEAD\n+ git update-ref refs/heads/branch-52 HEAD\n+ git update-ref refs/heads/branch-50 HEAD\n+ git update-ref refs/heads/branch-51 HEAD\n+ git update-ref refs/heads/branch-53 HEAD\n+ git update-ref refs/heads/branch-56 HEAD\n+ git update-ref refs/heads/branch-58 HEAD\n+ git update-ref refs/heads/branch-61 HEAD\n+ git update-ref refs/heads/branch-64 HEAD\n+ git update-ref refs/heads/branch-55 HEAD\n+ git update-ref refs/heads/branch-67 HEAD\n+ git update-ref refs/heads/branch-59 HEAD\n+ git update-ref refs/heads/branch-69 HEAD\n+ git update-ref refs/heads/branch-63 HEAD\n+ git update-ref refs/heads/branch-65 HEAD\n+ git update-ref refs/heads/branch-68 HEAD\n+ git update-ref refs/heads/branch-62 HEAD\n+ git update-ref refs/heads/branch-60 HEAD\n+ git update-ref refs/heads/branch-66 HEAD\n+ git update-ref refs/heads/branch-54 HEAD\n+ git update-ref refs/heads/branch-57 HEAD\n+ git update-ref refs/heads/branch-71 HEAD\n+ git update-ref refs/heads/branch-70 HEAD\n+ git update-ref refs/heads/branch-72 HEAD\n+ git update-ref refs/heads/branch-74 HEAD\n+ git update-ref refs/heads/branch-73 HEAD\n+ git update-ref refs/heads/branch-75 HEAD\n+ git update-ref refs/heads/branch-77 HEAD\n+ git update-ref refs/heads/branch-78 HEAD\n+ git update-ref refs/heads/branch-82 HEAD\n+ git update-ref refs/heads/branch-81 HEAD\n+ git update-ref refs/heads/branch-76 HEAD\n+ git update-ref refs/heads/branch-80 HEAD\n+ git update-ref refs/heads/branch-79 HEAD\n+ git update-ref refs/heads/branch-83 HEAD\n+ wait\n+ git update-ref refs/heads/branch-84 HEAD\n+ git update-ref refs/heads/branch-85 HEAD\n+ git update-ref refs/heads/branch-88 HEAD\n+ git update-ref refs/heads/branch-96 HEAD\n+ git update-ref refs/heads/branch-92 HEAD\n+ git update-ref refs/heads/branch-93 HEAD\n+ git update-ref refs/heads/branch-89 HEAD\n+ git update-ref refs/heads/branch-86 HEAD\n+ git update-ref refs/heads/branch-94 HEAD\n+ git update-ref refs/heads/branch-95 HEAD\n+ git update-ref refs/heads/branch-87 HEAD\n+ git update-ref refs/heads/branch-90 HEAD\n+ git update-ref refs/heads/branch-91 HEAD\n+ git update-ref refs/heads/branch-98 HEAD\n+ git update-ref refs/heads/branch-97 HEAD\n+ git update-ref refs/heads/branch-99 HEAD\n+ git update-ref refs/heads/branch-100 HEAD\nfatal: unable to get random bytes\nfatal: unable to get random bytes\nfatal: unable to get random bytes\nfatal: unable to get random bytes\nfatal: unable to get random bytes\nfatal: unable to get random bytes\nfatal: unable to get random bytes\n+ git for-each-ref --sort=v:refname\n+ 1> actual\n+ test_cmp expect actual\n--- expect      2025-01-07 01:39:05 +0000\n+++ actual      2025-01-07 01:40:41 +0000\n@@ -37,14 +37,12 @@\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-37\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-38\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-39\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-40\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-41\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-42\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-43\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-44\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-45\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-46\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-47\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-48\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-49\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-50\n@@ -59,20 +57,16 @@\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-59\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-60\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-61\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-62\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-63\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-64\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-65\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-66\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-67\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-68\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-69\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-70\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-71\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-72\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-73\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-74\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-75\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-76\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-77\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-78\n@@ -80,21 +74,16 @@\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-80\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-81\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-82\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-83\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-84\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-85\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-86\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-87\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-88\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-89\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-90\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-91\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-92\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-93\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-94\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-95\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-96\n-68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-97\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-98\n 68d032e9edd3481ac96382786ececc37ec28709e commit        refs/heads/branch-99\n 68d032e9edd3481ac96382786ececc37ec28709e commit\nrefs/heads/branch-100\nerror: last command exited with $?=1\nnot ok 47 - ref transaction: many concurrent writers\n\n\n"},{"id":"510044","messageId":"Z3zPCCLo5YUc0HUv@pks.im","threadId":"62752","inReplyTo":"002c01db60a5$7a367060$6ea35120$@nexbridge.com","subject":"Re: [BUG] Git 2.48.0-rc2 - Test t0610.26 Fails","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-01-07T06:51:52Z","receivedAt":"2025-01-07T06:51:58Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Jan 06, 2025 at 08:42:51PM -0500, rsbecker@nexbridge.com wrote:\n> The following breaks at rc2. It worked correctly at rc1 on x86 but\n> apparently not on ia64.\n> \n> The OpenSSL random generator on ia64 uses PRNGD. On x86, the hardware\n> randomizer\n> is used. Nonetheless, this is not working properly:\n[snip]\n> fatal: unable to get random bytes\n> fatal: unable to get random bytes\n> fatal: unable to get random bytes\n> fatal: unable to get random bytes\n> fatal: unable to get random bytes\n> fatal: unable to get random bytes\n> fatal: unable to get random bytes\n\nThis here is the underlying error. I cannot spot any single change in\nv2.48.0-rc1..v2.48.0-rc2 that would cause a difference in how we compute\nrandom bytes. Seeing that this is in the reftable library, the only\nchange that _could_ be related are the realloc followup-fixes, but that\ncould only be a sensible explanation in case we ever tried to populate a\nreallocated buffer with N random bytes. We don't though, as there are\nonly two callsites where we compute random bytes:\n\n  - `format_name()`\n\n  - `reftable_stack_reload_maybe_reuse()`\n\nIn both cases we only want to have a single integer.\n\nThe latter callsite is somewhat curious because we don't call\n`git_rand()`, but `rand()` directly. That wouldn't ever cause us to die,\nso we know that it has to be `format_name()` that dies in `git_rand()`.\n\nSo yes, I doubt that this has been introduced with v2.48.0-rc2, and\nrather assume that this is a flake that you just never hit before by\nchance. Due to the many threads racing with one another, all of which\nwill repeatedly acquire random bytes, we probably end up exhausting the\npool of strong random entropy, and that makes OpenSSLs `RAND_bytes()`\nfail.\n\nIt's somewhat sad that we die here, because it would be perfectly fine\nto accept a pseudo-random number in our usecase. Using `rand()` does not\nwork work though because we never seed it, and I don't want to get into\nthat business, and thus it would return deterministic sequences of file\nnames for reftable stacks.\n\nWe _could_ adapt the code to use `RAND_pseudo_bytes()` for OpenSSL,\nwhich never fails due to an exhausted entropy pool, but that'd first\nrequire us to audit every callsite to figure out whether or not it needs\nstrong entropy. Another alternative would be to introduce a flag into\n`csprng_bytes()` that tells it to also accept insecure bytes. That would\nlook something like the (not even compile-tested) diff at the end of\nthis mail.\n\nAnyway. If my analysis is correct I don't think we need to rush a fix\ninto Git v2.48. The behaviour is preexisting, it's unlikely, and in the\nerror case we don't misbehave.\n\nPatrick\n\n\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex a9b1c36de27..3e754f25bba 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -1909,7 +1909,7 @@ static int get_random_minute(void)\n \tif (getenv(\"GIT_TEST_MAINT_SCHEDULER\"))\n \t\treturn 13;\n \n-\treturn git_rand() % 60;\n+\treturn git_rand(0) % 60;\n }\n \n static int is_launchctl_available(void)\ndiff --git a/reftable/stack.c b/reftable/stack.c\nindex 531660a49f0..8427c49026c 100644\n--- a/reftable/stack.c\n+++ b/reftable/stack.c\n@@ -659,7 +659,7 @@ int reftable_stack_add(struct reftable_stack *st,\n static int format_name(struct reftable_buf *dest, uint64_t min, uint64_t max)\n {\n \tchar buf[100];\n-\tuint32_t rnd = (uint32_t)git_rand();\n+\tuint32_t rnd = (uint32_t)git_rand(CSPRNG_BYTES_INSECURE);\n \tsnprintf(buf, sizeof(buf), \"0x%012\" PRIx64 \"-0x%012\" PRIx64 \"-%08x\",\n \t\t min, max, rnd);\n \treftable_buf_reset(dest);\ndiff --git a/t/helper/test-csprng.c b/t/helper/test-csprng.c\nindex a4a0aca6177..c86dcc4870f 100644\n--- a/t/helper/test-csprng.c\n+++ b/t/helper/test-csprng.c\n@@ -15,7 +15,7 @@ int cmd__csprng(int argc, const char **argv)\n \n \twhile (count) {\n \t\tunsigned long chunk = count < sizeof(buf) ? count : sizeof(buf);\n-\t\tif (csprng_bytes(buf, chunk) < 0) {\n+\t\tif (csprng_bytes(buf, chunk, 0) < 0) {\n \t\t\tperror(\"failed to read\");\n \t\t\treturn 5;\n \t\t}\ndiff --git a/t/unit-tests/t-reftable-readwrite.c b/t/unit-tests/t-reftable-readwrite.c\nindex 6b75a419b9d..f22b9775639 100644\n--- a/t/unit-tests/t-reftable-readwrite.c\n+++ b/t/unit-tests/t-reftable-readwrite.c\n@@ -108,8 +108,8 @@ static void t_log_buffer_size(void)\n \t   hash, to ensure that the compressed part is larger than the original.\n \t*/\n \tfor (i = 0; i < REFTABLE_HASH_SIZE_SHA1; i++) {\n-\t\tlog.value.update.old_hash[i] = (uint8_t)(git_rand() % 256);\n-\t\tlog.value.update.new_hash[i] = (uint8_t)(git_rand() % 256);\n+\t\tlog.value.update.old_hash[i] = (uint8_t)(git_rand(0) % 256);\n+\t\tlog.value.update.new_hash[i] = (uint8_t)(git_rand(0) % 256);\n \t}\n \treftable_writer_set_limits(w, update_index, update_index);\n \terr = reftable_writer_add_log(w, &log);\n@@ -325,7 +325,7 @@ static void t_log_zlib_corruption(void)\n \t};\n \n \tfor (i = 0; i < sizeof(message) - 1; i++)\n-\t\tmessage[i] = (uint8_t)(git_rand() % 64 + ' ');\n+\t\tmessage[i] = (uint8_t)(git_rand(0) % 64 + ' ');\n \n \treftable_writer_set_limits(w, 1, 1);\n \ndiff --git a/wrapper.c b/wrapper.c\nindex fa79fd6ec9e..8b985931490 100644\n--- a/wrapper.c\n+++ b/wrapper.c\n@@ -479,7 +479,7 @@ int git_mkstemps_mode(char *pattern, int suffix_len, int mode)\n \tfor (count = 0; count < TMP_MAX; ++count) {\n \t\tint i;\n \t\tuint64_t v;\n-\t\tif (csprng_bytes(&v, sizeof(v)) < 0)\n+\t\tif (csprng_bytes(&v, sizeof(v), 0) < 0)\n \t\t\treturn error_errno(\"unable to get random bytes for temporary file\");\n \n \t\t/* Fill in the random bits. */\n@@ -750,7 +750,7 @@ int open_nofollow(const char *path, int flags)\n #endif\n }\n \n-int csprng_bytes(void *buf, size_t len)\n+int csprng_bytes(void *buf, size_t len, MAYBE_UNUSED unsigned flags)\n {\n #if defined(HAVE_ARC4RANDOM) || defined(HAVE_ARC4RANDOM_LIBBSD)\n \t/* This function never returns an error. */\n@@ -785,14 +785,18 @@ int csprng_bytes(void *buf, size_t len)\n \t\treturn -1;\n \treturn 0;\n #elif defined(HAVE_OPENSSL_CSPRNG)\n-\tint res = RAND_bytes(buf, len);\n-\tif (res == 1)\n+\tswitch (RAND_pseudo_bytes(buf, len)) {\n+\tcase 1:\n \t\treturn 0;\n-\tif (res == -1)\n-\t\terrno = ENOTSUP;\n-\telse\n+\tcase 0:\n+\t\tif (flags & CSPRNG_BYTES_INSECURE)\n+\t\t\treturn 0;\n \t\terrno = EIO;\n-\treturn -1;\n+\t\treturn -1;\n+\tdefault:\n+\t\terrno = ENOTSUP;\n+\t\treturn -1;\n+\t}\n #else\n \tssize_t res;\n \tchar *p = buf;\n@@ -816,11 +820,11 @@ int csprng_bytes(void *buf, size_t len)\n #endif\n }\n \n-uint32_t git_rand(void)\n+uint32_t git_rand(unsigned flags)\n {\n \tuint32_t result;\n \n-\tif (csprng_bytes(&result, sizeof(result)) < 0)\n+\tif (csprng_bytes(&result, sizeof(result), flags) < 0)\n \t\tdie(_(\"unable to get random bytes\"));\n \n \treturn result;\ndiff --git a/wrapper.h b/wrapper.h\nindex a6b3e1f09ec..7df824e34a9 100644\n--- a/wrapper.h\n+++ b/wrapper.h\n@@ -127,18 +127,26 @@ int open_nofollow(const char *path, int flags);\n \n void sleep_millisec(int millisec);\n \n+enum {\n+\t/*\n+\t * Accept insecure bytes, which some CSPRNG implementations may return\n+\t * in case the entropy pool has been exhausted.\n+\t */\n+\tCSPRNG_BYTES_INSECURE = (1 << 0),\n+};\n+\n /*\n  * Generate len bytes from the system cryptographically secure PRNG.\n  * Returns 0 on success and -1 on error, setting errno.  The inability to\n- * satisfy the full request is an error.\n+ * satisfy the full request is an error. Accepts CSPRNG flags.\n  */\n-int csprng_bytes(void *buf, size_t len);\n+int csprng_bytes(void *buf, size_t len, unsigned flags);\n \n /*\n  * Returns a random uint32_t, uniformly distributed across all possible\n- * values.\n+ * values. Accepts CSPRNG flags.\n  */\n-uint32_t git_rand(void);\n+uint32_t git_rand(unsigned flags);\n \n /* Provide log2 of the given `size_t`. */\n static inline unsigned log2u(uintmax_t sz)\n"}]}