Skip to content

fix(arrow/array): avoid copying initialized extension refcounts - #1089

Merged
zeroshade merged 2 commits into
apache:mainfrom
fallintoplace:fix/extension-base-copy
Aug 7, 2026
Merged

fix(arrow/array): avoid copying initialized extension refcounts#1089
zeroshade merged 2 commits into
apache:mainfrom
fallintoplace:fix/extension-base-copy

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

The extension array constructor initializes the base reference count and then copies the complete value through reflection. That can copy an atomic after first use and triggers the copylocks vet warning.

What changes are included in this PR?

Allocate the concrete extension array first and initialize its embedded ExtensionArrayBase directly in the destination.

Are these changes tested?

  • go test ./arrow/array
  • go vet ./arrow/array

Are there any user-facing changes?

No API changes. This corrects the reported behavior while preserving the existing ownership and compatibility contracts.

@fallintoplace fallintoplace changed the title fix(arrow/array): initialize extension bases in place fix(arrow/array): initialize extension bases without copying atomics Aug 5, 2026
@fallintoplace
fallintoplace force-pushed the fix/extension-base-copy branch from b2d6a8c to 792e8db Compare August 5, 2026 23:37
@fallintoplace fallintoplace changed the title fix(arrow/array): initialize extension bases without copying atomics fix(arrow/array): avoid copying initialized extension refcounts Aug 6, 2026
@zeroshade
zeroshade merged commit a27b596 into apache:main Aug 7, 2026
11 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants