Delete default constructor and move assignment on hash tables - #835
Conversation
Owning map/set types were accidentally move-constructible and move-assignable, which can silently transfer GPU storage. Match the copy members and disable default construction too. Fixes NVIDIA#612 Signed-off-by: Aaron <amark@g.jct.ac.il>
|
/ok to test 043b2a0 |
There was a problem hiding this comment.
@amarkdotdev Thanks for the contribution
Approving. Checked cudf: every cuco table is held behind a pimpl unique_ptr or as a local passed by reference, so nothing downstream breaks.
Pushed dynamic_map to your branch, which the description mentions but the diff missed.
Note bloom_filter and hyperloglog still default their move ops. Same argument applies, worth a follow-up.
|
/ok to test 69b7cea |
|
Was #807 considered here? It fixed the dangling allocator references specifically so that core containers are safely movable. Given that the current containers transfer pointer-owned storage without relocating it, what remaining invariant requires deleting their move operations? |
|
Pushed a change restoring the move constructor, keeping the deleted default ctor and deleted move assignment. To answer the question directly: for move construction there is no remaining invariant. All five containers hold Move assignment is the exception. Deleting the move constructor also broke cudf at Two description fixes for a follow up: |
|
/ok to test a58244e |
The owning hash tables (
static_map,static_set,static_multimap,static_multiset,dynamic_map) defaulted both move operations. This deletes the default constructor and move assignment, and keeps move construction.Move assignment is the hazard:
impl_ = std::move(rhs.impl_)frees the still-named destination's storage on its construction stream, so refs handed out from it silently dangle with no host side signal. Move construction just transfers aunique_ptr, so refs stay valid and downstream code (e.g. cudfjson_tree.cu) relies on it.Fixes #612