Skip to content

Unit test segfaults on coroutines in GCC 15 on master & release #1486

@talisein

Description

@talisein

Git commit reference
6915904
Also: tag v10.1.3

Describe the bug
Running the unit test segfaults. The back trace from master is below. This was the first time I was going to try coroutines outside of std::generator, so I'm not sure I can help much more.

0x000000000042ec9f in std::__n4861::coroutine_handle<dpp::detail::task::promise_t<void> >::resume (this=0x1de8e50) at /usr/include/c++/15/coroutine:247
247	      void resume() const { __builtin_coro_resume(_M_fr_ptr); }
(gdb) bt full
#0  0x000000000042ec9f in std::__n4861::coroutine_handle<dpp::detail::task::promise_t<void> >::resume (this=0x1de8e50) at /usr/include/c++/15/coroutine:247
No locals.
#1  0x000000000040e7d7 in operator() (__closure=0x1de8e48) at /home/agpotter/git/DPP/src/unittest/coro.cpp:39
        test = 0x1cfe7c0 <CORO_TASK_OFFLINE>
        handle = {_M_fr_ptr = 0x405327 <(anonymous namespace)::task_offline_test()>}
        this = 0x1e43270
#2  0x000000000041866d in std::__invoke_impl<void, (anonymous namespace)::simple_awaitable::await_suspend<dpp::detail::task::promise_t<void> >(std::__n4861::coroutine_handle<dpp::detail::task::promise_t<void> >)::<lambda()> >(std::__invoke_other, struct {...} &&) (__f=...) at /usr/include/c++/15/bits/invoke.h:63
No locals.
#3  0x0000000000418396 in std::__invoke<(anonymous namespace)::simple_awaitable::await_suspend<dpp::detail::task::promise_t<void> >(std::__n4861::coroutine_handle<dpp::detail::task::promise_t<void> >)::<lambda()> >(struct {...} &&) (__fn=...) at /usr/include/c++/15/bits/invoke.h:98
No locals.
#4  0x000000000041814e in std::thread::_Invoker<std::tuple<(anonymous namespace)::simple_awaitable::await_suspend<dpp::detail::task::promise_t<void> >(std::__n4861::coroutine_handle<dpp::detail::task::promise_t<void> >)::<lambda()> > >::_M_invoke<0>(std::_Index_tuple<0>) (this=0x1de8e48) at /usr/include/c++/15/bits/std_thread.h:303
No locals.
#5  0x0000000000417fda in std::thread::_Invoker<std::tuple<(anonymous namespace)::simple_awaitable::await_suspend<dpp::detail::task::promise_t<void> >(std::__n4861::coroutine_handle<dpp::detail::task::promise_t<void> >)::<lambda()> > >::operator()(void) (this=0x1de8e48) at /usr/include/c++/15/bits/std_thread.h:310
No locals.
#6  0x0000000000417e8a in std::thread::_State_impl<std::thread::_Invoker<std::tuple<(anonymous namespace)::simple_awaitable::await_suspend<dpp::detail::task::promise_t<void> >(std::__n4861::coroutine_handle<dpp::detail::task::promise_t<void> >)::<lambda()> > > >::_M_run(void) (this=0x1de8e40) at /usr/include/c++/15/bits/std_thread.h:255
No locals.
#7  0x00007ffff4a4e3e4 in std::execute_native_thread_routine (__p=0x1de8e40) at ../../../../../libstdc++-v3/src/c++11/thread.cc:104
        __t = <optimized out>
#8  0x00007ffff487ff54 in start_thread (arg=<optimized out>) at pthread_create.c:448
        ret = <optimized out>
        pd = <optimized out>
        out = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737167476416, -2481759632511134337, 140737167476416, 140737488256288, 115, 140737488256551, -2481759632485968513, -2481707197484034689}, 
              mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#9  0x00007ffff490332c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

To Reproduce
Steps to reproduce the behavior:

  1. Build release or debug cmake build in GCC 15
  2. Run unit test
  3. (also trying to use coroutines in a real bot will segfault)

Expected behavior
Coroutines should resume without crashing.

System Details:

  • OS: Fedora 42
  • gcc version 15.2.1 20250808 (Red Hat 15.2.1-1) (GCC)

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions