Skip to content

Missing cpuinfo_deinitialize implementation #150

@jrosdahl

Description

@jrosdahl

When using ONNX Runtime (which has PyTorch cpuinfo as a static dependency) with a Linux program built with LeakSanitizer/AddressSanitizer, memory leaks are reported:

=================================================================
==11753==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 576 byte(s) in 1 object(s) allocated from:
    #0 0x2b11dd429917 in __interceptor_calloc (/path/to/libasan.so.6+0xb4917)
    #1 0x2b11e45064b6 in cpuinfo_x86_linux_init (/path/to/libonnxruntime.so.1.14.1+0x8684b6)

Direct leak of 576 byte(s) in 1 object(s) allocated from:
    #0 0x2b11dd429917 in __interceptor_calloc (/path/to/libasan.so.6+0xb4917)
    #1 0x2b11e4506496 in cpuinfo_x86_linux_init (/path/to/libonnxruntime.so.1.14.1+0x868496)

SUMMARY: AddressSanitizer: 1152 byte(s) leaked in 2 allocation(s).

ONNX Runtime doesn't call cpuinfo_deinitialize, but on the other hand that wouldn't help since the implementation is empty.

It would be nice if cpuinfo_deinitialize could be implemented so that ONNX Runtime and other users can call it to deallocate the resources.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions