#include <iostream>
#include "CVServiceRequest.pb.h"
static const std::string CVS_REQUEST_DUMMY_ID = "123";
using namespace cvclient::data::request;
int main(int args, char** argv) {
GOOGLE_PROTOBUF_VERIFY_VERSION;
std::cout << "Hello World" << std::endl;
CVInternalRequest internalRequest;
internalRequest.mutable_basecvrequest()->set_requestid(CVS_REQUEST_DUMMY_ID);
}
```
We would hit a SEGB in set_requestid() beacuse the arena pointer is bogus.
BaseCVRequest is within CVInternalRequest.
What seems to happen is GetArenaForAllocation() returns nullptr, but when it gets call into arenastring's Set function, it become a bogus pointer.
```
google::protobuf::internal::ArenaStringPtr::Set (this=0x46be50, value=..., arena=0x460014) at google/protobuf/arenastring.cc:102
Python Exception <class 'ModuleNotFoundError'>: No module named 'gdb.styling'
102 Set(&GetEmptyStringAlreadyInited(), value, arena);
(gdb) list
97 }
98 }
99
100 void ArenaStringPtr::Set(EmptyDefault, ConstStringParam value,
101 ::google::protobuf::Arena* arena) {
102 Set(&GetEmptyStringAlreadyInited(), value, arena);
103 }
104
105 void ArenaStringPtr::Set(EmptyDefault, std::string&& value,
106 ::google::protobuf::Arena* arena) {
(gdb) p value
$1 = (google::protobuf::ConstStringParam) <error reading variable: Cannot access memory at address 0x0>
(gdb)
```
The libprotobuf.so shared lib on our target i s GCC-V11.2 built. Has anyone encountered similar issue.
Thanks,
Mike