-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Add clippy -Awarnings
to CI and fix unsound fn
#1357
Merged
workingjubilee
merged 6 commits into
pgcentralfoundation:develop
from
workingjubilee:cleanup-heaptuple-and-agg-fn
Oct 31, 2023
Merged
Add clippy -Awarnings
to CI and fix unsound fn
#1357
workingjubilee
merged 6 commits into
pgcentralfoundation:develop
from
workingjubilee:cleanup-heaptuple-and-agg-fn
Oct 31, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workingjubilee
changed the title
Mark unsound
Mark unsound htup + aggregate Oct 28, 2023
pub fn
as unsafe
pub fn
as unsafe
workingjubilee
added a commit
that referenced
this pull request
Oct 28, 2023
This does more cleanup in the vein of weakening needless bounds. - #1355 The "main point" is some no-op "make clippy happy" refactoring. This permits running `cargo clippy` without getting *errors* (it still issues literally hundreds of warnings) on most of the repository's crates. It does not solve this for `pgrx` itself, as clippy detected a more serious issue there, and that issue is instead its own PR: - #1357
workingjubilee
commented
Oct 28, 2023
Comment on lines
+302
to
+307
unsafe { | ||
<#target_path as ::pgrx::aggregate::Aggregate>::in_memory_context( | ||
fcinfo, | ||
move |_context| <#target_path as ::pgrx::aggregate::Aggregate>::state(this, (#(#arg_names),*), fcinfo) | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly am not entirely sure if this is actually correct to assert, either, but I think this fn in practice only gets called by Postgres, making this one of the many undocumented unsafe
blocks to audit later. ^^;
These fn are unsound to expose as safe functions.
These may be completely unjustified, but they probably hold.
workingjubilee
force-pushed
the
cleanup-heaptuple-and-agg-fn
branch
from
October 31, 2023 22:06
269ef93
to
1cf6fb5
Compare
workingjubilee
changed the title
Mark unsound htup + aggregate
Add Oct 31, 2023
pub fn
as unsafe
clippy -- -Awarnings
to CI and fix unsound fn
workingjubilee
changed the title
Add
Add Oct 31, 2023
clippy -- -Awarnings
to CI and fix unsound fnclippy -Awarnings
to CI and fix unsound fn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have resolved to grumble less about clippy: it detected serious soundness issues related to the implementation of
pg_aggregate
after I ran it over the repo (ignoring all the warnings, of course). These functions are publicly reachable butunsafe
to use, as they may accept and dereference e.g. null pointers.Add clippy to CI, but allow all warnings, so it only monitors correctness lints. Mark the relevant unsound
pub fn
asunsafe
, catching:aggregate::Aggregate::in_memory_context
htup::heap_tuple_get_datum