Skip to content

[C++] StructArray::field() is not thread safe #48134

@tobim

Description

@tobim

Describe the bug, including details regarding any error messages, version, and platform.

It is possible for two threads calling StructArray::field() with the same index at the same time to cause a race on the stored entry in boxed_fields_. I.e. if a second thread goes into the path that calls MakeArray() before the first thread stored its own new array, the second thread would also write to the same shared_ptr and invalidate the shared_ptr from the first thread, thereby also invalidating the returned reference.

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions