Repository navigation
GH-55648: [C++][CI] Fix protobuf-induced Valgrind failures - #55649
Conversation
c47e809 to
568dbb2
Compare
|
@github-actions crossbow submit -g cpp |
|
@taepper Would you like to take a quick look at this? |
|
Revision: 568dbb2 Submitted crossbow builds: ursacomputing/crossbow @ actions-6e04c8309f |
taepper
left a comment
There was a problem hiding this comment.
Zeroing the padding of the buffer makes sense for avoiding these exact types of valgrind errors.
I cannot judge the change of
fun:*google*protobuf*AddDescriptorsRunner*
to
fun:*google*protobuf*AddDescriptors*
We may need to initialize these bytes as well in parser.cc:810:
if (json->capacity() - json->size() >=
static_cast<int64_t>(simdjson::SIMDJSON_PADDING)) {
const auto padded_json = simdjson::padded_string_view(
reinterpret_cast<const char*>(json->data()), json->size(), json->capacity());
return parse(padded_json);
}
An arrow::Buffer exposes the method ZeroPadding() which we might use here? But you are definitely more familiar with the factories for these buffers, and maybe all sources already zero it?
|
Hmm, we have no guarantee that the input buffer is mutable, since it's passed by the caller. Fortunately, Valgrind doesn't seem to budge on this currently, so we don't have to care immediately :) |
|
CI failures are unrelated, I'll merge. Thanks for the review @taepper ! |
Rationale for this change
Silence Valgrind failures due to eternal memory allocation in Protobuf initialization routines.
Also fix Valgrind failures due to processing uninitialized padding when chunking JSON input.
Are these changes tested?
Yes, by existing CI job.
Are there any user-facing changes?
No.
Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: