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

HXCPP_GC_MOVING in combination with HXCPP_ALIGN_ALLOC

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

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

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

評価

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

調査の方向性

まず src/hx/gc/Immix.cpp の3817-3819行付近から始め、Main.hx の例と build.hxml のフラグ HXCPP_GC_MOVING および HXCPP_ALIGN_ALLOC を使って失敗を再現します。いずれか一方のフラグを無効にした場合と、これらの行を削除した場合の動作を比較します。両方のフラグを有効にしてもサンプルでセグメンテーションフォールトが発生しなくなれば完了です。

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

説明

When I run the following program built with HXCPP_GC_MOVING and HXCPP_ALIGN_ALLOC flags enabled, I get a segmentation fault. Commenting out one of them fixes the problem. Moreover , removing these lines solves the problem, too.

System info
  • haxe 4.3.6
  • hxcpp 4.3.68
  • clang 19.1.4
  • macOS Sequoia 15.1.1
Main.hx
class Point {
	public function new(x: Int, y: Int) {
		this.x = x;
		this.y = y;
	}
	
	public var x: Int;
	public var y: Int;
}

final ITERATIONS = 10000000;

class Main {
	private static final array: Array<Point> = [];
	
	public static function addPoint(): Void {
		array.push(new Point(array.length, array.length));
	}
	
	public static function main(): Void {
		for (i in 0...ITERATIONS) {
			addPoint();
		}

		final halfSize = Std.int(array.length / 2);
		
		array.resize(halfSize);
		for (i in 0...halfSize) {
			addPoint();
		}

		var idx = Std.int(Math.random() * array.length);
		trace('$idx == ${array[idx].x}');
	}
}
build.hxml
-D HXCPP_GC_MOVING
-D HXCPP_ALIGN_ALLOC
-D HXCPP_API_LEVEL=430

-main Main
--cpp build
主要言語
C++
スター
329
フォーク
231
平均マージ
1日 6時間
マージ済み PR(30日)
9

環境構築

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

はじめの一歩

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

HaxeFoundation/hxcpp のほかの issue

HaxeFoundation/hxcpp の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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