NVIDIA / NVIDIA/stdexec

Internal compiler error on GCC with modules

Open
#2,148 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.4k
Forks
270
Avg merge
3d 6h
Merged PRs (30d)
39

Description

When trying to compile the library with any modules on GCC (specifically GCC 16.1.1), I get an internal compiler error. For example, the following program Test.cpp

#include <stdexec/execution.hpp>

import std;

int main() {
    std::println("Hello, world!");
}

with the command g++ Test.cpp -o Test -std=c++26 -fmodules, I get this error:

In file included from /usr/include/stdexec/__detail/__env.hpp:22,
                 from /usr/include/stdexec/__detail/__debug.hpp:22,
                 from /usr/include/stdexec/__detail/__completion_signatures_of.hpp:21,
                 from /usr/include/stdexec/__detail/__as_awaitable.hpp:24,
                 from /usr/include/stdexec/execution.hpp:22,
                 from Test.cpp:1:
/usr/include/stdexec/__detail/__query.hpp:177:39: internal compiler error: Segmentation fault
  177 |   inline constexpr forwarding_query_t forwarding_query{};
      |                                       ^~~~~~~~~~~~~~~~
0x1929892 internal_error(char const*, ...)
        ???:0
0x1a3e403 duplicate_decls(tree_node*, tree_node*, bool, bool)
        ???:0
0x1beeb37 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**)
        ???:0
0x278bb31 c_parse_file()
        ???:0
0x2761230 c_common_parse_file()
        ???:0
/usr/lib/gcc/x86_64-pc-linux-gnu/16/cc1plus -quiet -D_GNU_SOURCE Test.cpp -quiet -dumpdir Test- -dumpbase Test.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -std=c++26 -fmodules -o /tmp/ccLyV9c4.s
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://github.com/CachyOS/CachyOS-PKGBUILDS/issues> for instructions.

This doesn't seem to happen on Clang, and perhaps this issue is better reported directly upstream on GCC (which I'm not really sure how to do), but I do think this is worth pointing out as the library is basically unusable on GCC with modules on my end.

This is in particular a problem because it also prevents any work on providing the stdexec library as a module (see #2139).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with Test.cpp, GCC 16.1.1, -std=c++26, and -fmodules, then compare the result with Clang. Inspect the failure at __query.hpp line 177 and the relationship to #2139; done means isolating whether stdexec or GCC is responsible and documenting a confirmed fix, workaround, or upstream report.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.