Skip to content

[BUG]: test_can_cancel_coroutine_from_python passes but segfaults on test cleanup #557

@dagardner-nv

Description

@dagardner-nv

Version

25.10

Which installation method(s) does this occur on?

Source

Describe the bug.

Test passes but segfaults soon after:

#0  x86_64_fallback_frame_state (context=0x7ffcc1350520, fs=0x7ffcc1350610) at ./md-unwind-support.h:57
#1  uw_frame_state_for (context=context@entry=0x7ffcc1350520, fs=fs@entry=0x7ffcc1350610) at ../../../libgcc/unwind-dw2.c:1016
#2  0x00007ff5f8bfdc12 in _Unwind_Backtrace (trace=0x7ff5faa5c920 <backtrace_helper>, trace_argument=0x7ffcc1350750) at ../../../libgcc/unwind.inc:303
#3  0x00007ff5faa5ca0f in __GI___backtrace (array=<optimized out>, size=64) at ./debug/backtrace.c:78
#4  0x00007ff5f8a8f929 in google::glog_internal_namespace_::GetStackTrace(void**, int, int) () from conda/envs/mrc/lib/libglog.so.2
#5  0x00007ff5f8a8f00a in google::(anonymous namespace)::HandleSignal(int, siginfo*, void*) () from conda/envs/mrc/lib/libglog.so.2
#6  0x00007ff5fa9d5057 in __pthread_once_slow (once_control=0x7ff5f8aaf7c4 <google::(anonymous namespace)::signaled>, 
    init_routine=0x7ff5f70edf30 <std::__once_proxy()>) at ./nptl/pthread_once.c:116
#7  0x00007ff5f8a8e917 in google::(anonymous namespace)::FailureSignalHandler(int, siginfo*, void*) () from conda/envs/mrc/lib/libglog.so.2
#8  <signal handler called>
#9  0x00005634d322c434 in ?? ()
#10 0x00007ff5f2f3b173 in std::__n4861::coroutine_handle<void>::resume (this=0x5631b03a4fe0)
    at conda/envs/mrc/x86_64-conda-linux-gnu/include/c++/12.1.0/coroutine:135
#11 0x00007ff5f2f4d435 in mrc::pymrc::coro::PyTaskToCppAwaitable::await_suspend(std::__n4861::coroutine_handle<void>)::{lambda(pybind11::object)#1}::operator()(pybind11::object) const (__closure=0x5631b03a4fd8, future=...) at mrc/python/mrc/_pymrc/include/pymrc/coro.hpp:216
#12 0x00007ff5f2f66b28 in pybind11::detail::argument_loader<pybind11::object>::call_impl<void, mrc::pymrc::coro::PyTaskToCppAwaitable::await_suspend(std::__n4861::coroutine_handle<void>)::{lambda(pybind11::object)#1}&, 0ul, pybind11::detail::void_type>(mrc::pymrc::coro::PyTaskToCppAwaitable::await_suspend(std::__n4861::coroutine_handle<void>)::{lambda(pybind11::object)#1}&, std::integer_sequence<unsigned long, 0ul>, pybind11::detail::void_type&&) && (this=0x7ffcc13515e0, f=...)
    at mrc/.cache/cpm/pybind11/168c534677bf3cfcf18f57381c9b8c9dece5e940/include/pybind11/cast.h:1613
#13 0x00007ff5f2f6119e in pybind11::detail::argument_loader<pybind11::object>::call<void, pybind11::detail::void_type, mrc::pymrc::coro::PyTaskToCppAwaitable::await_suspend(std::__n4861::coroutine_handle<void>)::{lambda(pybind11::object)#1}&>(mrc::pymrc::coro::PyTaskToCppAwaitable::await_suspend(std::__n4861::coroutine_handle<void>)::{lambda(pybind11::object)#1}&) && (this=0x7ffcc13515e0, f=...)
    at mrc/.cache/cpm/pybind11/168c534677bf3cfcf18f57381c9b8c9dece5e940/include/pybind11/cast.h:1587
#14 0x00007ff5f2f5b7f9 in pybind11::cpp_function::initialize<mrc::pymrc::coro::PyTaskToCppAwaitable::await_suspend(std::__n4861::coroutine_handle<void>)::{lambda(pybind11::object)#1}, void, pybind11::object>(mrc::pymrc::coro::PyTaskToCppAwaitable::await_suspend(std::__n4861::coroutine_handle<void>)::{lambda(pybind11::object)#1}&&, void (*)(pybind11::object))::{lambda(pybind11::detail::function_call&)#3}::operator()(pybind11::detail::function_call&) const (__closure=0x0, call=...)
    at mrc/.cache/cpm/pybind11/168c534677bf3cfcf18f57381c9b8c9dece5e940/include/pybind11/pybind11.h:297
#15 0x00007ff5f2f5b8c6 in pybind11::cpp_function::initialize<mrc::pymrc::coro::PyTaskToCppAwaitable::await_suspend(std::__n4861::coroutine_handle<void>)::{lambda(pybind11::object)#1}, void, pybind11::object>(mrc::pymrc::coro::PyTaskToCppAwaitable::await_suspend(std::__n4861::coroutine_handle<void>)::{lambda(pybind11::object)#1}&&, void (*)(pybind11::object))::{lambda(pybind11::detail::function_call&)#3}::_FUN(pybind11::detail::function_call&) ()
    at mrc/.cache/cpm/pybind11/168c534677bf3cfcf18f57381c9b8c9dece5e940/include/pybind11/pybind11.h:267
#16 0x00007ff5f2f4aecb in pybind11::cpp_function::dispatcher (self=<PyCapsule at remote 0x7ff5f3274780>, args_in=(<_asyncio.Task at remote 0x7ff5f8b3bdc0>,), 

Minimum reproducible example

pytest  -v python/tests/test_coro.py::test_can_cancel_coroutine_from_python


python/tests/test_coro.py::test_can_cancel_coroutine_from_python PASSED                                                                                     [100%]Segmentation fault (core dumped)

Relevant log output

Full env printout

Other/Misc.

No response

Code of Conduct

  • I agree to follow MRC's Code of Conduct
  • I have searched the open bugs and have found no duplicates for this bug report

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions