It is cpp code. I initially thought the issue is NULL pointers but then I replaced all the fields with hardcoded constant values and I still got the same issue.--On Wednesday, May 17, 2023 at 12:41:37 PM UTC-7 Harsh Ranjan wrote:Hey Team,I have been trying to add unit-test for my protobuf class. Attaching the full error as pdf.
[3 / 3] Leaked 72 bytes allocated at 000002E2A001AAC0
at Mso::Memory::AllocateEx [liblet\debugheap\memoryapiimpl\memoryapi.cpp(19)]
at Mso::Memory::Throw::AllocateEx [x64\debug\liblet_operatornew\x-none\x64\inc\core\memoryApi_throw.h(29)]
at operator new [x64\debug\liblet_precomp\x-none\x64\inc\core\memoryNew_Throw.h(61)]
at google::protobuf::Arena::CreateInternal<TelemetryProtobuf::EventNamespace> [x64\debug\telemetry_serializersink\x-none\x64\inc\google\protobuf\arena.h(527)]
at google::protobuf::Arena::CreateMaybeMessage<TelemetryProtobuf::EventNamespace> [telemetry\serializersink\telemetryevent_v310.pb.cc(12052)]
at google::protobuf::MessageLite::CreateMaybeMessage<TelemetryProtobuf::EventNamespace> [x64\debug\telemetry_serializersink\x-none\x64\inc\google\protobuf\message_lite.h(449)]I am just populating the protobuf event.void PopulateEventNameSpace(TelemetryProtobuf::EventNamespace& protobufEventNamespace, const Telemetry::TelemetryNamespace& telemetryNamespace) noexcept
{
protobufEventNamespace.set_fullnamelength(8);
protobufEventNamespace.set_nodenamecount(1010);
}
void PopulateEventName(TelemetryProtobuf::EventName& protobufEventName, const Telemetry::EventName& telemetryEventName) noexcept
{
protobufEventName.set_eventnodename("baz");
PopulateEventNameSpace(*protobufEventName.mutable_eventnamespace(), telemetryEventName.GetNamespace());
}Anything I am missing here? I am using the protobuf version 3.10Thanks,Harsh
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/45432e0a-50e0-48de-8811-50024981d805n%40googlegroups.com.
Do we need to explicitly destroy them? I am calling google::protobuf::ShutdownProtobufLibrary() at then end but this error pops up before this. Should I try to get rid of pointers and work with copy?
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/521a5ca8-66ac-42a2-a414-62159f16f306n%40googlegroups.com.
Looks like other folks faced similar issues with debug mode.
https://github.com/protocolbuffers/protobuf/issues/6443On Wednesday, May 17, 2023 at 11:25:26 PM UTC-7 Harsh Ranjan wrote:The code is working fine in release mode but in debug mode it is throwing Structured exception. Anyway by which we can enable same library for both debug and release mode.On Wednesday, May 17, 2023 at 3:37:22 PM UTC-7 Harsh Ranjan wrote:
Is there a way I can debug on my local machine where protobufEventName is getting created? That is either stack/heap or arena?Based on the error it looks to me it is getting created in arena.
at google::protobuf::Arena::CreateInternal<TelemetryProtobuf::EventNamespace> [x64\debug\telemetry_serializersink\x-none\x64\inc\google\protobuf\arena.h(527)]
at google::protobuf::Arena::CreateMaybeMessage<TelemetryProtobuf::EventNamespace> [telemetry\serializersink\telemetryevent_v310.pb.cc(12052)]
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/31239c13-feba-4ed0-90dd-580238924cc7n%40googlegroups.com.