Core dumps, when running NeighborSampler

terminate called after throwing an instance of ‘dmlc::Error’
what(): [02:04:46] /opt/dgl/include/dgl/random.h:78: Check failed: lower < upper (0 vs. 0) :
Stack trace:
[bt] (0) /opt/conda/envs/pytorch-ci/lib/python3.6/site-packages/dgl/libdgl.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x22) [0x7faae82255a2]
[bt] (1) /opt/conda/envs/pytorch-ci/lib/python3.6/site-packages/dgl/libdgl.so(void dgl::RandomEngine::UniformChoice(long, long, long*, bool)+0x67c) [0x7faae881e64c]
[bt] (2) /opt/conda/envs/pytorch-ci/lib/python3.6/site-packages/dgl/libdgl.so(+0x6d3ade) [0x7faae8247ade]
[bt] (3) /opt/conda/envs/pytorch-ci/lib/python3.6/site-packages/dgl/libdgl.so(+0x6d5870) [0x7faae8249870]
[bt] (4) /opt/conda/envs/pytorch-ci/lib/python3.6/site-packages/dgl/libdgl.so(dgl::aten::COOMatrix dgl::aten::impl::CSRRowWisePick(dgl::aten::CSRMatrix, dgl::runtime::NDArray, long, bool, std::function<void (long, long, long, long const*, long const*, long*)>)+0x23d) [0x7faae824e3fd]
[bt] (5) /opt/conda/envs/pytorch-ci/lib/python3.6/site-packages/dgl/libdgl.so(dgl::aten::COOMatrix dgl::aten::impl::CSRRowWiseSamplingUniform<(DLDeviceType)1, long>(dgl::aten::CSRMatrix, dgl::runtime::NDArray, long, bool)+0xe1) [0x7faae8250ae1]
[bt] (6) /opt/conda/envs/pytorch-ci/lib/python3.6/site-packages/dgl/libdgl.so(dgl::aten::CSRRowWiseSampling(dgl::aten::CSRMatrix, dgl::runtime::NDArray, long, dgl::runtime::NDArray, bool)+0x262) [0x7faae821eaa2]
[bt] (7) /opt/conda/envs/pytorch-ci/lib/python3.6/site-packages/dgl/libdgl.so(dgl::sampling::SampleNeighbors(std::shared_ptrdgl::BaseHeteroGraph, std::vector<dgl::runtime::NDArray, std::allocatordgl::runtime::NDArray > const&, std::vector<long, std::allocator > const&, dgl::EdgeDir, std::vector<dgl::runtime::NDArray, std::allocatordgl::runtime::NDArray > const&, bool)+0xa19) [0x7faae89098d9]
[bt] (8) /opt/conda/envs/pytorch-ci/lib/python3.6/site-packages/dgl/libdgl.so(+0xd97c47) [0x7faae890bc47]

Aborted (core dumped)

BTW, the graph in on cpu

only some node could couse the problem, NOT all

@shyustc Hi, can you give us a minimal code that can reproduce this problem? We can help you check it.