Skip to content

[C++] [Acero] Use-after-free of a MemoryPool that was destroyed at program's exit #35959

Closed as not planned

Description

@mpimenov

I don't have a small reproducer but looking at the stack traces and the code I
have I'm pretty sure that I observe a bug despite using the API correctly.

I set up an ExecPlan and dispose of it, via StopProducing()+finished.Wait() calls.
Only default context (memory pool, executors, etc.) is ever used.
Shortly after, the program finishes, and the destructor of the default memory pool is called.
However, in another thread the wheels are still spinning somewhere in the executor code.
To be a bit more precise, a Future is being executed that I did not submit and that I believe
is an internal implementation detal. The execution of this Future asks for some memory
but the pool has been destroyed by then.

I'd like to know whether what I've described is a known issue and what the suggested
(client-side) fix is.

These previous issues seem relevant:
https://issues.apache.org/jira/browse/ARROW-16072
https://issues.apache.org/jira/browse/ARROW-17198

The mitigation in #13691 is good enough for tests but not for production
use (consider the case of more than one instance of Scanner).

Component(s)

C++

Activity

  1. changed the title [-][Acero] Use-after-free of a MemoryPool that was destroyed at program's exit[/-] [+][C++] [Acero] Use-after-free of a MemoryPool that was destroyed at program's exit[/+] on Jun 7, 2023
  2. westonpace commented on Jun 13, 2023

    @westonpace
    Member

    It does sound similar to #31486 (ARROW-16072).

  3. mpimenov commented on Jun 14, 2023

    @mpimenov
    Author

    Is there a recommended workaround? Or an estimation on when this is going to be fixed?

  4. pinned this issue on Nov 13, 2026
  5. thisisnic commented on Nov 13, 2026

    @thisisnic
    Member

    Thanks for reporting this! I'm just going through older bug issues to see if we can close them out or we need further action. Closing as there's no reproducer to test against a current release; please open a new issue with one if you still see this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions