Transitioning from a `nvexec::stream_context` to another seg faults
まだ誰も着手していません。
評価
調査の方向性
提供された reproducer から始め、cuda-gdb のバックトレースで示されている nvexec::_strm::_continues_on と continuation_task_t のパスを調査してください。CUDA 12.8 で cuda-gdb を使用してテストを実行し、その後、異なる stream_context オブジェクト間の遷移が segfault なしで完了し、結果 2 が生成されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
I'm using c9d272a37754dc585cd40dbbf149e4aab4d3fe15.
I'm trying to transition from one nvexec::stream_context to another, but it seg faults.
Here is the reproducer:
TEST(try, reproducer)
{
::nvexec::stream_context stream_ctx_0{};
::nvexec::stream_context stream_ctx_1{};
auto snd = ::stdexec::schedule(stream_ctx_0.get_scheduler())
| ::stdexec::then([=] () -> int {
if (::nvexec::is_on_gpu())
return 1;
else
return 0;
})
| ::stdexec::continues_on(stream_ctx_1.get_scheduler())
| ::stdexec::then([=](const int val) -> int {
if (::nvexec::is_on_gpu() && val == 1)
return 2;
else
return 0;
});
const auto [result] = ::stdexec::sync_wait(std::move(snd)).value();
ASSERT_EQ(result, 2);
}
Note that if I change to ::stdexec::continues_on(stream_ctx_0.get_scheduler()) (i.e. transitioning from stream_ctx_0 to itself), it works fine.
Here is the backtrace I get from cuda-gdb:
[----------] 1 test from try
[ RUN ] try.reproducer
[New Thread 0x7fff995fe000 (LWP 33576)]
[New Thread 0x7fff98dfd000 (LWP 33577)]
[New Thread 0x7fff79fff000 (LWP 33578)]
[Thread 0x7fff98dfd000 (LWP 33577) exited]
Thread 21 "tests_nvexec_ad" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff995fe000 (LWP 33576)]
0x00007ffff274276b in ?? () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
(cuda-gdb) bt
#0 0x00007ffff274276b in ?? () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#1 0x00007ffff284214e in ?? () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#2 0x00007ffff27f97c9 in ?? () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#3 0x00007ffff27df6f0 in cuMemFreeAsync () from /usr/lib/x86_64-linux-gnu/libcuda.so.1
#4 0x00007ffff2016540 in ?? () from /usr/local/cuda/lib64/libcudart.so.12
#5 0x00007ffff207e05f in cudaFreeAsync () from /usr/local/cuda/lib64/libcudart.so.12
#6 0x000055555556ecb1 in nvexec::_strm::continuation_task_t<nvexec::_strm::_continues_on::operation_state_t<nvexec::_strm::then_sender_t<nvexec::_strm::stream_scheduler::sender_t, tests::nvexec::adaptors::try_reproducer_Test::TestBody()::{lambda()#1}>, nvexec::_strm::_sched_from::receiver_t<nvexec::_strm::continues_on_sender_t<nvexec::_strm::stream_scheduler, nvexec::_strm::then_sender_t<nvexec::_strm::stream_scheduler::sender_t, tests::nvexec::adaptors::try_reproducer_Test::TestBody()::{lambda()#1}> >, nvexec::_strm::_then::receiver_t<4ul, nvexec::_strm::propagate_receiver_t<nvexec::_strm::_sync_wait::receiver_t<nvexec::_strm::then_sender_t<nvexec::_strm::schedule_from_sender_t<nvexec::_strm::stream_scheduler, nvexec::_strm::continues_on_sender_t<nvexec::_strm::stream_scheduler, nvexec::_strm::then_sender_t<nvexec::_strm::stream_scheduler::sender_t, tests::nvexec::adaptors::try_reproducer_Test::TestBody()::{lambda()#1}> > >, tests::nvexec::adaptors::try_reproducer_Test::TestBody()::{lambda(int)#1}> > >, tests::nvexec::adaptors::try_reproducer_Test::TestBody()::{lambda(int)#1}> > >::__t::receiver_t, nvexec::variant_t<cuda::std::__4::tuple<nvexec::_strm::set_noop>, cuda::std::__4::tuple<stdexec::__rcvrs::set_value_t, int>, cuda::std::__4::tuple<stdexec::__rcvrs::set_error_t, cudaError>, cuda::std::__4::tuple<stdexec::__rcvrs::set_error_t, std::__exception_ptr::exception_ptr> > >::continuation_task_t(nvexec::_strm::_continues_on::operation_state_t<nvexec::_strm::then_sender_t<nvexec::_strm::stream_scheduler::sender_t, tests::nvexec::adaptors::try_reproducer_Test::TestBody()::{lambda()#1}>, nvexec::_strm::_sched_from::receiver_t<nvexec::_strm::continues_on_sender_t<nvexec::_strm::stream_scheduler, nvexec::_strm::then_sender_t<nvexec::_strm::stream_scheduler::sender_t, tests::nvexec::adaptors::try_reproducer_Test::TestBody()::{lambda()#1}> >, nvexec::_strm::_then::receiver_t<4ul, nvexec::_strm::propagate_receiver_t<nvexec::_strm::_sync_wait::receiver_t<nvexec::_strm::then_sender_t<nvexec::_strm::schedule_from_sender_t<nvexec::_strm::stream_scheduler, nvexec::_strm::continues_on_sender_t<nvexec::_strm::stream_scheduler, nvexec::_strm::then_sender_t<nvexec::_strm::stream_scheduler::sender_t, tests::nvexec::adaptors::try_reproducer_Test::TestBody()::{lambda()#1}> > >, tests::nvexec::adaptors::try_reproducer_Test::TestBody()::{lambda(int)#1}> > >, tests::nvexec::adaptors::try_reproducer_Test::TestBody()::{lambda(int)#1}> > >::__t::receiver_t, nvexec::variant_t<cuda::std::__4::tuple<nvexec::_strm::set_noop>, cuda::std::__4::tuple<stdexec::__rcvrs::set_value_t, int>, cuda::std::__4::tuple<stdexec::__rcvrs::set_error_t, cudaError>, cuda::std::__4::tuple<stdexec::__rcvrs::set_error_t, std::__exception_ptr::exception_ptr> >*, CUstream_st*, std::pmr::memory_resource*)::{lambda(nvexec::_strm::queue::task_base_t*)#2}::__invoke(nvexec::_strm::queue::task_base_t*) ()
I am on a AMPERE86 GPU with Cuda 12.8, compiling with:
Ubuntu clang version 20.1.2 (++20250331083337+bc65196c0919-1
exp120250331203353.96)
Any idea ? I am assuming that my code is legit, but I might be wrong as well. Thanks!
- 主要言語
- C++
- スター
- 2.4k
- フォーク
- 270
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 43
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/stdexec のほかの issue
-
inline_scheduler's namespace-scope static_assert fails under nvcc (private nested __sender access) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
google/libultrahdr#485 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
godotengine/godot#123776 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 60/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ros2/common_interfaces#344 ·