Title: Calling `retain` on a closed ArrowBuf revives it, into an undefined state · Issue #906 · apache/arrow-java · GitHub
Open Graph Title: Calling `retain` on a closed ArrowBuf revives it, into an undefined state · Issue #906 · apache/arrow-java
X Title: Calling `retain` on a closed ArrowBuf revives it, into an undefined state · Issue #906 · apache/arrow-java
Description: Describe the bug, including details regarding any error messages, version, and platform. @Test fun testArrowBufRetainBug() { RootAllocator().use { al -> val buf = al.buffer(10) buf.close() // correctly throws assertThrows Open Graph Description: Describe the bug, including details regarding any error messages, version, and platform. @Test fun testArrowBufRetainBug() { RootAllocator().use { al -> val buf = al.buffer(10) buf.close() // corre...
X Description: Describe the bug, including details regarding any error messages, version, and platform. @Test fun testArrowBufRetainBug() { RootAllocator().use { al -> val buf = al.buffer(10) buf.close() // co...
Opengraph URL: https://github.com/apache/arrow-java/issues/906
X: @github
Domain: patch-diff.githubusercontent.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Calling `retain` on a closed ArrowBuf revives it, into an undefined state","articleBody":"### Describe the bug, including details regarding any error messages, version, and platform.\n\n```kotlin\n@Test\nfun testArrowBufRetainBug() {\n RootAllocator().use { al -\u003e\n val buf = al.buffer(10)\n buf.close()\n\n // correctly throws\n assertThrows\u003cIllegalArgumentException\u003e { buf.referenceManager.retain() }\n\n assertEquals(0, buf.refCnt()) // nope, it's 1\n\n // doesn't throw, ref-count is 1 - so the caller assumes they've successfully taken a reference\n // but the underlying memory has already been reclaimed and re-used\n assertThrows\u003cIllegalArgumentException\u003e { buf.referenceManager.retain() }\n }\n}\n```\n\nCaused by the `getAndAdd` in `BufferLedger.retain(int)` - this is what leaves the ref-count positive, so on the next call, this doesn't fail.\n\nSome kind of compareAndSet instead, perhaps?\n\nCheers,\n\nJames","author":{"url":"https://github.com/jarohen","@type":"Person","name":"jarohen"},"datePublished":"2025-11-05T16:52:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/906/arrow-java/issues/906"}
route-pattern /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) route-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:127b65d6-54b6-d9f0-ba51-e3aecade70ad current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id 83B0:229272:1278CF8:1745790:699174CB html-safe-nonce 2ff0985a771226d94ff039813e085180b29df7113d46642286c73552646ff57b visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0IwOjIyOTI3MjoxMjc4Q0Y4OjE3NDU3OTA6Njk5MTc0Q0IiLCJ2aXNpdG9yX2lkIjoiMTg5NDQwOTkwMDIxOTUyODM5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 visitor-hmac 0b8ecfe1715bd65c9870b563f0b50f1d9c80f751b603b53221633fa39003214f hovercard-subject-tag issue:3591963910 github-keyboard-shortcuts repository,issues,copilot google-site-verification Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I octolytics-url https://collector.github.com/github/collect analytics-location / fb:app_id 1401488693436528 apple-itunes-app app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/arrow-java/906/issue_layout twitter:image https://opengraph.githubassets.com/42c64774cb58a9175d6454e9c506f8c4f27e3185655b05d58112d0dc93c58169/apache/arrow-java/issues/906 twitter:card summary_large_image og:image https://opengraph.githubassets.com/42c64774cb58a9175d6454e9c506f8c4f27e3185655b05d58112d0dc93c58169/apache/arrow-java/issues/906 og:image:alt Describe the bug, including details regarding any error messages, version, and platform. @Test fun testArrowBufRetainBug() { RootAllocator().use { al -> val buf = al.buffer(10) buf.close() // corre... og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username jarohen hostname github.com expected-hostname github.com None 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b turbo-cache-control no-preview go-import github.com/apache/arrow-java git https://github.com/apache/arrow-java.git octolytics-dimension-user_id 47359 octolytics-dimension-user_login apache octolytics-dimension-repository_id 893682219 octolytics-dimension-repository_nwo apache/arrow-java octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 893682219 octolytics-dimension-repository_network_root_nwo apache/arrow-java turbo-body-classes logged-out env-production page-responsive disable-turbo false browser-stats-url https://api.github.com/_private/browser/stats browser-errors-url https://api.github.com/_private/browser/errors release 848bc6032dcc93a9a7301dcc3f379a72ba13b96e ui-target full theme-color #1e2327 color-scheme light dark
URLs of crawlers that visited me.