Skip to content

[query] Fix bad memory leak triggered by set contains IR function#10451

Merged
danking merged 1 commit into
hail-is:mainfrom
tpoterba:fix-set-contains-leak
May 6, 2021
Merged

[query] Fix bad memory leak triggered by set contains IR function#10451
danking merged 1 commit into
hail-is:mainfrom
tpoterba:fix-set-contains-leak

Conversation

@tpoterba

@tpoterba tpoterba commented May 5, 2021

Copy link
Copy Markdown
Contributor

CHANGELOG: Fixed a memory leak triggered by `hl.literal(...).contains(...)

This bug is present elsewhere in the code generator, but the set
contains function is probably the worst place for it to happen.
This leads to a full copy of the set where the binary search
is executed.

The core problem was a bug in PArrayBackedContainer not casting
its codes properly, leading to the no-op coerce logic in PCanonicalArray
being bypassed in favor of the generic copy-the-world implementation of
store. The test I have added catches the memory leak, but now fails at
compile time at the assertion to PCanonicalArray.store instead.

CHANGELOG: Fixed a memory leak triggered by `hl.literal(...).contains(...)

This bug is present elsewhere in the code generator, but the set
contains function is probably the worst place for it to happen.
This leads to a full copy of the set where the binary search
is executed.

The core problem was a bug in PArrayBackedContainer not casting
its codes properly, leading to the no-op coerce logic in PCanonicalArray
being bypassed in favor of the generic copy-the-world implementation of
`store`. The test I have added catches the memory leak, but now fails at
compile time at the assertion to `PCanonicalArray.store` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants