charmxi segfaults on a declared CkMigrateMessage constructor entry (null member in AST, isTramTarget)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
Read the constructor entry rule near the warning in src/xlat-i/xi-grammar.y, then trace how it adds members to the AST and how isTramTarget() traverses them in src/xlat-i/xi-AstNode.h. Reproduce with the supplied interface and add a regression test under tests/charm++/charmxi_parsing; done means charmxi no longer segfaults on the declared migration constructor and the test passes.
索引モデルが issue の本文から書いたものです。
説明
Summary
charmxi segfaults on an interface file that declares a migration constructor as an entry method, right after printing the warning that such a constructor is taken for granted. Reproduces on recharm (4ad7320be, reconverse-darwin-arm8) and on a classic netlrts-darwin-arm8-smp build.
Reproducer
mainmodule Y {
array [1D] Cell {
entry Cell();
entry Cell(CkMigrateMessage* m);
};
};
$ charmxi Y.ci
Y.ci:4:5-36: warning: CkMigrateMsg chare constructor is taken for granted
...
Segmentation fault (exit 139)
Backtrace (lldb): EXC_BAD_ACCESS address=0x0 in xi::AstChildren<xi::Member>::isTramTarget().
Cause
The grammar rule for a constructor entry (src/xlat-i/xi-grammar.y, the ENTRY Name EParameters ... alternative near the warning) sets $$ = NULL after warning, so the chare's member list contains a null Member*. The traversals written since then guard against that (genGlobalCode, genTramPups in src/xlat-i/xi-AstNode.h test if (*i)), but AstChildren<Child>::isTramTarget() (added with [aggregate] support in 1225c6d78, 2017) dereferences every child without the check. The warning itself dates from 2015, so declaring the migration constructor has crashed charmxi since 2017 rather than being tolerated as the warning implies.
Two secondary defects in the same rule: the warning is attributed to the wrong line (the next entry's line when one follows, since lineno has already advanced past the semicolon), and the entry is dropped instead of being accepted with a warning, which is why old code and tutorials that declare entry X(CkMigrateMessage*) only work when nothing else in the module triggers the TRAM scan.
Suggested fix
Either do not push the null into the member list (accept the entry and ignore it in code generation, or drop it at the point the list is built), or add the if (*i) guard to isTramTarget() as in the other traversals. The first is better: a null child in the AST is what every later traversal has to work around. A regression test belongs in tests/charm++/charmxi_parsing (added by #4027).
Found while evaluating an external translator that emits this declaration; not specific to that tool.
- 主要言語
- C++
- スター
- 241
- フォーク
- 62
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 125
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
charmplusplus/charm のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
charmplusplus/charm#4210 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
charmplusplus/charm#4160 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
charmplusplus/charm#3619 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
CkFreeSysMsg pools non-system messages; a later CkAllocSysMsg can return a CkReductionMsg対応中かも @lvkale が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
charmplusplus/charm#4224 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
charmplusplus/charm#4223 ·
メンテナーはふだん 1 日以内に返信
charmplusplus/charm の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
-
area:qmc bug
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 3 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
ASGC-Game-Jam/asgc-gamejam-2026#563 ·
メンテナーはふだん 1 日以内に返信
-
area/ysql kind/bug priority/medium status/awaiting-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
yugabyte/yugabyte-db#37523 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100