Skip to content

fix(array): add nil checks in Data.Release() for childData#456

Merged
zeroshade merged 2 commits intoapache:mainfrom
secfree:250731-release-panic
Aug 5, 2025
Merged

fix(array): add nil checks in Data.Release() for childData#456
zeroshade merged 2 commits intoapache:mainfrom
secfree:250731-release-panic

Conversation

@secfree
Copy link
Contributor

@secfree secfree commented Jul 31, 2025

Rationale for this change

My program crashed with below log

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x53beb92]

goroutine 294 [running]:
github.com/apache/arrow-go/v18/arrow/array.(*Data).Release(0xc02586a5b0)
        /root/go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.0/arrow/array/data.go:150 +0x172
github.com/apache/arrow-go/v18/arrow/array.concat.func1()
        /root/go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.0/arrow/array/concat.go:528 +0x9c
github.com/apache/arrow-go/v18/arrow/array.concat({0xc14ae66008, 0x100, 0x100}, {0x83213c0, 0xb026080})
        /root/go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.0/arrow/array/concat.go:652 +0x3f7d
github.com/apache/arrow-go/v18/arrow/array.Concatenate({0xc104861908, 0x100, 0x12f}, {0x83213c0, 0xb026080})
        /root/go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.0/arrow/array/concat.go:55 +0x585
...

What changes are included in this PR?

Add nil check in Data.Release() for childData to avoid crash.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@secfree secfree requested a review from zeroshade as a code owner July 31, 2025 06:06
@zeroshade
Copy link
Member

Could you add a test for this please?

@secfree
Copy link
Contributor Author

secfree commented Aug 1, 2025

Could you add a test for this please?

Added.

@zeroshade zeroshade merged commit 4c2983c into apache:main Aug 5, 2025
21 of 23 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