Incorrect winmode in load_shared_library
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
Research direction
Look at the load_shared_library method in the codebase, likely in a file handling library loading. The issue points to a line setting winmode to ctypes.RTLD_GLOBAL. Find where this method is defined, understand the ctypes documentation for winmode, and change the value to None. Test by ensuring the library loads dependencies correctly on Windows.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 1.5k
- Avg merge
- 23m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from abetlen/llama-cpp-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
abetlen/llama-cpp-python#2352 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
abetlen/llama-cpp-python#2211 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
abetlen/llama-cpp-python#2210 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
abetlen/llama-cpp-python#2145 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
abetlen/llama-cpp-python#2135 · 4 reactions ·
All issues in abetlen/llama-cpp-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100