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: crash from drop impls that panic via leak_and_drop_on_delete() #1929

Merged

Conversation

eeeebbbbrrrr
Copy link
Contributor

If PgMemoryContexts::leak_and_drop_on_delete() leaks a type that is impl Drop, and that implementation happens to panic, then Postgres will segfault because the callback function was not properly guarded.

As a drive-by, slightly cleanup error reporting in the test framework.

If `PgMemoryContexts::leak_and_drop_on_delete()` leaks a type that `impl
Drop`, and that implementation happens to panic, then Postgres will
segfault because the callback function was not properly guarded.

As a drive-by, slightly cleanup error reporting in the test framework.
Comment on lines +558 to +559
use crate as pgrx;
#[pgrx::pg_guard]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the actual fix!

@eeeebbbbrrrr eeeebbbbrrrr merged commit e82264c into pgcentralfoundation:develop Oct 27, 2024
14 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.

1 participant