)]}'
{
  "commit": "1340a5b2dd886e07509d26a85e569cdfc30d790a",
  "tree": "4bada9568d3ef750e5f63fc0c92316524e695957",
  "parents": [
    "9d48902108d2ed0b04ea862d7d3aa8bf14e17f47"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Tue Jun 06 20:16:58 2023 -0400"
  },
  "committer": {
    "name": "Boringssl LUCI CQ",
    "email": "boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Wed Jun 07 17:39:26 2023 +0000"
  },
  "message": "Give up on qsort for sk_FOO_sort\n\nOpenSSL\u0027s API constraints are such that sk_FOO_sort must take a\ncomparison function of type\nint (*cmp)(const FOO *const *a, const FOO *const *b)\n\nHowever qsort expects a comparison function of type\nint (*cmp)(const void *a, const void *b)\n\nIn C, it is UB to cast a function pointer to a different type and call\nit, even if the underlying calling conventions are the same. Moreover,\nas qsort doesn\u0027t take a context parameter on its comparisons, we cannot\ndo the usual convention with closures in C.\n\nqsort_r and qsort_s would avoid this, but they are unusable. Too many\nlibcs don\u0027t have them, and those that do define them inconsistently. See\nhttps://stackoverflow.com/a/39561369\n\nIt seems this UB has finally hit a sanitizer in fxbug.dev/128274.\nIrritating as it is to not even have a working sort function, I think\nthe easiest option is to just give up on qsort. As we did with bsearch\nin https://boringssl-review.googlesource.com/c/boringssl/+/35304, just\nimplement an in-place heap sort ourselves.\n\nBug: fxbug.dev/128274\nChange-Id: I9de6b4018bf635da0d0c5a680bd7811d297b0bb3\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/60507\nCommit-Queue: David Benjamin \u003cdavidben@google.com\u003e\nReviewed-by: Bob Beck \u003cbbe@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a11533ed517863a8211aa46c50276e27ad10c2bf",
      "old_mode": 33188,
      "old_path": "crypto/stack/stack.c",
      "new_id": "6b4f8bc739683a5eb549d394a2c0dc3229ed9c11",
      "new_mode": 33188,
      "new_path": "crypto/stack/stack.c"
    },
    {
      "type": "modify",
      "old_id": "7900fc9094e6807dab121cdf1ffc5c0e7287153d",
      "old_mode": 33188,
      "old_path": "crypto/stack/stack_test.cc",
      "new_id": "228182b6234b606632fdffb2d2630625ddedb135",
      "new_mode": 33188,
      "new_path": "crypto/stack/stack_test.cc"
    }
  ]
}
