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

fix(tool,cl): msgpack-c recursive discovery ends in duplicate atomic counter type

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
22/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, go
領域
compilers

調査の方向性

Start with tool/gen.go, where TopHeaders runs recursive discovery when Files is absent, then tool/pputil/pputil.go for the include-based top-header selection. The collision involves msgpack's unpack_template.h, which needs caller-provided macros, and the duplicate X_atomicCounterT typedef from gcc_atomic.h and sysdep.h; the typedef path runs through loadTypedef and defineTypedef. Done means generation over the installed msgpack-c headers either discovers the public API without the panic or fails with a precise unsupported-input diagnostic, and the design choice needs maintainer input first.

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

説明

bug

Observed failure

With recursive installed-header discovery and no Files allowlist, msgpack-c generation emits preprocessing diagnostics for unpack_template.h, then panics on a duplicate generated type X_atomicCounterT.

msgpack/unpack_template.h: ... msgpack_unpack_func template is not defined
msgpack/unpack_template.h: ... msgpack_unpack_callback template is not defined
msgpack/unpack_template.h: ... msgpack_unpack_struct template is not defined
panic: .../msgpack/gcc_atomic.h:14:1: X_atomicCounterT redeclared in this block
    previous declaration at .../msgpack/sysdep.h:84:5

The ordering above is observed in the log; it is not a claim that the template diagnostics have been proven to cause the type collision.

Confirmed jobs: Linux arm64 and macOS amd64. Both pass the Formula test, installed-input preparation, LLGo build, and llcppg build, then fail during Test llcppg generation with exit code 2. The other two platform jobs were pending when evidence was collected.

Versions and reproduction input

  • llcppg: 8fc0f987e41ffe4b4f608e9541422b460ea89fea.
  • LLGo: afe9a5407260348b18c7104e98d76cb5cdf48b29; LLVM 21.
  • Actual installed source: msgpack/msgpack-c c-7.0.2, commit e17beb371b59459a13b48e166a11e123bda5bf93. The Formula floor is c-6.1.0, but that is not the version used by these CI jobs.
  • Failed index head: 249c1573839532d54ca139e7de5dd03a375e8f39, index PR #34.
{
  "Name": "msgpack",
  "Language": "c",
  "Dir": "./include/...",
  "LLGoPackage": "link: $(pkg-config --libs msgpack-c)",
  "FuncPrefix": ["msgpack_"],
  "TypePrefix": ["msgpack_"]
}

The workflow stages the entire installed include tree under source/include, initializes the source Go module, and runs llcppg -v ./generated ./source. It does not restrict generation to the umbrella header.

Source evidence and expected behavior

unpack_template.h, lines 11–32, explicitly requires caller-provided template macros. include/msgpack/gcc_atomic.h:14 declares typedef int _msgpack_atomic_counter_t;; the installed sysdep.h:84 comes from cmake/sysdep.h.in:84, which declares typedef unsigned int _msgpack_atomic_counter_t; in its alternative branch.

The installed public API should be discoverable without treating context-dependent template/alternative implementation headers as unrelated translation units that collide, or the tool should report a precise unsupported-input diagnostic instead of panicking. The correct discovery/type-handling change still needs investigation; excluding public APIs is not proposed as the fix.

Main at aab6dbf0baedc47b42f9576a65dd79ce6715e31a was checked read-only: tool/gen.go still calls TopHeaders for recursive discovery when Files is absent; tool/pputil/pputil.go performs the include-based top-header selection; typedefs reach loadTypedef/defineTypedef. No latest-main runtime reproduction is claimed.

主要言語
Go
スター
41
フォーク
13
平均マージ
2時間 17分
マージ済み PR(30日)
178

環境構築

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

はじめの一歩

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

goplus/llcppg のほかの issue

goplus/llcppg の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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