)]}'
{
  "commit": "d9389421788ec805671e0368b02cd5626b6c85f3",
  "tree": "51c66a462d5c70a4ad59870f5ce0a33156b333ca",
  "parents": [
    "d739fa52ca7ab508b45062861b7bd47299649348"
  ],
  "author": {
    "name": "FuzzTest Team",
    "email": "fuzztest@google.com",
    "time": "Wed Apr 17 20:19:02 2024"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Wed Apr 17 20:19:53 2024"
  },
  "message": "Expose API to parse known absl flags.\n\nThis change makes it easier for consumers such as Chromium to use fuzztest. It\nchanges argument handling in two ways:\n\n1) It exposes a new \u0027InitAbslFlagsForFuzztest\u0027 API. Chromium\u0027s test suites\n   otherwise needed to call into absl flags directly to initialize absl\u0027s\n   command line; this was problematic in projects where absl flags are not\n   normally used. Integration of fuzztest is easier if we need to call\n   only fuzztest APIs instead of absl flags directly.\n\n   A key point of this new API is that it does not call\n   absl::ParseCommandLine, but instead absl::ParseAbseilFlagsOnly.\n   This ignores unknown command-line options, which is important in\n   environments where other code may use non-absl parsing of command lines.\n\n2) fuzztest_gtest_main is amended to use the above function instead\n   of absl::ParseCommandLine. This is because, when used with libfuzzer\n   or other non-centipede fuzzing engines, those fuzzing engines themselves\n   absorb command linm arguments, and thus the previous use of\n   absl::ParseCommandLine always failed unless a complex\n   \u0027-undefok\u003d\u0027 argument was constructed listing all the possible options\n   that could be passed to libfuzzer.\n\nAs an indication of the complexity here, in a typical Chromium test,\ncommand-line arguments may flow to four places:\n* FuzzTest\u0027s absl flags\n* libfuzzer, passed there via InitFuzzTest (or some other fuzzing engine)\n* Chromium\u0027s own test frameworks (flags like --single-process-tests)\n* Chromium\u0027s underlying code, e.g. for enabling runtime features\n  or disabling the sandbox.\n\nBecause of the many areas of code handling command line arguments, it\u0027s not\npractical to declare them all in advance either using absl flags, nor using\n`-undefok` and that\u0027s why it\u0027s important that FuzzTest uses\nabsl::ParseAbseilFlagsOnly to avoid erroring in the face of unknown extra\ncommand line arguments.\n\nThis CL does not fix a third problem in this area, which is that\nthe fuzztest engine stores the given argc and argv and assumes it never\nsubsequently changes - this assumption is wrong in projects such as\nChromium where other layers of software may absorb and modify the\ncommand line later, and results in use-after-return bugs. However\nthis can be easily worked around by storing an extra copy of the original\nargc and argv for use by fuzztest, disregarding subsequent changes.\n\nPiperOrigin-RevId: 625785463\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fd4eae7085a5479d8e4d978d44e359c1fcaa6df7",
      "old_mode": 33188,
      "old_path": "fuzztest/BUILD",
      "new_id": "38990c392800b6b8a9b7aae9c8160e050ed8fe03",
      "new_mode": 33188,
      "new_path": "fuzztest/BUILD"
    },
    {
      "type": "modify",
      "old_id": "1c535865410dc23c1b937dd7276ff7c8a7c59741",
      "old_mode": 33188,
      "old_path": "fuzztest/fuzztest_gtest_main.cc",
      "new_id": "f4aea2d0c46e136f5a85be1409248deae229465e",
      "new_mode": 33188,
      "new_path": "fuzztest/fuzztest_gtest_main.cc"
    },
    {
      "type": "modify",
      "old_id": "dda5f94853be0160b479567b93f0e873026b32a9",
      "old_mode": 33188,
      "old_path": "fuzztest/init_fuzztest.cc",
      "new_id": "9d3db8e2b6a25c2794da60d1a925dfe1ee469c45",
      "new_mode": 33188,
      "new_path": "fuzztest/init_fuzztest.cc"
    },
    {
      "type": "modify",
      "old_id": "df5da511a6dda2ea08c0155b390b37e977eae59a",
      "old_mode": 33188,
      "old_path": "fuzztest/init_fuzztest.h",
      "new_id": "e33ca39638974e6e93d679d346dee8e2463943bd",
      "new_mode": 33188,
      "new_path": "fuzztest/init_fuzztest.h"
    }
  ]
}
