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

Allocating zero size View #216

Closed
hcedwar opened this issue Mar 16, 2016 · 2 comments
Closed

Allocating zero size View #216

hcedwar opened this issue Mar 16, 2016 · 2 comments
Assignees
Labels
Enhancement Improve existing capability; will potentially require voting
Milestone

Comments

@hcedwar
Copy link
Contributor

hcedwar commented Mar 16, 2016

Potential bug with allocating zero size View. Debug output shared by a user.

Program received signal SIGSEGV, Segmentation fault.
0x0000000008bc8f37 in
Kokkos::Experimental::Impl::SharedAllocationRecord<Kokkos::CudaUVMSpace,
void>::SharedAllocationRecord (this=0x26210120, arg_space=...,
arg_label=..., arg_alloc_size=0,
arg_dealloc=0x7bb565a <Kokkos::Experimental::Impl::(anonymous
namespace)::deallocate<Kokkos::CudaUVMSpace,
Kokkos::Experimental::Impl::ViewValueFunctor<Kokkos::Cuda,
Kokkos::pair<int, int>, false>

(Kokkos::Experimental::Impl::SharedAllocationRecord<void, void>*)>) at
/home/mbetten/Trilinos/Trilinos/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp:497
497 RecordBase::m_alloc_ptr->m_record = this ;
(cuda-gdb) where

0 0x0000000008bc8f37 in

Kokkos::Experimental::Impl::SharedAllocationRecord<Kokkos::CudaUVMSpace,
void>::SharedAllocationRecord (this=0x26210120, arg_space=...,
arg_label=..., arg_alloc_size=0,
arg_dealloc=0x7bb565a <Kokkos::Experimental::Impl::(anonymous
namespace)::deallocate<Kokkos::CudaUVMSpace,
Kokkos::Experimental::Impl::ViewValueFunctor<Kokkos::Cuda,
Kokkos::pair<int, int>, false>
(Kokkos::Experimental::Impl::SharedAllocationRecord<void, void>*)>) at
/home/mbetten/Trilinos/Trilinos/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp:497

1 0x0000000007bb4ff9 in

Kokkos::Experimental::Impl::SharedAllocationRecord<Kokkos::CudaUVMSpace,
Kokkos::Experimental::Impl::ViewValueFunctor<Kokkos::Cuda,
Kokkos::pair<int, int>, false> >::SharedAllocationRecord (this=0x26210120,
arg_space=..., arg_label=..., arg_alloc=0) at
/home/mbetten/Trilinos/Trilinos/packages/kokkos/core/src/impl/KokkosExp_SharedAlloc.hpp:209

2 0x0000000007bb49b6 in

Kokkos::Experimental::Impl::SharedAllocationRecord<Kokkos::CudaUVMSpace,
Kokkos::Experimental::Impl::ViewValueFunctor<Kokkos::Cuda,
Kokkos::pair<int, int>, false> >::allocate (arg_space=..., arg_label=...,
arg_alloc=0) at
/home/mbetten/Trilinos/Trilinos/packages/kokkos/core/src/impl/KokkosExp_SharedAlloc.hpp:234

3 0x0000000007bb32f0 in

Kokkos::Experimental::Impl::ViewMapping<Kokkos::Experimental::ViewTraits<Kokkos::pair<int,
int>*, Kokkos::LayoutLeft, Kokkos::Device<Kokkos::Cuda,
Kokkos::CudaUVMSpace>, Kokkos::MemoryTraits<0u> >,
void>::allocate_shared<std::string,
Kokkos::Experimental::Impl::WithoutInitializing_t,
std::integral_constant<unsigned int, 0u>, Kokkos::CudaUVMSpace,
Kokkos::Cuda> (this=0x7fffffff4fa8, arg_prop=..., arg_layout=...)
at
/home/mbetten/Trilinos/Trilinos/packages/kokkos/core/src/impl/KokkosExp_ViewMapping.hpp:2552

4 0x0000000007bae864 in Kokkos::Experimental::View<Kokkos::pair<int,

int>*, Kokkos::LayoutLeft, Kokkos::Device<Kokkos::Cuda,
Kokkos::CudaUVMSpace>, Kokkos::MemoryTraits<0u> >::View<std::string,
Kokkos::Experimental::Impl::WithoutInitializing_t>(Kokkos::Experimental::Impl::ViewCtorProp<std::string,
Kokkos::Experimental::Impl::WithoutInitializing_t> const&,
std::enable_if<!Kokkos::Experimental::Impl::ViewCtorProp<std::string,
Kokkos::Experimental::Impl::WithoutInitializing_t>::has_pointer,
Kokkos::LayoutLeft>::type const&) (this=0x7fffffff4fa0, arg_prop=...,
arg_layout=...) at
/home/mbetten/Trilinos/Trilinos/packages/kokkos/core/src/KokkosExp_View.hpp:1225

5 0x0000000007ba9359 in Kokkos::Experimental::View<Kokkos::pair<int,

int>*, Kokkos::LayoutLeft, Kokkos::Device<Kokkos::Cuda,
Kokkos::CudaUVMSpace>, Kokkos::MemoryTraits<0u> >::View
(this=0x7fffffff4fa0, arg_prop=..., arg_N0=0,
arg_N1=0, arg_N2=0, arg_N3=0, arg_N4=0, arg_N5=0, arg_N6=0,
arg_N7=0) at
/home/mbetten/Trilinos/Trilinos/packages/kokkos/core/src/KokkosExp_View.hpp:1344

@hcedwar
Copy link
Contributor Author

hcedwar commented Mar 17, 2016

Added unit test for zero length allocation and CUDA-UVM, test passes.
Will add precondition-checks at potential failure points in this stack to attempt to catch this kind of error before a segfault.

@hcedwar hcedwar self-assigned this Mar 17, 2016
@hcedwar hcedwar added the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label Mar 17, 2016
@hcedwar hcedwar added this to the GTC 2016 milestone Mar 17, 2016
@hcedwar hcedwar added Enhancement Improve existing capability; will potentially require voting and removed Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) labels Mar 18, 2016
@hcedwar
Copy link
Contributor Author

hcedwar commented Mar 18, 2016

Issue was downstream bug in Tpetra.
trilinos/Trilinos#227
Adding a few precondition checks to shared allocation tracker that were motivated by this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improve existing capability; will potentially require voting
Projects
None yet
Development

No branches or pull requests

1 participant