{"$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json",
 "version": "2.1.0",
 "runs": [{"tool": {"driver": {"name": "GNU C23",
                               "fullName": "GNU C23 (GCC) version 16.1.1 20260703 (Red Hat 16.1.1-4) (x86_64-redhat-linux)",
                               "version": "16.1.1 20260703 (Red Hat 16.1.1-4)",
                               "informationUri": "https://gcc.gnu.org/gcc-16/",
                               "rules": [{"id": "-Wanalyzer-fd-leak",
                                          "helpUri": "https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-fd-leak"}]}},
           "taxonomies": [{"name": "CWE",
                           "version": "4.7",
                           "organization": "MITRE",
                           "shortDescription": {"text": "The MITRE Common Weakness Enumeration"},
                           "taxa": [{"id": "775",
                                     "helpUri": "https://cwe.mitre.org/data/definitions/775.html"}]}],
           "invocations": [{"arguments": ["/usr/libexec/gcc/x86_64-redhat-linux/16/cc1",
                                          "-quiet",
                                          "-I",
                                          "../src/include/",
                                          "-D",
                                          "_GNU_SOURCE",
                                          "-D",
                                          "__SANE_USERSPACE_TYPES__",
                                          "-D",
                                          "_LARGEFILE_SOURCE",
                                          "-D",
                                          "_FILE_OFFSET_BITS=64",
                                          "-D",
                                          "LIBURING_BUILD_TEST",
                                          "-include",
                                          "../config-host.h",
                                          "poll-mshot-overflow.c",
                                          "-quiet",
                                          "-dumpbase",
                                          "poll-mshot-overflow.c",
                                          "-dumpbase-ext",
                                          ".c",
                                          "-m64",
                                          "-mtune=generic",
                                          "-march=x86-64",
                                          "-mtls-dialect=gnu2",
                                          "-O2",
                                          "-Wno-unused-parameter",
                                          "-Wno-sign-compare",
                                          "-Wno-unknown-pragmas",
                                          "-flto=auto",
                                          "-ffat-lto-objects",
                                          "-fexceptions",
                                          "-fstack-protector-strong",
                                          "-fasynchronous-unwind-tables",
                                          "-fstack-clash-protection",
                                          "-fcf-protection=full",
                                          "-fno-omit-frame-pointer",
                                          "-fanalyzer",
                                          "-fdiagnostics-path-format=separate-events",
                                          "-fno-diagnostics-show-caret",
                                          "-fno-lto",
                                          "-fanalyzer-assume-nothrow",
                                          "-fdiagnostics-text-art-charset=none",
                                          "-fdiagnostics-set-output=sarif:file=/builddir/gcc-results/3732-zNga.sarif",
                                          "-o",
                                          "/tmp/ccOh0cbD.s"],
                            "workingDirectory": {"uri": "/builddir/build/BUILD/liburing-2.13-build/liburing-2.13/test"},
                            "startTimeUtc": "2026-08-03T18:01:53Z",
                            "executionSuccessful": true,
                            "toolExecutionNotifications": [],
                            "endTimeUtc": "2026-08-03T18:01:53Z"}],
           "originalUriBaseIds": {"PWD": {"uri": "file:///builddir/build/BUILD/liburing-2.13-build/liburing-2.13/test/"}},
           "artifacts": [{"location": {"uri": "poll-mshot-overflow.c",
                                       "uriBaseId": "PWD"},
                          "sourceLanguage": "c",
                          "contents": {"text": "// SPDX-License-Identifier: MIT\n\n#include <errno.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <stdlib.h>\n#include <string.h>\n#include <signal.h>\n#include <poll.h>\n#include <sys/wait.h>\n\n#include \"liburing.h\"\n#include \"helpers.h\"\n\nstatic int check_final_cqe(struct io_uring *ring)\n{\n\tstruct io_uring_cqe *cqe;\n\tint count = 0;\n\tbool signalled_no_more = false;\n\n\twhile (!io_uring_peek_cqe(ring, &cqe)) {\n\t\tif (cqe->user_data == 1) {\n\t\t\tcount++;\n\t\t\tif (signalled_no_more) {\n\t\t\t\tfprintf(stderr, \"signalled no more!\\n\");\n\t\t\t\treturn T_EXIT_FAIL;\n\t\t\t}\n\t\t\tif (!(cqe->flags & IORING_CQE_F_MORE))\n\t\t\t\tsignalled_no_more = true;\n\t\t} else if (cqe->user_data != 3) {\n\t\t\tfprintf(stderr, \"%d: got unexpected %d\\n\", count, (int)cqe->user_data);\n\t\t\treturn T_EXIT_FAIL;\n\t\t}\n\t\tio_uring_cqe_seen(ring, cqe);\n\t}\n\n\tif (!count) {\n\t\tfprintf(stderr, \"no cqe\\n\");\n\t\treturn T_EXIT_FAIL;\n\t}\n\n\treturn T_EXIT_PASS;\n}\n\nstatic int test(bool defer_taskrun)\n{\n\tstruct io_uring_cqe *cqe;\n\tstruct io_uring_sqe *sqe;\n\tstruct io_uring ring;\n\tint pipe1[2];\n\tint ret, i;\n\n\tif (pipe(pipe1) != 0) {\n\t\tperror(\"pipe\");\n\t\treturn T_EXIT_FAIL;\n\t}\n\n\tstruct io_uring_params params = {\n\t\t/* cheat using SINGLE_ISSUER existence to know if this behaviour\n\t\t * is updated\n\t\t */\n\t\t.flags = IORING_SETUP_CQSIZE | IORING_SETUP_SINGLE_ISSUER,\n\t\t.cq_entries = 2\n\t};\n\n\tif (defer_taskrun)\n\t\tparams.flags |= IORING_SETUP_SINGLE_ISSUER |\n\t\t\t\tIORING_SETUP_DEFER_TASKRUN;\n\n\tret = io_uring_queue_init_params(2, &ring, &params);\n\tif (ret)\n\t\treturn T_EXIT_SKIP;\n\n\tsqe = io_uring_get_sqe(&ring);\n\tif (!sqe) {\n\t\tfprintf(stderr, \"get sqe failed\\n\");\n\t\treturn T_EXIT_FAIL;\n\t}\n\tio_uring_prep_poll_multishot(sqe, pipe1[0], POLLIN);\n\tio_uring_sqe_set_data64(sqe, 1);\n\n\tif (io_uring_cq_ready(&ring)) {\n\t\tfprintf(stderr, \"unexpected cqe\\n\");\n\t\treturn T_EXIT_FAIL;\n\t}\n\n\tfor (i = 0; i < 2; i++) {\n\t\tsqe = io_uring_get_sqe(&ring);\n\t\tio_uring_prep_nop(sqe);\n\t\tio_uring_sqe_set_data64(sqe, 2);\n\t\tio_uring_submit(&ring);\n\t}\n\n\tdo {\n\t\terrno = 0;\n\t\tret = write(pipe1[1], \"foo\", 3);\n\t} while (ret == -1 && errno == EINTR);\n\n\tif (ret <= 0) {\n\t\tfprintf(stderr, \"write failed: %d\\n\", errno);\n\t\treturn T_EXIT_FAIL;\n\t}\n\n\t/* should have 2 cqe + 1 overflow now, so take out two cqes */\n\tfor (i = 0; i < 2; i++) {\n\t\tif (io_uring_peek_cqe(&ring, &cqe)) {\n\t\t\tfprintf(stderr, \"unexpectedly no cqe\\n\");\n\t\t\treturn T_EXIT_FAIL;\n\t\t}\n\t\tif (cqe->user_data != 2) {\n\t\t\tfprintf(stderr, \"unexpected user_data\\n\");\n\t\t\treturn T_EXIT_FAIL;\n\t\t}\n\t\tio_uring_cqe_seen(&ring, cqe);\n\t}\n\n\t/* make sure everything is processed */\n\tio_uring_get_events(&ring);\n\n\t/* now remove the poll */\n\tsqe = io_uring_get_sqe(&ring);\n\tio_uring_prep_poll_remove(sqe, 1);\n\tio_uring_sqe_set_data64(sqe, 3);\n\tret = io_uring_submit(&ring);\n\n\tif (ret != 1) {\n\t\tfprintf(stderr, \"bad poll remove\\n\");\n\t\treturn T_EXIT_FAIL;\n\t}\n\n\tret = check_final_cqe(&ring);\n\n\tclose(pipe1[0]);\n\tclose(pipe1[1]);\n\tio_uring_queue_exit(&ring);\n\n\treturn ret;\n}\n\nstatic int test_downgrade(bool support_defer)\n{\n\tstruct io_uring_cqe cqes[128];\n\tstruct io_uring_cqe *cqe;\n\tstruct io_uring_sqe *sqe;\n\tstruct io_uring ring;\n\tint fds[2];\n\tint ret, i, cqe_count, tmp = 0, more_cqe_count;\n\n\tif (pipe(fds) != 0) {\n\t\tperror(\"pipe\");\n\t\treturn -1;\n\t}\n\n\tstruct io_uring_params params = {\n\t\t.flags = IORING_SETUP_CQSIZE,\n\t\t.cq_entries = 2\n\t};\n\n\tret = io_uring_queue_init_params(2, &ring, &params);\n\tif (ret) {\n\t\tfprintf(stderr, \"queue init: %d\\n\", ret);\n\t\treturn -1;\n\t}\n\n\tsqe = io_uring_get_sqe(&ring);\n\tif (!sqe) {\n\t\tfprintf(stderr, \"get sqe failed\\n\");\n\t\treturn -1;\n\t}\n\tio_uring_prep_poll_multishot(sqe, fds[0], POLLIN);\n\tio_uring_sqe_set_data64(sqe, 1);\n\tio_uring_submit(&ring);\n\n\tfor (i = 0; i < 8; i++) {\n\t\tret = write(fds[1], &tmp, sizeof(tmp));\n\t\tif (ret != sizeof(tmp)) {\n\t\t\tperror(\"write\");\n\t\t\treturn -1;\n\t\t}\n\t\tret = read(fds[0], &tmp, sizeof(tmp));\n\t\tif (ret != sizeof(tmp)) {\n\t\t\tperror(\"read\");\n\t\t\treturn -1;\n\t\t}\n\t}\n\n\tcqe_count = 0;\n\twhile (!io_uring_peek_cqe(&ring, &cqe)) {\n\t\tcqes[cqe_count++] = *cqe;\n\t\tio_uring_cqe_seen(&ring, cqe);\n\t}\n\n\t/* Some kernels might allow overflows to poll,\n\t * but if they didn't it should stop the MORE flag\n\t */\n\tif (cqe_count < 3) {\n\t\tfprintf(stderr, \"too few cqes: %d\\n\", cqe_count);\n\t\treturn -1;\n\t} else if (cqe_count == 8) {\n\t\tmore_cqe_count = cqe_count;\n\t\t/* downgrade only available since support_defer */\n\t\tif (support_defer) {\n\t\t\tfprintf(stderr, \"did not downgrade on overflow\\n\");\n\t\t\treturn -1;\n\t\t}\n\t} else {\n\t\tmore_cqe_count = cqe_count - 1;\n\t\tcqe = &cqes[cqe_count - 1];\n\t\tif (cqe->flags & IORING_CQE_F_MORE) {\n\t\t\tfprintf(stderr, \"incorrect MORE flag %x\\n\", cqe->flags);\n\t\t\treturn -1;\n\t\t}\n\t}\n\n\tfor (i = 0; i < more_cqe_count; i++) {\n\t\tcqe = &cqes[i];\n\t\tif (!(cqe->flags & IORING_CQE_F_MORE)) {\n\t\t\tfprintf(stderr, \"missing MORE flag\\n\");\n\t\t\treturn -1;\n\t\t}\n\t\tif (cqe->res < 0) {\n\t\t\tfprintf(stderr, \"bad res: %d\\n\", cqe->res);\n\t\t\treturn -1;\n\t\t}\n\t}\n\n\tclose(fds[0]);\n\tclose(fds[1]);\n\tio_uring_queue_exit(&ring);\n\treturn 0;\n}\n\nint main(int argc, char *argv[])\n{\n\tint ret;\n\tbool support_defer;\n\n\tif (argc > 1)\n\t\treturn T_EXIT_SKIP;\n\n\tsupport_defer = t_probe_defer_taskrun();\n\tret = test_downgrade(support_defer);\n\tif (ret) {\n\t\tfprintf(stderr, \"%s: test_downgrade(%d) failed\\n\", argv[0], support_defer);\n\t\treturn T_EXIT_FAIL;\n\t}\n\n\tret = test(false);\n\tif (ret == T_EXIT_SKIP)\n\t\treturn ret;\n\tif (ret != T_EXIT_PASS) {\n\t\tfprintf(stderr, \"%s: test(false) failed\\n\", argv[0]);\n\t\treturn ret;\n\t}\n\n\tif (support_defer) {\n\t\tret = test(true);\n\t\tif (ret != T_EXIT_PASS) {\n\t\t\tfprintf(stderr, \"%s: test(true) failed\\n\", argv[0]);\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\treturn ret;\n}\n"},
                          "roles": ["analysisTarget",
                                    "tracedFile"]}],
           "results": [{"ruleId": "-Wanalyzer-fd-leak",
                        "taxa": [{"id": "775",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "file-descriptor",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 1067},
                                       "gcc/analyzer/saved_diagnostic/var": "fds[0]",
                                       "gcc/analyzer/saved_diagnostic/sval": "CONJURED(_1 = pipe (&fds);, fds[(int)0])",
                                       "gcc/analyzer/saved_diagnostic/state": "fd-valid-read-write",
                                       "gcc/analyzer/saved_diagnostic/idx": 0,
                                       "gcc/analyzer/saved_diagnostic/duplicates": [{"properties": {"gcc/analyzer/saved_diagnostic/sm": "file-descriptor",
                                                                                                    "gcc/analyzer/saved_diagnostic/ploc": {"enode": 1067},
                                                                                                    "gcc/analyzer/saved_diagnostic/var": "fds[0]",
                                                                                                    "gcc/analyzer/saved_diagnostic/sval": "CONJURED(_1 = pipe (&fds);, fds[(int)0])",
                                                                                                    "gcc/analyzer/saved_diagnostic/state": "fd-valid-read-write",
                                                                                                    "gcc/analyzer/saved_diagnostic/idx": 2,
                                                                                                    "gcc/analyzer/pending_diagnostic/kind": "fd_leak"}}],
                                       "gcc/analyzer/pending_diagnostic/kind": "fd_leak"},
                        "level": "warning",
                        "message": {"text": "leak of file descriptor ‘fds[0]’"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 151,
                                                                       "startColumn": 24,
                                                                       "endColumn": 25},
                                                            "contextRegion": {"startLine": 151,
                                                                              "snippet": {"text": "\t\treturn -1;\n"}}},
                                       "logicalLocations": [{"index": 0,
                                                             "fullyQualifiedName": "test_downgrade"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 233,
                                                                                                                    "startColumn": 5,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 233,
                                                                                                                           "snippet": {"text": "int main(int argc, char *argv[])\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "entry to ‘main’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 18,
                                                                                                                                 "dst_id": 20}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 238,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 238,
                                                                                                                           "snippet": {"text": "\tif (argc > 1)\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "following ‘false’ branch (when ‘argc <= 1’)..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 18,
                                                                                                                                 "dst_id": 20}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 241,
                                                                                                                    "startColumn": 25,
                                                                                                                    "endColumn": 48},
                                                                                                         "contextRegion": {"startLine": 241,
                                                                                                                           "snippet": {"text": "\tsupport_defer = t_probe_defer_taskrun();\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 21,
                                                                                                                                 "dst_id": 22}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 242,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 44},
                                                                                                         "contextRegion": {"startLine": 242,
                                                                                                                           "snippet": {"text": "\tret = test_downgrade(support_defer);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "calling ‘test_downgrade’ from ‘main’"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 140,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 26},
                                                                                                         "contextRegion": {"startLine": 140,
                                                                                                                           "snippet": {"text": "static int test_downgrade(bool support_defer)\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "entry to ‘test_downgrade’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 149,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 22},
                                                                                                         "contextRegion": {"startLine": 149,
                                                                                                                           "snippet": {"text": "\tif (pipe(fds) != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "opened here as read-write"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "custom"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 149,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 22},
                                                                                                         "contextRegion": {"startLine": 149,
                                                                                                                           "snippet": {"text": "\tif (pipe(fds) != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "when ‘pipe’ succeeds"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 57,
                                                                                                                                 "dst_id": 60}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 149,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 149,
                                                                                                                           "snippet": {"text": "\tif (pipe(fds) != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "following ‘false’ branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 57,
                                                                                                                                 "dst_id": 60}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 154,
                                                                                                                    "startColumn": 32,
                                                                                                                    "endColumn": 38},
                                                                                                         "contextRegion": {"startLine": 154,
                                                                                                                           "snippet": {"text": "\tstruct io_uring_params params = {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 151,
                                                                                                                    "startColumn": 24,
                                                                                                                    "endColumn": 25},
                                                                                                         "contextRegion": {"startLine": 151,
                                                                                                                           "snippet": {"text": "\t\treturn -1;\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "‘fds[0]’ leaks here"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 10}]}]}]},
                       {"ruleId": "-Wanalyzer-fd-leak",
                        "taxa": [{"id": "775",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "file-descriptor",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 1067},
                                       "gcc/analyzer/saved_diagnostic/var": "fds[1]",
                                       "gcc/analyzer/saved_diagnostic/sval": "CONJURED(_1 = pipe (&fds);, fds[(int)1])",
                                       "gcc/analyzer/saved_diagnostic/state": "fd-valid-read-write",
                                       "gcc/analyzer/saved_diagnostic/idx": 1,
                                       "gcc/analyzer/saved_diagnostic/duplicates": [{"properties": {"gcc/analyzer/saved_diagnostic/sm": "file-descriptor",
                                                                                                    "gcc/analyzer/saved_diagnostic/ploc": {"enode": 1067},
                                                                                                    "gcc/analyzer/saved_diagnostic/var": "fds[1]",
                                                                                                    "gcc/analyzer/saved_diagnostic/sval": "CONJURED(_1 = pipe (&fds);, fds[(int)1])",
                                                                                                    "gcc/analyzer/saved_diagnostic/state": "fd-valid-read-write",
                                                                                                    "gcc/analyzer/saved_diagnostic/idx": 3,
                                                                                                    "gcc/analyzer/pending_diagnostic/kind": "fd_leak"}}],
                                       "gcc/analyzer/pending_diagnostic/kind": "fd_leak"},
                        "level": "warning",
                        "message": {"text": "leak of file descriptor ‘fds[1]’"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 151,
                                                                       "startColumn": 24,
                                                                       "endColumn": 25},
                                                            "contextRegion": {"startLine": 151,
                                                                              "snippet": {"text": "\t\treturn -1;\n"}}},
                                       "logicalLocations": [{"index": 0,
                                                             "fullyQualifiedName": "test_downgrade"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 233,
                                                                                                                    "startColumn": 5,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 233,
                                                                                                                           "snippet": {"text": "int main(int argc, char *argv[])\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "entry to ‘main’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 1},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(2)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 18,
                                                                                                                                 "dst_id": 20}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 238,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 238,
                                                                                                                           "snippet": {"text": "\tif (argc > 1)\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "following ‘false’ branch (when ‘argc <= 1’)..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 2},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(3)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 18,
                                                                                                                                 "dst_id": 20}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 241,
                                                                                                                    "startColumn": 25,
                                                                                                                    "endColumn": 48},
                                                                                                         "contextRegion": {"startLine": 241,
                                                                                                                           "snippet": {"text": "\tsupport_defer = t_probe_defer_taskrun();\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 3},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(4)",
                                                                                      "gcc/analyzer/checker_event/kind": "call",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 21,
                                                                                                                                 "dst_id": 22}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 242,
                                                                                                                    "startColumn": 15,
                                                                                                                    "endColumn": 44},
                                                                                                         "contextRegion": {"startLine": 242,
                                                                                                                           "snippet": {"text": "\tret = test_downgrade(support_defer);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "calling ‘test_downgrade’ from ‘main’"}},
                                                                       "kinds": ["call",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 140,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 26},
                                                                                                         "contextRegion": {"startLine": 140,
                                                                                                                           "snippet": {"text": "static int test_downgrade(bool support_defer)\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "entry to ‘test_downgrade’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 149,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 22},
                                                                                                         "contextRegion": {"startLine": 149,
                                                                                                                           "snippet": {"text": "\tif (pipe(fds) != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "opened here as read-write"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "custom"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 149,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 22},
                                                                                                         "contextRegion": {"startLine": 149,
                                                                                                                           "snippet": {"text": "\tif (pipe(fds) != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "when ‘pipe’ succeeds"}},
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 7},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(8)",
                                                                                      "gcc/analyzer/checker_event/kind": "start_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 57,
                                                                                                                                 "dst_id": 60}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 149,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 149,
                                                                                                                           "snippet": {"text": "\tif (pipe(fds) != 0) {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "following ‘false’ branch..."}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 8},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(9)",
                                                                                      "gcc/analyzer/checker_event/kind": "end_cfg_edge",
                                                                                      "gcc/analyzer/superedge_event/superedge": {"src_id": 57,
                                                                                                                                 "dst_id": 60}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 154,
                                                                                                                    "startColumn": 32,
                                                                                                                    "endColumn": 38},
                                                                                                         "contextRegion": {"startLine": 154,
                                                                                                                           "snippet": {"text": "\tstruct io_uring_params params = {\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "...to here"}},
                                                                       "kinds": ["branch",
                                                                                 "false"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 9},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(10)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "poll-mshot-overflow.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 151,
                                                                                                                    "startColumn": 24,
                                                                                                                    "endColumn": 25},
                                                                                                         "contextRegion": {"startLine": 151,
                                                                                                                           "snippet": {"text": "\t\treturn -1;\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "test_downgrade"}],
                                                                                    "message": {"text": "‘fds[1]’ leaks here"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 2,
                                                                       "executionOrder": 10}]}]}]}],
           "logicalLocations": [{"name": "test_downgrade",
                                 "fullyQualifiedName": "test_downgrade",
                                 "decoratedName": "test_downgrade",
                                 "kind": "function",
                                 "index": 0},
                                {"name": "main",
                                 "fullyQualifiedName": "main",
                                 "decoratedName": "main",
                                 "kind": "function",
                                 "index": 1}]}]}
