{"record":{"id":"c97e09cfacbbeae3","repo":"dotnet/runtime","slug":"no-such-ctf-intrinsic-called-ctf-type","errorCode":null,"errorMessage":"no such ctf intrinsic called: {ctf_type}","messagePattern":"no such ctf intrinsic called: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/genLttngProvider.py","lineNumber":216,"sourceCode":"            if fnparam.prop:\n                #this is an explicit struct treat as a sequence\n                ctf_type = \"ctf_sequence\"\n                sizeofseq = fnparam.prop\n                field_body = \", \".join((typewName, varname, varname, \"size_t\", sizeofseq))\n\n            else:\n                ctf_type = ctfDataTypeMapping[wintypeName]\n                if ctf_type == \"ctf_string\":\n                    field_body = \", \".join((varname, varname))\n\n                elif ctf_type == \"ctf_integer\" or ctf_type == \"ctf_float\":\n                    field_body = \", \".join((typewName, varname, varname))\n\n                elif ctf_type == \"ctf_sequence\":\n                    raise Exception(\"ctf_sequence needs to have its memory expilicitly laid out\")\n\n                else:\n                    raise Exception(\"no such ctf intrinsic called: \" +  ctf_type)\n\n            field_list.append(\"        %s(%s)\" % (ctf_type, field_body))\n\n        field_list = \"\\n\".join(field_list)\n\n    return header + field_list + footer\n\ndef generateLttngHeader(providerName, allTemplates, eventNodes, runtimeFlavor):\n    lTTngHdr = []\n    for templateName in allTemplates:\n        template = allTemplates[templateName]\n        fnSig   = allTemplates[templateName].signature\n\n        lTTngHdr.append(\"\\n#define \" + templateName + \"_TRACEPOINT_ARGS \\\\\\n\")\n\n#TP_ARGS\n        tp_args = generateArgList(template, runtimeFlavor)\n        lTTngHdr.append(tp_args)","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/genLttngProvider.py#L198-L234","documentation":"Raised by generateFieldList() in genLttngProvider.py when ctf_type (the LTTng CTF field macro type) doesn't match any of the handled cases: ctf_string, ctf_integer, ctf_float, or ctf_sequence. This is a defensive fallback in the else branch that should never be reached if ctfDataTypeMapping is consistent with the handler branches.","triggerScenarios":"Triggered when ctfDataTypeMapping[wintypeName] returns a value not equal to 'ctf_string', 'ctf_integer', 'ctf_float', or 'ctf_sequence'. Since ctfDataTypeMapping only contains those four values, this error would only fire if the mapping dictionary is modified to include a new CTF type without updating the handler, or if wintypeName is somehow not in the dictionary (which would raise KeyError first). It's effectively unreachable dead-code defense.","commonSituations":"This is a defensive assertion that should rarely fire in practice. It would fire if someone extends ctfDataTypeMapping with a new ctf_ type (like 'ctf_array') but forgets to add a handler branch. It could also fire if the win:null type (which maps to ' ' in some dictionaries) somehow reaches this code path.","solutions":["Check what ctf_type value was returned and compare against ctfDataTypeMapping.","If a new CTF type was added to ctfDataTypeMapping, add a corresponding handler branch in generateFieldList().","File a bug if this fires without code changes — it indicates a logic error in the generator."],"exampleFix":"# before\nelif ctf_type == \"ctf_sequence\":\n    raise Exception(\"ctf_sequence needs to have its memory expilicitly laid out\")\nelse:\n    raise Exception(\"no such ctf intrinsic called: \" +  ctf_type)\n\n# after - add handler for new ctf type\nelif ctf_type == \"ctf_sequence\":\n    raise Exception(\"ctf_sequence needs to have its memory expilicitly laid out\")\nelif ctf_type == \"ctf_array\":\n    field_body = \", \".join((typewName, varname, varname))\nelse:\n    raise Exception(\"no such ctf intrinsic called: \" +  ctf_type)","handlingStrategy":"validation","validationCode":"VALID_CTF_TYPES = frozenset(['ctf_integer', 'ctf_string', 'ctf_float', 'ctf_sequence'])\n\ndef validate_ctf_type_coverage() -> bool:\n    \"\"\"Verify all ctfDataTypeMapping values are handled in generateFieldList.\"\"\"\n    from genLttngProvider import ctfDataTypeMapping\n    all_values = set(ctfDataTypeMapping.values())\n    unhandled = all_values - VALID_CTF_TYPES\n    if unhandled:\n        print(f\"CTF types in mapping but not handled: {unhandled}\")\n        return False\n    return True","typeGuard":"null","tryCatchPattern":"# This is effectively a generator internal error; callers should report it.\ntry:\n    generateLttngHeader(providerName, allTemplates, eventNodes, runtimeFlavor)\nexcept Exception as e:\n    if 'no such ctf intrinsic' in str(e):\n        print(f\"Internal LTTng generator error: {e}\")\n        print(\"This indicates a bug in genLttngProvider.py — file an issue.\")\n    raise","preventionTips":["Keep ctfDataTypeMapping and the generateFieldList handler branches in sync.","Add a self-test that validates all mapping values are handled.","This error is a defensive guard — if it fires, it's a code bug, not a manifest issue.","Add new CTF types to both the mapping and the handler simultaneously."],"tags":["lttng","etw","manifest","eventing","coreclr","ctf"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}