Calling Gc.compact() in cppia collects the current CppiaClosure/ScriptCallable?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、hxcpp_set_top_of_stack() と hxRunLibrary() から Module.fromData、module.boot()、Type.createInstance、Reflect.callMethod、Gc.compact() までの報告されたシーケンスを再現します。cppia メソッドが戻った後のクラッシュを、compact() を削除した場合と比較します。closure が引き続き使用可能であること、またはサポートされる制限と必要な修正が確定すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I am not even sure if the title correctly describes the issue. But it seems to be the case for what I am seeing.
Looking at the stack trace below it seems like the function variable magically becomes null, while it was still usable 2 lines above (function->runFunctionClosure(ctx);)
What I notice is that there is a cpp.vm.Gc.compact() call inside the cppia function. Removing such call seems to fix the problem.
The setup is a bit complex to be isolated. So for now I am going to first describe the setup with text and see if there any insights and I hope it is some obvious gc usage issue. The following logic all happens in the same non-haxe thread:
- Haxe is used as a library in a c++ project and it is initialized with:
hxcpp_set_top_of_stack(); const char *err = hxRunLibrary(); - cppia bytecode is loaded and stored in a Haxe static variable
module = cpp.cppia.Module.fromData(bytes); module.boot(); - a class defined in cppia is initialized (
Type.createInstance(module.resolveClass(name))) and a instance method is invoked viaReflect.callMethod - in such instance method
cpp.vm.Gc.compact()is called - the crash in the screenshot happens, after the cppia method returns
Info:
macos: 15 (arm64)
haxe: 4.3.6
hxcpp: git (96875093ec43e48dc2e1da95b8730e0c122ae017)
- 主要言語
- C++
- スター
- 329
- フォーク
- 230
- 平均マージ
- 2日 8時間
- マージ済み PR(30日)
- 5
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
HaxeFoundation/hxcpp のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
HaxeFoundation/hxcpp#1217 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
HaxeFoundation/hxcpp#1415 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 47/100
HaxeFoundation/hxcpp#1414 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
HaxeFoundation/hxcpp#1396 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
HaxeFoundation/hxcpp#1391 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
HaxeFoundation/hxcpp の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
enhancement question
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DarkStarSystems/pcons#224 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
LizardByte/Sunshine#5953 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
(S1 - Need confirmation)
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
CleverRaven/Cataclysm-DDA#89133 ·
メンテナーはふだん 1 日以内に返信