public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/113460] New: Segfault in __builtin_coro_destroy when using std::generator to concate ranges
@ 2024-01-17 20:57 dboles.src at gmail dot com
2024-01-18 16:52 ` [Bug libstdc++/113460] " redi at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: dboles.src at gmail dot com @ 2024-01-17 20:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113460
Bug ID: 113460
Summary: Segfault in __builtin_coro_destroy when using
std::generator to concate ranges
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: dboles.src at gmail dot com
Target Milestone: ---
Created attachment 57120
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57120&action=edit
.ii, .o, .s files
Using
g++ (Debian 20240101-1) 14.0.0 20240101 (experimental) [master
r14-6875-g3a7dd24eade]
Running this:
```cpp
#include <array>
#include <generator>
#include <ranges>
#include <vector>
using namespace std;
template <ranges::input_range... Ranges>
[[nodiscard]] auto
concat(Ranges&&... ranges) -> generator<int, int>
{
(co_yield ranges::elements_of(ranges), ...);
}
auto
main() -> int
{
auto const numbers1 = array{0};
auto const numbers2 = vector{0};
for (auto const _: concat(numbers1, numbers2) ) {}
}
```
gives this:
```none
Program received signal SIGSEGV, Segmentation fault.
0x0000000000403e8e in std::__n4861::coroutine_handle<std::generator<int const&,
int, std::allocator<std::byte> >::promise_type>::destroy (this=0x41c320) at
/usr/lib/gcc-snapshot/include/c++/14/coroutine:244
244 void destroy() const { __builtin_coro_destroy(_M_fr_ptr); }
(ins)(gdb) bt
#0 0x0000000000403e8e in std::__n4861::coroutine_handle<std::generator<int
const&, int, std::allocator<std::byte> >::promise_type>::destroy
(this=0x41c320) at /usr/lib/gcc-snapshot/include/c++/14/coroutine:244
#1 0x000000000040367c in std::generator<int const&, int,
std::allocator<std::byte> >::~generator (this=0x41c320,
__in_chrg=<optimized out>) at
/usr/lib/gcc-snapshot/include/c++/14/generator:700
#2 0x0000000000402cd0 in std::__gen::_Promise_erased<int
const&>::_Recursive_awaiter<std::generator<int const&, int,
std::allocator<std::byte> > >::~_Recursive_awaiter (this=0x41c320,
__in_chrg=<optimized out>) at
/usr/lib/gcc-snapshot/include/c++/14/generator:360
#3 0x0000000000401b8a in
concat(_Z6concatITpTkNSt6ranges11input_rangeEJRKSt5arrayIiLm1EERKSt6vectorIiSaIiEEEESt9generatorIiivEDpOT_.Frame
*) (frame_ptr=0x41c2d0) at concatWC.cpp:13
#4 0x000000000040186f in
operator()(_ZZNSt5__gen15_Promise_erasedIRKiE11yield_valueIRKSt6vectorIiSaIiEESaISt4byteEEEDaNSt6ranges11elements_ofIT_T0_EEENKUlSt15allocator_arg_tSB_N9__gnu_cxx17__normal_iteratorIPS1_S7_EESL_E_clESH_SB_SL_SL_.Frame
*) (frame_ptr=0x41c3e0)
at /usr/lib/gcc-snapshot/include/c++/14/generator:160
#5 0x000000000040409b in
std::__n4861::coroutine_handle<std::__gen::_Promise_erased<int const&>
>::resume (this=0x41c2e0)
at /usr/lib/gcc-snapshot/include/c++/14/coroutine:242
#6 0x0000000000403b62 in std::generator<int, int, void>::_Iterator::_M_next
(this=0x7fffffffdd58)
at /usr/lib/gcc-snapshot/include/c++/14/generator:793
#7 0x00000000004032e6 in std::generator<int, int, void>::_Iterator::operator++
(this=0x7fffffffdd58)
at /usr/lib/gcc-snapshot/include/c++/14/generator:767
#8 0x00000000004012e4 in main () at concatWC.cpp:20
(ins)(gdb)
```
Outputs of -freport-bug -save-temps are attached. Let me know if I can help
with any more info.
Thanks for implementing std::generator and all the other work on GCC and C++!
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug libstdc++/113460] Segfault in __builtin_coro_destroy when using std::generator to concate ranges
2024-01-17 20:57 [Bug libstdc++/113460] New: Segfault in __builtin_coro_destroy when using std::generator to concate ranges dboles.src at gmail dot com
@ 2024-01-18 16:52 ` redi at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2024-01-18 16:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113460
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2024-01-18
Keywords| |wrong-code
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Confirmed
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-18 16:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-17 20:57 [Bug libstdc++/113460] New: Segfault in __builtin_coro_destroy when using std::generator to concate ranges dboles.src at gmail dot com
2024-01-18 16:52 ` [Bug libstdc++/113460] " redi at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).