IronLanguages / IronLanguages/ironpython3

Intermittent failure in ctypes.test_random_things

Open
#1,300 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module-ctypes
Dominant language
C#
Stars
2.8k
Forks
316
Avg merge
1d 9h
Merged PRs (30d)
1

Description

The following code intermittently fails (doesn't run in a loop in CPython.ctypes.test_random_things)

from ctypes import *
windll.kernel32.LoadLibraryA.restype = c_void_p
last_hdll = windll.kernel32.LoadLibraryA(b"kernel32")

for i in range(10000):
    windll.kernel32.LoadLibraryA.restype = c_void_p
    hdll = windll.kernel32.LoadLibraryA(b"kernel32")
    assert hdll == last_hdll

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CPython.ctypes.test_random_things and reproduce the provided Windows LoadLibraryA loop. Investigate why repeated calls sometimes return a different handle, then ensure the test no longer fails intermittently and covers the expected handle behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.