Windows HLK appverifier detects leaked heap allocation(s)

69 views
Skip to first unread message

Michael Ngarimu

unread,
Oct 27, 2022, 8:03:33 PM10/27/22
to Protocol Buffers
On Windows I use protobuf inside a DLL that is loaded/unloaded outside my control.

The Windows appverifier detects the following as a leaked heap allocation. While I understand it may be the case that protobuf allocates global/singleton instances on the heap to exist for the lifetime of the program, the appverifier is run as part of the Windows HLK process and certification fails due to detected heap allocation leaks.

Am I just out of luck with using protobuf in applications that require Windows certification or is there way to clean up these allocations?

    00007ff9ba00460c ntdll!RtlDebugAllocateHeap+0x0000000000000048
    00007ff9b9fbdc72 ntdll!RtlpAllocateHeap+0x0000000000092b12
    00007ff9b9f2929c ntdll!RtlpAllocateHeapInternal+0x00000000000006ac
    00007ff981dac31c vrfcore!VfCoreRtlAllocateHeap+0x000000000000002c
    00007ff92cbf3555 vfbasics!AVrfpRtlAllocateHeap+0x0000000000000155
    00007ff91a38d980 MyLibraryDLL!heap_alloc_dbg_internal+0x0000000000000210
    00007ff91a38d71d MyLibraryDLL!heap_alloc_dbg+0x000000000000004d
    00007ff91a39087f MyLibraryDLL!_malloc_dbg+0x000000000000002f
    00007ff91a3898ae MyLibraryDLL!malloc+0x000000000000001e
    00007ff91a328a73 MyLibraryDLL!operator new+0x0000000000000013
    00007ff91a028eb4 MyLibraryDLL!std::_Default_allocate_traits::_Allocate+0x0000000000000014
    00007ff91a026936 MyLibraryDLL!std::_Allocate<16,std::_Default_allocate_traits,0>+0x0000000000000036
    00007ff91a029f51 MyLibraryDLL!std::allocator<std::_Container_proxy>::allocate+0x0000000000000021
    00007ff91a0268ae MyLibraryDLL!std::_Container_base12::_Alloc_proxy<std::allocator<std::_Container_proxy> >+0x000000000000001e
    00007ff91a061a51 MyLibraryDLL!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >+0x0000000000000051
    00007ff91a0cf19b MyLibraryDLL!google::protobuf::internal::ExplicitlyConstructed<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::DefaultConstruct+0x000000000000002b
    00007ff91a0ca352 MyLibraryDLL!google::protobuf::internal::InitProtobufDefaultsImpl+0x0000000000000012
    00007ff91a0c75d5 MyLibraryDLL!google::protobuf::internal::InitProtobufDefaultsSlow+0x0000000000000045
    00007ff91a0230ab MyLibraryDLL!google::protobuf::internal::`dynamic initializer for 'init_empty_string''+0x000000000000000b
    00007ff91a3c0923 MyLibraryDLL!_initterm+0x0000000000000063
    00007ff91a328715 MyLibraryDLL!dllmain_crt_process_attach+0x00000000000000a5

Matthew Fowles Kulukundis

unread,
Oct 27, 2022, 8:14:27 PM10/27/22
to Michael Ngarimu, Protocol Buffers
Michael~

Protobuf doesn't support dynamic unloading.  Also, the next release will have a dependency on Abseil which also doesn't support dynamic unloading, so this is only going to become more pronounced.

Matt

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/840f250e-4524-4841-9503-237d9f40fe18n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages