Skip to content

Mismatch between AggregationConfig and AggregationType in View constructor could cause memory corruption #3731

@ThomsonTan

Description

@ThomsonTan

In the current implementation of the View constructor in metrics, both AggregationType and AggregationConfig are supplied by the user, which introduces a potential mismatch—for example, passing the base AggregationConfig when the type is kHistogram. Such inconsistency leads to unsafe type casting, as the system attempts to reinterpret the base configuration as a derived one, resulting in undefined behavior and possible server-side memory access violations.

View view("view_name", "description", AggregationType::kDefault, aggregation_config);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions