dotnet/runtime · error · Exception

Don't know size for {}

Error message

Don't know size for {}

What it means

Raised by getParamSequenceSize() in genEventing.py when computing the exact (non-estimated) byte size of a template's parameter sequence. The function has explicit size mappings for known ETW types (win:Int64=8, win:UInt32=4, etc.). When estimate=False and the parameter type doesn't match any known type, and isn't a string/struct being estimated, the exception fires.

Source

Thrown at src/coreclr/scripts/genEventing.py:244

            total += 2
        elif param == "win:UInt8":
            total += 1
        elif param == "win:Pointer":
            if estimate:
                total += 8
            else:
                pointers += 1
        elif param == "win:Binary":
            total += 1
        elif estimate:
            if param == "win:AnsiString":
                total += 32
            elif param == "win:UnicodeString":
                total += 64
            elif param == "win:Struct":
                total += 32
        else:
            raise Exception("Don't know size for " + param)

    if estimate:
        return total

    return total, pointers


class Template:
    def __repr__(self):
        return "<Template " + self.name + ">"

    def __init__(self, templateName, fnPrototypes, dependencies, structSizes, arrays):
        self.name = templateName
        self.signature = FunctionSignature()
        self.structs = structSizes
        self.arrays = arrays

        for variable in fnPrototypes.paramlist:

View on GitHub (pinned to 60108ba66e)

Solutions

  1. Check the ETW manifest for the data element with the unrecognized inType and fix any typos.
  2. Add the missing type and its byte size to the if/elif chain in getParamSequenceSize().
  3. Ensure the type is a standard ETW input type (win:Int8, win:HexInt32, etc. may need adding).

Example fix

# before
elif param == "win:Binary":
    total += 1
elif estimate:
    ...
else:
    raise Exception("Don't know size for " + param)

# after - add missing type
elif param == "win:Binary":
    total += 1
elif param == "win:HexInt32":
    total += 4
elif param == "win:Int8":
    total += 1
elif estimate:
    ...
else:
    raise Exception("Don't know size for " + param)
Defensive patterns

Strategy: validation

Validate before calling

KNOWN_EXACT_SIZES = {
    'win:Int64': 8, 'win:ULong': 4, 'GUID': 16, 'win:Double': 8,
    'win:Int32': 4, 'win:Boolean': 4, 'win:UInt64': 8, 'win:UInt32': 4,
    'win:UInt16': 2, 'win:UInt8': 1, 'win:Pointer': 8, 'win:Binary': 1,
}

def can_compute_exact_size(param_types) -> bool:
    """Check if all parameter types have known exact sizes."""
    return all(t in KNOWN_EXACT_SIZES for t in param_types)

Type guard

null

Try / catch

try:
    total = getParamSequenceSize(params, estimate=False)
except Exception as e:
    if "Don't know size" in str(e):
        # Fall back to estimated size for unknown types
        total = getParamSequenceSize(params, estimate=True)
        logging.warning(f"Using estimated size due to unknown type: {e}")
    else:
        raise

Prevention

When it happens

Trigger: Triggered when getParamSequenceSize is called with estimate=False (exact size mode) and encounters a parameter whose winType is not in the hardcoded list of known types. The known types are: win:Int64, win:ULong, GUID, win:Double, win:Int32, win:Boolean, win:UInt64, win:UInt32, win:UInt16, win:UInt8, win:Pointer, win:Binary (and win:AnsiString/win:UnicodeString/win:Struct only when estimate=True). This function is called from Template.estimated_size property with estimate=True, so the error would come from another caller using estimate=False.

Common situations: A new ETW input type is added to the manifest that isn't in the size mapping. The manifest uses a custom or non-standard inType value. A typo in the inType attribute produces an unrecognized type string.

Related errors


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