Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

subobject-linkage error with GCC

オープン
#1,143 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
cpp
領域
backend

調査の方向性

まず、示されている sleep_for コルーチンと最新の stdexec を使って、../include/sdbusplus/async/timer.hpp:109 における GCC の -Werror=subobject-linkage エラーを再現します。co_await sleep_sender(ctx, time) と co_await execution::schedule(get_scheduler(ctx)) の診断を比較します。両方の await が subobject-linkage エラーなしでコンパイルできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

This could very well be something wrong with my code. Using the latest stdexec, I'm started seeing this subobject-linkage warning in GCC. It isn't obvious which type is even being called out as a problem.

../include/sdbusplus/async/timer.hpp:109:5: error: ‘sdbusplus::async::timer_ns::sleep_sender::sleep_for(sdbusplus::async::context&, sdbusplus::event::event::time_resolution)::_ZN9sdbusplus5async8timer_ns12sleep_sender9sleep_forERNS0_7contextENSt6chrono8durationIlSt5ratioILl1ELl1000000EEEE.Frame’ has a field ‘stdexec::__as_awaitable::__sender_awaitable<stdexec::_Yp<exec::__task::basic_task<void, exec::__task::__default_task_context_impl<exec::__task::__scheduler_affinity::__sticky> >::__promise>, stdexec::__sexpr<stdexec::__detail::{anonymous}::<lambda(_Tag, _Captures&& ...)>::<lambda(_Cvref, _Fun&&)> > >::__t sdbusplus::async::timer_ns::sleep_sender::sleep_for(sdbusplus::async::context&, sdbusplus::event::event::time_resolution)::_ZN9sdbusplus5async8timer_ns12sleep_sender9sleep_forERNS0_7contextENSt6chrono8durationIlSt5ratioILl1ELl1000000EEEE.Frame::Aw1_2_4’ whose type has internal linkage [-Werror=subobject-linkage]

The affected code is a rather simple co-routine using the stdexec task.

    static task<> sleep_for(context& ctx, event_t::time_resolution time)
    {
        // Run the delay sender and then switch back to the worker thread.
        // The delay completion happens from the sd-event handler, which is
        // ran on the 'caller' thread.
        co_await sleep_sender(ctx, time);
        co_await execution::schedule(get_scheduler(ctx));
    }

Both co_awaits have this subobject-linkage problem, so even if I comment out the first one I still end up with it.

主要言語
C++
スター
2.4k
フォーク
274
平均マージ
1日 18時間
マージ済み PR(30日)
39

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/stdexec のほかの issue

NVIDIA/stdexec の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。