Replies: 1 comment
-
|
Thanks. I replied via the google group. Sorry for delay. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
CppUTest 4.0
Protobuf 3.18.3
GCC 11.2.0
I am writing tests for a RPC client that is using protobuf under the hood - here is a very simple protofile to demonstrate the issue I am experiencing:
And here is the test:
This causes a leak because internally protobuf allocates pools of memory that it doesn't free until the program terminates.
I can fix this error by calling
google::protobuf::ShutdownProtobufLibrary();but after this called all other tests using protobuf will segfault.I tried adding
IGNORE_ALL_LEAKS_IN_TEST();but this seems to have no effect.I have also tried wrapping the test with
MemoryLeakWarningPlugin::saveAndDisableNewDeleteOverloads();andMemoryLeakWarningPlugin::restoreNewDeleteOverloads();this causes a segfault - I haven't tracked down exactly why, but I suspect it is a mismatch between the version of new and delete used seeing protobuf might be freeing memory after the New/Delete overloads have been restored.I am not sure if anyone has and suggestions or ideas on what to try next, but any advice would be appreciated.
Thanks.
-- edit
Added version numbers
Beta Was this translation helpful? Give feedback.
All reactions