dotnet/runtime · error · Exception

no such ctf intrinsic called

Error message

no such ctf intrinsic called: {ctf_type}

What it means

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.

Solutions

  1. Check what ctf_type value was returned and compare against ctfDataTypeMapping.
  2. If a new CTF type was added to ctfDataTypeMapping, add a corresponding handler branch in generateFieldList().
  3. File a bug if this fires without code changes — it indicates a logic error in the generator.

Example fix

# before
elif ctf_type == "ctf_sequence":
    raise Exception("ctf_sequence needs to have its memory expilicitly laid out")
else:
    raise Exception("no such ctf intrinsic called: " +  ctf_type)

# after - add handler for new ctf type
elif ctf_type == "ctf_sequence":
    raise Exception("ctf_sequence needs to have its memory expilicitly laid out")
elif ctf_type == "ctf_array":
    field_body = ", ".join((typewName, varname, varname))
else:
    raise Exception("no such ctf intrinsic called: " +  ctf_type)
Defensive patterns

Strategy: validation

Validate before calling

VALID_CTF_TYPES = frozenset(['ctf_integer', 'ctf_string', 'ctf_float', 'ctf_sequence'])

def validate_ctf_type_coverage() -> bool:
    """Verify all ctfDataTypeMapping values are handled in generateFieldList."""
    from genLttngProvider import ctfDataTypeMapping
    all_values = set(ctfDataTypeMapping.values())
    unhandled = all_values - VALID_CTF_TYPES
    if unhandled:
        print(f"CTF types in mapping but not handled: {unhandled}")
        return False
    return True

Type guard

null

Try / catch

# This is effectively a generator internal error; callers should report it.
try:
    generateLttngHeader(providerName, allTemplates, eventNodes, runtimeFlavor)
except Exception as e:
    if 'no such ctf intrinsic' in str(e):
        print(f"Internal LTTng generator error: {e}")
        print("This indicates a bug in genLttngProvider.py — file an issue.")
    raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10). Data as JSON: /api/errors/c97e09cfacbbeae3. Report an issue: GitHub.

Appendix: source

Thrown at src/coreclr/scripts/genLttngProvider.py:216

            if fnparam.prop:
                #this is an explicit struct treat as a sequence
                ctf_type = "ctf_sequence"
                sizeofseq = fnparam.prop
                field_body = ", ".join((typewName, varname, varname, "size_t", sizeofseq))

            else:
                ctf_type = ctfDataTypeMapping[wintypeName]
                if ctf_type == "ctf_string":
                    field_body = ", ".join((varname, varname))

                elif ctf_type == "ctf_integer" or ctf_type == "ctf_float":
                    field_body = ", ".join((typewName, varname, varname))

                elif ctf_type == "ctf_sequence":
                    raise Exception("ctf_sequence needs to have its memory expilicitly laid out")

                else:
                    raise Exception("no such ctf intrinsic called: " +  ctf_type)

            field_list.append("        %s(%s)" % (ctf_type, field_body))

        field_list = "\n".join(field_list)

    return header + field_list + footer

def generateLttngHeader(providerName, allTemplates, eventNodes, runtimeFlavor):
    lTTngHdr = []
    for templateName in allTemplates:
        template = allTemplates[templateName]
        fnSig   = allTemplates[templateName].signature

        lTTngHdr.append("\n#define " + templateName + "_TRACEPOINT_ARGS \\\n")

#TP_ARGS
        tp_args = generateArgList(template, runtimeFlavor)
        lTTngHdr.append(tp_args)

View on GitHub (pinned to 60108ba66e)