rapidsai / raft

RAFT contains fundamental widely-used algorithms and primitives for machine learning and information retrieval. The algorithms are CUDA-accelerated and form building blocks for more easily writing high performance applications.
https://docs.rapids.ai/api/raft/stable/
Apache License 2.0
789 stars 195 forks source link

[BUG] buffer overflow in `raft::linalg::detail::transpose` #675

Open viclafargue opened 2 years ago

viclafargue commented 2 years ago

Describe the bug Buffer overflow in raft::linalg::detail::transpose.

========= Internal Memcheck Error: Detected racecheck error buffer overflow. Some records have been dropped.
=========     Saved host backtrace up to driver entry point at error
=========     Host Frame:/lib/x86_64-linux-gnu/libcuda.so.1 [0x20d6ea]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/python3.9/site-packages/cupy_backends/cuda/libs/../../../../../libcublas.so.11 [0xa207db]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/python3.9/site-packages/cupy_backends/cuda/libs/../../../../../libcublas.so.11 [0xa6d290]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/python3.9/site-packages/cupy_backends/cuda/libs/../../../../../libcublas.so.11 [0x77477c]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/python3.9/site-packages/cupy_backends/cuda/libs/../../../../../libcublas.so.11 [0x775004]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/python3.9/site-packages/cupy_backends/cuda/libs/../../../../../libcublas.so.11 [0x77650b]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/python3.9/site-packages/cupy_backends/cuda/libs/../../../../../libcublas.so.11 [0x7493d5]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/python3.9/site-packages/cupy_backends/cuda/libs/../../../../../libcublas.so.11 (cublasSgeam + 0x1ac) [0x73b5bc]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/libcuml++.so (_ZN4raft6linalg6detail9transposeIfEEvRKNS_8handle_tEPT_S7_iiP11CUstream_st + 0xcf) [0x35f96f]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/libcuml++.so (_ZN8UMAPAlgo9InitEmbed12SpectralInit8launcherIfEEvRKN4raft8handle_tEiiPNS3_6sparse6detail3COOIfiEEPN2ML10UMAPParamsEPT_ + 0x21e) [0xc4f52e]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/libcuml++.so (_ZN8UMAPAlgo4_fitIlfN2ML23manifold_dense_inputs_tIfEELi256EEEvRKN4raft8handle_tERKT1_PNS1_10UMAPParamsEPT0_PNS4_6sparse6detail3COOIfiEE + 0x84) [0xc6b114]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/libcuml++.so (_ZN2ML4UMAP3fitERKN4raft8handle_tEPfS5_iiPlS5_PNS_10UMAPParamsES5_PNS1_6sparse6detail3COOIfiEE + 0x5ad) [0xc2134d]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/lib/python3.9/site-packages/cuml/manifold/umap.cpython-39-x86_64-linux-gnu.so [0x3e73d]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyObject_Call + 0x138) [0x1602c8]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x2d6f) [0x1e291f]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python [0x139950]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python [0x1a0b5a]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x4c77) [0x1e4827]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python [0x139120]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyFunction_Vectorcall + 0x336) [0x1a04c6]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyObject_Call + 0xb5) [0x160245]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x2d6f) [0x1e291f]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python [0x139950]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyFunction_Vectorcall + 0x336) [0x1a04c6]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyObject_Call + 0x10b) [0x16029b]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x2d6f) [0x1e291f]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python [0x139950]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyFunction_Vectorcall + 0x336) [0x1a04c6]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x4c77) [0x1e4827]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python [0x1a0a67]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x4c77) [0x1e4827]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python [0x139120]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyFunction_Vectorcall + 0x336) [0x1a04c6]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyObject_FastCallDictTstate + 0xd8) [0x15ffe8]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyObject_Call_Prepend + 0x6a) [0x1600ca]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python [0x259bd5]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyObject_MakeTpCall + 0x316) [0x1466e6]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x5673) [0x1e5223]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyFunction_Vectorcall + 0x19a) [0x1a032a]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x60a) [0x1e01ba]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyFunction_Vectorcall + 0x19a) [0x1a032a]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyObject_Call + 0x10b) [0x16029b]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x2d6f) [0x1e291f]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python [0x139950]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyFunction_Vectorcall + 0x336) [0x1a04c6]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x4c77) [0x1e4827]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python [0x1a0a67]
=========     Host Frame:/home/vic/mambaforge/envs/cuml_dev/bin/python (_PyEval_EvalFrameDefault + 0x4c77) [0x1e4827]
=========

Steps/Code to reproduce bug Seen while running racecheck with cuda-memcheck utility on cuML's UMAP.

Environment

github-actions[bot] commented 2 years ago

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] commented 2 years ago

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.