public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine
@ 2021-12-21 14:14 jack.cui2 at foxmail dot com
  2021-12-21 14:39 ` [Bug c++/103790] " marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jack.cui2 at foxmail dot com @ 2021-12-21 14:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103790

            Bug ID: 103790
           Summary: internal compiler error: Segmentation fault when
                    playing with coroutine
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jack.cui2 at foxmail dot com
  Target Milestone: ---

Created attachment 52038
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52038&action=edit
preprocessed file that trigger the issue

Using built-in specs.
COLLECT_GCC=g++-11
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
11.1.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-11
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new
--enable-gnu-unique-object --disable-vtable-verify --enable-plugin
--enable-default-pie --with-system-zlib --enable-libphobos-checking=release
--with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch
--disable-werror --disable-cet --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-11-YRKbe7/gcc-11-11.1.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-YRKbe7/gcc-11-11.1.0/debian/tmp-gcn/usr
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.1.0 (Ubuntu 11.1.0-1ubuntu1~18.04.1)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++20' '-fcoroutines' '-c'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/11/cc1plus -E -quiet -v -imultiarch
x86_64-linux-gnu -D_GNU_SOURCE test_co_await.cpp -mtune=generic -march=x86-64
-std=c++20 -fcoroutines -fpch-preprocess -fasynchronous-unwind-tables
-fstack-protector-strong -Wformat -Wformat-security -o test_co_await.ii
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/11"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/11/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/11
 /usr/include/x86_64-linux-gnu/c++/11
 /usr/include/c++/11/backward
 /usr/lib/gcc/x86_64-linux-gnu/11/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++20' '-fcoroutines' '-c'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/11/cc1plus -fpreprocessed test_co_await.ii
-quiet -dumpbase test_co_await.cpp -dumpbase-ext .cpp -mtune=generic
-march=x86-64 -std=c++20 -version -fcoroutines -fasynchronous-unwind-tables
-fstack-protector-strong -Wformat -Wformat-security -o test_co_await.s
GNU C++20 (Ubuntu 11.1.0-1ubuntu1~18.04.1) version 11.1.0 (x86_64-linux-gnu)
        compiled by GNU C version 11.1.0, GMP version 6.1.2, MPFR version
4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++20 (Ubuntu 11.1.0-1ubuntu1~18.04.1) version 11.1.0 (x86_64-linux-gnu)
        compiled by GNU C version 11.1.0, GMP version 6.1.2, MPFR version
4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: fa8709337e38341bd283d8a4fb935104
test_co_await.cpp: In function ‘task foo()’:
test_co_await.cpp:48:18: internal compiler error: Segmentation fault
   48 |     co_await bar{};
      |                  ^
0x1702697 internal_error(char const*, ...)
        ???:0
0x68de56 finish_co_await_expr(unsigned int, tree_node*)
        ???:0
0x7888ee c_parse_file()
        ???:0
0x85988d c_common_parse_file()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/103790] internal compiler error: Segmentation fault when playing with coroutine
  2021-12-21 14:14 [Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine jack.cui2 at foxmail dot com
@ 2021-12-21 14:39 ` marxin at gcc dot gnu.org
  2021-12-21 14:47 ` iains at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-21 14:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103790

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2021-12-21
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Apparently, master reject the code now since r12-4101-g8009c79b64b532d8:

test_co_await.cpp: In function ‘task foo()’:
test_co_await.cpp:48:5: error: ‘await_suspend’ must return ‘void’, ‘bool’ or a
coroutine handle

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/103790] internal compiler error: Segmentation fault when playing with coroutine
  2021-12-21 14:14 [Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine jack.cui2 at foxmail dot com
  2021-12-21 14:39 ` [Bug c++/103790] " marxin at gcc dot gnu.org
@ 2021-12-21 14:47 ` iains at gcc dot gnu.org
  2021-12-21 14:52 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2021-12-21 14:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103790

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #1)
> Apparently, master reject the code now since r12-4101-g8009c79b64b532d8:
> 
> test_co_await.cpp: In function ‘task foo()’:
> test_co_await.cpp:48:5: error: ‘await_suspend’ must return ‘void’, ‘bool’ or
> a coroutine handle

the error is correct suspend_always{} is not a valid return for await_suspend()
- but we should not ICE, of course.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/103790] internal compiler error: Segmentation fault when playing with coroutine
  2021-12-21 14:14 [Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine jack.cui2 at foxmail dot com
  2021-12-21 14:39 ` [Bug c++/103790] " marxin at gcc dot gnu.org
  2021-12-21 14:47 ` iains at gcc dot gnu.org
@ 2021-12-21 14:52 ` marxin at gcc dot gnu.org
  2021-12-21 14:54 ` iains at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-21 14:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103790

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
> the error is correct suspend_always{} is not a valid return for
> await_suspend() - but we should not ICE, of course.

Note, we don't ICE on master since the revision.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/103790] internal compiler error: Segmentation fault when playing with coroutine
  2021-12-21 14:14 [Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine jack.cui2 at foxmail dot com
                   ` (2 preceding siblings ...)
  2021-12-21 14:52 ` marxin at gcc dot gnu.org
@ 2021-12-21 14:54 ` iains at gcc dot gnu.org
  2021-12-21 19:38 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2021-12-21 14:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103790

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #3)
> > the error is correct suspend_always{} is not a valid return for
> > await_suspend() - but we should not ICE, of course.
> 
> Note, we don't ICE on master since the revision.

Ah OK - I have quite a backlog of pending backports for 11.x and 10.x so I
expect that will be fixed for the next release.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/103790] internal compiler error: Segmentation fault when playing with coroutine
  2021-12-21 14:14 [Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine jack.cui2 at foxmail dot com
                   ` (3 preceding siblings ...)
  2021-12-21 14:54 ` iains at gcc dot gnu.org
@ 2021-12-21 19:38 ` pinskia at gcc dot gnu.org
  2022-01-28  9:05 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-21 19:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103790

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 100673 then.

*** This bug has been marked as a duplicate of bug 100673 ***

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/103790] internal compiler error: Segmentation fault when playing with coroutine
  2021-12-21 14:14 [Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine jack.cui2 at foxmail dot com
                   ` (4 preceding siblings ...)
  2021-12-21 19:38 ` pinskia at gcc dot gnu.org
@ 2022-01-28  9:05 ` cvs-commit at gcc dot gnu.org
  2022-01-28 11:36 ` cvs-commit at gcc dot gnu.org
  2022-02-14 15:18 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-28  9:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103790

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andre Vehreschild <vehre@gcc.gnu.org>:

https://gcc.gnu.org/g:c9c48ab7bad9fe5e096076e56a60ce0a5a2b65f7

commit r12-6910-gc9c48ab7bad9fe5e096076e56a60ce0a5a2b65f7
Author: Andre Vehreschild <vehre@gcc.gnu.org>
Date:   Fri Jan 28 09:20:23 2022 +0100

    Prevent malicious descriptor stacking for scalar components.

    gcc/fortran/ChangeLog:

            PR fortran/103790
            * trans-array.cc (structure_alloc_comps): Prevent descriptor
            stacking for non-array data; do not broadcast caf-tokens.
            * trans-intrinsic.cc (conv_co_collective): Prevent generation
            of unused descriptor.

    gcc/testsuite/ChangeLog:

            PR fortran/103790
            * gfortran.dg/coarray_collectives_18.f90: New test.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/103790] internal compiler error: Segmentation fault when playing with coroutine
  2021-12-21 14:14 [Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine jack.cui2 at foxmail dot com
                   ` (5 preceding siblings ...)
  2022-01-28  9:05 ` cvs-commit at gcc dot gnu.org
@ 2022-01-28 11:36 ` cvs-commit at gcc dot gnu.org
  2022-02-14 15:18 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-28 11:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103790

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andre Vehreschild <vehre@gcc.gnu.org>:

https://gcc.gnu.org/g:26e237fb5b83582b30ef7c5a388bc4e968a5a289

commit r12-6915-g26e237fb5b83582b30ef7c5a388bc4e968a5a289
Author: Andre Vehreschild <vehre@gcc.gnu.org>
Date:   Fri Jan 28 12:34:17 2022 +0100

    Prevent malicious descriptor stacking for scalar components [V2].

    gcc/fortran/ChangeLog:

            PR fortran/103790
            * trans-array.cc (structure_alloc_comps): Prevent descriptor
            stacking for non-array data; do not broadcast caf-tokens.
            * trans-intrinsic.cc (conv_co_collective): Prevent generation
            of unused descriptor.

    gcc/testsuite/ChangeLog:

            PR fortran/103790
            * gfortran.dg/coarray_collectives_18.f90: New test.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/103790] internal compiler error: Segmentation fault when playing with coroutine
  2021-12-21 14:14 [Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine jack.cui2 at foxmail dot com
                   ` (6 preceding siblings ...)
  2022-01-28 11:36 ` cvs-commit at gcc dot gnu.org
@ 2022-02-14 15:18 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-14 15:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103790

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Andre Vehreschild
<vehre@gcc.gnu.org>:

https://gcc.gnu.org/g:680ee9c333280df74e06e1bc9f3be218424f94b3

commit r11-9567-g680ee9c333280df74e06e1bc9f3be218424f94b3
Author: Andre Vehreschild <vehre@gcc.gnu.org>
Date:   Mon Feb 14 16:12:14 2022 +0100

    Prevent malicious descriptor stacking for scalar components [V2, backport].

    gcc/fortran/ChangeLog:

            PR fortran/103790
            Backported from master.
            * trans-array.c (structure_alloc_comps): Prevent descriptor
            stacking for non-array data; do not broadcast caf-tokens.
            * trans-intrinsic.c (conv_co_collective): Prevent generation
            of unused descriptor.

    gcc/testsuite/ChangeLog:

            PR fortran/103790
            * gfortran.dg/coarray_collectives_18.f90: New test.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-02-14 15:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-21 14:14 [Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine jack.cui2 at foxmail dot com
2021-12-21 14:39 ` [Bug c++/103790] " marxin at gcc dot gnu.org
2021-12-21 14:47 ` iains at gcc dot gnu.org
2021-12-21 14:52 ` marxin at gcc dot gnu.org
2021-12-21 14:54 ` iains at gcc dot gnu.org
2021-12-21 19:38 ` pinskia at gcc dot gnu.org
2022-01-28  9:05 ` cvs-commit at gcc dot gnu.org
2022-01-28 11:36 ` cvs-commit at gcc dot gnu.org
2022-02-14 15:18 ` cvs-commit 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).