Closed fbucafusco closed 2 days ago
Update, I chopped some fields from the main message. (repeated EPConfig ep_configs = 4; ) I am doing that because I know the serialized array does not have anything there. I ran the test again, and was still failing (note that the asan output tells something about EPConfig) Then, I removed the
message EPConfig
{
....
}
fro the proto file...
and the asan error dissapeared
I still have another error, I will post it in a new issue.
BTW all my proto files are linked, and the definitions are included from one to the other,. I just tried to simplify the explanation.
So, when I removed the import "endpoint_config.proto";
in my main proto, the only diff in the pb.h was
#include "endpoint_config.pb.h"
Ok, I also tried to use ParsePartialFromArray (because my msg had missing fields) and asan kicks in anyways with the same error,
I have found the issue. I was using a different protoc version. I thought I had all built from the source, but still cmake was running the systemwise version of it.
What version of protobuf and what language are you using?
Version: release 28.3 Language: C++
What operating system (Linux, Windows, ...) and version? Operating System: Linux Mint 22
Kernel: Linux 6.8.0-48-generic Architecture: x86-64
What runtime / compiler are you using (e.g., python version or gcc version) gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
What did you do? I have a big message structure but I will only copy the, I think, relevant part of it where the sanitizer is complaining.
then I compiled the .proto into .pb.cc/hh
My c++ code looks like this:
What did you expect to see at least the parsing goes ok and the function exits.
What did you see instead? originally, a core dump, and then this sanitizer report
==2439447==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x5e669d5b1200 in thread T0
0 0x7a896eaff5e8 in operator delete(void*, unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:164
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs). I think, yes.
Anything else we should know about your project / environment