{"$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-unsafe-call-within-signal-handler",
                                          "helpUri": "https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Static-Analyzer-Options.html#index-Wanalyzer-unsafe-call-within-signal-handler"}]}},
           "taxonomies": [{"name": "CWE",
                           "version": "4.7",
                           "organization": "MITRE",
                           "shortDescription": {"text": "The MITRE Common Weakness Enumeration"},
                           "taxa": [{"id": "479",
                                     "helpUri": "https://cwe.mitre.org/data/definitions/479.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",
                                          "d77a67ed5f27.c",
                                          "-quiet",
                                          "-dumpbase",
                                          "d77a67ed5f27.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/1499-wSUv.sarif",
                                          "-o",
                                          "/tmp/ccz65UFt.s"],
                            "workingDirectory": {"uri": "/builddir/build/BUILD/liburing-2.13-build/liburing-2.13/test"},
                            "startTimeUtc": "2026-08-03T18:01:39Z",
                            "executionSuccessful": true,
                            "toolExecutionNotifications": [],
                            "endTimeUtc": "2026-08-03T18:01:39Z"}],
           "originalUriBaseIds": {"PWD": {"uri": "file:///builddir/build/BUILD/liburing-2.13-build/liburing-2.13/test/"}},
           "artifacts": [{"location": {"uri": "d77a67ed5f27.c",
                                       "uriBaseId": "PWD"},
                          "sourceLanguage": "c",
                          "contents": {"text": "/* SPDX-License-Identifier: MIT */\n#include <stdio.h>\n#include <unistd.h>\n#include <string.h>\n#include <signal.h>\n#include <stdlib.h>\n#include \"liburing.h\"\n#include \"helpers.h\"\n\nstatic void sig_alrm(int sig)\n{\n\tfprintf(stderr, \"Timed out!\\n\");\n\texit(1);\n}\n\nint main(int argc, char *argv[])\n{\n\tstruct io_uring_sqe *sqe;\n\tstruct io_uring_cqe *cqe;\n\tstruct io_uring_params p;\n\tstruct io_uring ring;\n\tint ret, data;\n\n\tif (argc > 1)\n\t\treturn T_EXIT_SKIP;\n\n\tsignal(SIGALRM, sig_alrm);\n\n\tmemset(&p, 0, sizeof(p));\n\tp.sq_thread_idle = 100;\n\tp.flags = IORING_SETUP_SQPOLL;\n\tret = t_create_ring_params(4, &ring, &p);\n\tif (ret == T_SETUP_SKIP)\n\t\treturn T_EXIT_SKIP;\n\telse if (ret < 0)\n\t\treturn T_EXIT_FAIL;\n\n\t/* make sure sq thread is sleeping at this point */\n\tusleep(150000);\n\talarm(1);\n\n\tsqe = io_uring_get_sqe(&ring);\n\tif (!sqe) {\n\t\tfprintf(stderr, \"sqe get failed\\n\");\n\t\treturn T_EXIT_FAIL;\n\t}\n\n\tio_uring_prep_nop(sqe);\n\tio_uring_sqe_set_data(sqe, (void *) (unsigned long) 42);\n\tio_uring_submit_and_wait(&ring, 1);\n\n\tret = io_uring_peek_cqe(&ring, &cqe);\n\tif (ret) {\n\t\tfprintf(stderr, \"cqe get failed\\n\");\n\t\treturn 1;\n\t}\n\n\tdata = (unsigned long) io_uring_cqe_get_data(cqe);\n\tif (data != 42) {\n\t\tfprintf(stderr, \"invalid data: %d\\n\", data);\n\t\treturn T_EXIT_FAIL;\n\t}\n\n\treturn T_EXIT_PASS;\n}\n"},
                          "roles": ["analysisTarget",
                                    "tracedFile"]}],
           "results": [{"ruleId": "-Wanalyzer-unsafe-call-within-signal-handler",
                        "taxa": [{"id": "479",
                                  "toolComponent": {"name": "cwe"}}],
                        "properties": {"gcc/analyzer/saved_diagnostic/sm": "signal",
                                       "gcc/analyzer/saved_diagnostic/ploc": {"enode": 296},
                                       "gcc/analyzer/saved_diagnostic/state": "in_signal_handler",
                                       "gcc/analyzer/saved_diagnostic/idx": 0,
                                       "gcc/analyzer/pending_diagnostic/kind": "signal_unsafe_call"},
                        "level": "warning",
                        "message": {"text": "call to ‘exit’ from within signal handler"},
                        "locations": [{"physicalLocation": {"artifactLocation": {"uri": "d77a67ed5f27.c",
                                                                                 "uriBaseId": "PWD"},
                                                            "region": {"startLine": 13,
                                                                       "startColumn": 9,
                                                                       "endColumn": 16},
                                                            "contextRegion": {"startLine": 13,
                                                                              "snippet": {"text": "\texit(1);\n"}}},
                                       "logicalLocations": [{"index": 0,
                                                             "fullyQualifiedName": "sig_alrm"}]}],
                        "codeFlows": [{"threadFlows": [{"id": "main",
                                                        "locations": [{"properties": {"gcc/analyzer/checker_event/emission_id": "(1)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "d77a67ed5f27.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 16,
                                                                                                                    "startColumn": 5,
                                                                                                                    "endColumn": 9},
                                                                                                         "contextRegion": {"startLine": 16,
                                                                                                                           "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": 1,
                                                                                                                                 "dst_id": 3}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "d77a67ed5f27.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 24,
                                                                                                                    "startColumn": 12,
                                                                                                                    "endColumn": 13},
                                                                                                         "contextRegion": {"startLine": 24,
                                                                                                                           "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": 1,
                                                                                                                                 "dst_id": 3}},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "d77a67ed5f27.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 27,
                                                                                                                    "startColumn": 9,
                                                                                                                    "endColumn": 34},
                                                                                                         "contextRegion": {"startLine": 27,
                                                                                                                           "snippet": {"text": "\tsignal(SIGALRM, sig_alrm);\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": "state_change"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "d77a67ed5f27.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 27,
                                                                                                                    "startColumn": 9,
                                                                                                                    "endColumn": 34},
                                                                                                         "contextRegion": {"startLine": 27,
                                                                                                                           "snippet": {"text": "\tsignal(SIGALRM, sig_alrm);\n"}}},
                                                                                    "logicalLocations": [{"index": 1,
                                                                                                          "fullyQualifiedName": "main"}],
                                                                                    "message": {"text": "registering ‘sig_alrm’ as signal handler"}},
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 4},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(5)",
                                                                                      "gcc/analyzer/checker_event/kind": "custom"},
                                                                       "location": {"message": {"text": "later on, when the signal is delivered to the process"}},
                                                                       "nestingLevel": 0,
                                                                       "executionOrder": 5},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(6)",
                                                                                      "gcc/analyzer/checker_event/kind": "function_entry"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "d77a67ed5f27.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 10,
                                                                                                                    "startColumn": 13,
                                                                                                                    "endColumn": 21},
                                                                                                         "contextRegion": {"startLine": 10,
                                                                                                                           "snippet": {"text": "static void sig_alrm(int sig)\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "sig_alrm"}],
                                                                                    "message": {"text": "entry to ‘sig_alrm’"}},
                                                                       "kinds": ["enter",
                                                                                 "function"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 6},
                                                                      {"properties": {"gcc/analyzer/checker_event/emission_id": "(7)",
                                                                                      "gcc/analyzer/checker_event/kind": "warning"},
                                                                       "location": {"physicalLocation": {"artifactLocation": {"uri": "d77a67ed5f27.c",
                                                                                                                              "uriBaseId": "PWD"},
                                                                                                         "region": {"startLine": 13,
                                                                                                                    "startColumn": 9,
                                                                                                                    "endColumn": 16},
                                                                                                         "contextRegion": {"startLine": 13,
                                                                                                                           "snippet": {"text": "\texit(1);\n"}}},
                                                                                    "logicalLocations": [{"index": 0,
                                                                                                          "fullyQualifiedName": "sig_alrm"}],
                                                                                    "message": {"text": "call to ‘exit’ from within signal handler"}},
                                                                       "kinds": ["danger"],
                                                                       "nestingLevel": 1,
                                                                       "executionOrder": 7}]}]}],
                        "relatedLocations": [{"physicalLocation": {"artifactLocation": {"uri": "d77a67ed5f27.c",
                                                                                        "uriBaseId": "PWD"},
                                                                   "region": {"startLine": 13,
                                                                              "startColumn": 9,
                                                                              "endColumn": 16},
                                                                   "contextRegion": {"startLine": 13,
                                                                                     "snippet": {"text": "\texit(1);\n"}}},
                                              "message": {"text": "‘_exit’ is a possible signal-safe alternative for ‘exit’"},
                                              "properties": {"nestingLevel": 0}}]}],
           "logicalLocations": [{"name": "sig_alrm",
                                 "fullyQualifiedName": "sig_alrm",
                                 "decoratedName": "sig_alrm",
                                 "kind": "function",
                                 "index": 0},
                                {"name": "main",
                                 "fullyQualifiedName": "main",
                                 "decoratedName": "main",
                                 "kind": "function",
                                 "index": 1}]}]}
