OCP seems to generate wrong function signature for array arguments
まだ誰も着手していません。
評価
調査の方向性
まず、OCCT HLRAlgo::InitMinMax の宣言と、生成された OCP.HLRAlgo.HLRAlgo.InitMinMax_s シグネチャを比較します。配列引数のバインディング生成パスを調査し、このエントリーポイントを使ってクラッシュを再現します。配列引数が正しくサポートされるか、生成された関数が無効なシグネチャを受け入れずに安全に拒否すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
OCP seems to generate wrong function signature for array arguments.
For example, OCCT has:
void HLRAlgo::InitMinMax (const Standard_Real Big, Standard_Real Min[16], Standard_Real Max[16])
But OCP lists OCP.HLRAlgo.HLRAlgo.InitMinMax_s() as:
TypeError: InitMinMax_s(): incompatible function arguments. The following argument types are supported:
1. (Big: float, Min: float, Max: float) -> None
Of course, if you actually try calling it with just float, it crashes:
>>> from OCP.HLRAlgo import HLRAlgo
>>> HLRAlgo.InitMinMax_s(0., 0., 0.)
*** stack smashing detected ***: terminated
Aborted
I'm not sure if there are any array-argument-taking functions which are likely to be used by anyone (I was only trying to use the MinMax things in HLR to verify I've understood some code correctly, not for actual work); Grepping does indicate that they are used at least in a few other places, but I don't know if those are things that anyone is likely to want to use.
What I'm saying is, I'm not sure if this is "worth" fixing properly (ie. adding support for array arguments), and how hard that would be to do - but if it's decided that it's not worth fixing properly, maybe the functions could at least be made to raise an error when called, instead of actually allowing the call with the wrong signature to go through and crash the program?
- 主要言語
- C++
- スター
- 203
- フォーク
- 50
- 平均マージ
- 3日 4時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CadQuery/OCP のほかの issue
-
Generation steps fails when OPENGL_INCLUDE_DIRS is a list対応中かも @adam-urbanczyk が 69 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
-
Python 3.14t buildオープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
OCCT8
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
似ている issue
-
refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信