Skip to content

[BUG] mutable_column_device_view fails silently for columns with children #4491

@trevorsm7

Description

@trevorsm7

Describe the bug
Note that mutable_column_device_view does in fact have a method for accessing child columns:

/**---------------------------------------------------------------------------*
* @brief Returns the specified child
*
* @param child_index The index of the desired child
* @return column_view The requested child `column_view`
*---------------------------------------------------------------------------**/
__device__ mutable_column_device_view& child(size_type child_index) const
noexcept {
return mutable_children[child_index];
}

However, the constructors and create method for mutable_column_device_view have TODO comments about child columns not being supported, but there isn't actually any error checking to handle this case. So, if you attempt to access the children using the above method, it results in a cudaIllegalMemoryAccess with no indication why or where it is failing.

// Construct a unique_ptr that invokes `destroy()` as it's deleter
std::unique_ptr<mutable_column_device_view, std::function<void(mutable_column_device_view*)>>
mutable_column_device_view::create(mutable_column_view source, cudaStream_t stream) {
// TODO children may not be actually possible for mutable columns
auto deleter = [](mutable_column_device_view* v) { v->destroy(); };
std::unique_ptr<mutable_column_device_view, decltype(deleter)> p{
new mutable_column_device_view(source), deleter};
return p;
}

// For use with inplace-new to pre-fill memory to be copied to device
mutable_column_device_view::mutable_column_device_view( mutable_column_view source )
: detail::column_device_view_base{source.type(), source.size(),
source.head(), source.null_mask(),
source.null_count(), source.offset()}
{
// TODO children may not be actually possible for mutable columns
}
mutable_column_device_view::mutable_column_device_view( mutable_column_view source, ptrdiff_t h_ptr, ptrdiff_t d_ptr )
: detail::column_device_view_base{source.type(), source.size(),
source.head(), source.null_mask(),
source.null_count(), source.offset()}
{
// TODO children may not be actually possible for mutable columns
}

Expected behavior
If child columns cannot be supported, the child method should be removed and the create and constructor methods should throw an exception when encountering child columns.

Metadata

Metadata

Labels

bugSomething isn't workinglibcudfAffects libcudf (C++/CUDA) code.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions