Incorrect winmode in load_shared_library

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
backend, tooling

調査の方向性

コードベース内の load_shared_library メソッドを確認してください。おそらく、ライブラリの読み込みを処理するファイルにあります。issue では、winmode を ctypes.RTLD_GLOBAL に設定している行が示されています。このメソッドが定義されている場所を見つけ、winmode に関する ctypes のドキュメントを確認し、値を None に変更してください。Windows でライブラリが依存関係を正しく読み込むことをテストしてください。

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

説明

In the method load_shared_library the winmode specification is incorrect.

The actual code is:

cdll_args["winmode"] = ctypes.RTLD_GLOBAL

ctypes.RTLD_GLOBAL is not a value for winmode but only for mode argument.
The documentation is correct at https://docs.python.org/3/library/ctypes.html but confusing.

The winmode parameter is used on Windows to specify how the library is loaded (since mode is ignored). It takes any value that is valid for the Win32 API LoadLibraryEx flags parameter

The correct value should be None to use the default dll searching by ctype

Specifiy RTLD_GLOBAL (that is 0) will make the LoadLibraryEx search the dlls as the normal LoadLibrary function, behaving incorrectly and eventually not finding the dependencies.

主要言語
Python
スター
10.6k
フォーク
1.5k
平均マージ
23分
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

abetlen/llama-cpp-python のほかの issue

abetlen/llama-cpp-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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