Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leaks in custom executor #256

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Fix memory leaks in custom executor #256

merged 1 commit into from
Oct 10, 2024

Conversation

Y--
Copy link
Collaborator

@Y-- Y-- commented Oct 7, 2024

When one calls elog(ERROR,... it longjmp out of the current stack leaving no chance for the C++ to be executed.

This PR is a first iteration toward what we want to rationalize (cf. #93 ):

  • keep a function with a pure C++ "flavor" (object creation, exceptions, etc.)
  • call it in a new wrapper that copies out the error message and uses PG mechanism to throw the error

This fixes #120, even though there still seem to be a small leak with DuckDB's PrepareQuery leftover (to be followed-up separately)

@Y-- Y-- force-pushed the yl/fix-memory-leak2 branch from 8bec5d4 to 23cf94f Compare October 7, 2024 14:16
@JelteF JelteF added the bug Something isn't working label Oct 9, 2024
Copy link
Collaborator

@JelteF JelteF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are still failing it seems after merging with main.

@Y--
Copy link
Collaborator Author

Y-- commented Oct 9, 2024

Tests are still failing it seems after merging with main.

Yeah sorry should have kept this in draft - I'm still working on it; this is a simple revert

@Y-- Y-- marked this pull request as draft October 9, 2024 10:11
@Y-- Y-- force-pushed the yl/fix-memory-leak2 branch 2 times, most recently from 5dd26f3 to cf84342 Compare October 10, 2024 09:13
@Y-- Y-- mentioned this pull request Oct 10, 2024
@Y-- Y-- force-pushed the yl/fix-memory-leak2 branch from cf84342 to 10b7f37 Compare October 10, 2024 09:19
@Y-- Y-- force-pushed the yl/fix-memory-leak2 branch from 10b7f37 to 303954a Compare October 10, 2024 09:56
@Y-- Y-- requested a review from JelteF October 10, 2024 09:57
@Y-- Y-- marked this pull request as ready for review October 10, 2024 09:59
@Y-- Y-- merged commit 1adc730 into main Oct 10, 2024
4 checks passed
@Y-- Y-- deleted the yl/fix-memory-leak2 branch October 10, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource leak on error, eventual crash on out of memory
2 participants