Skip to content

Memory leak in shaderc_compiler_initialize #1473

@Johnathan858

Description

@Johnathan858

shaderc_compiler_initialize leaks 80 bytes.

This leak only happens once regardless of how many times shaderc_compiler_initialize is called, so is likely a global object/singleton. In any case, singletons should be deleted when there are no longer any references (i.e. when the last shaderc_compiler_t object is released).

I am using the debug build of shaderc for included with the latest Vulkan SDK version 1.4.304 (released 13 Jan 2025), built for 64 bit Windows using Microsoft Visual Studio Community 2022.

Code:

shaderc_compiler_t shaderCompiler = shaderc_compiler_initialize();
shaderc_compiler_release(shaderCompiler);

I have not seen the shaderc code myself as I'm using pre-built libraries, but the shaderc library appears to link automatically with my project's memory management (overriden operator new), which is how this leak was discovered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions