IronLanguages / IronLanguages/ironpython3
Segmentation fault running ctypes.test_slicing on Mono.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 316
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 1
Description
Running the following code Mono (from CPython.ctypes.test_slicing) leads to all sorts of failures (upon exiting the program?):
from ctypes import *
import _ctypes_test
s = b"abcdefghijklmnopqrstuvwxyz"
dll = CDLL(_ctypes_test.__file__)
dll.my_strdup.restype = POINTER(c_char)
dll.my_free.restype = None
res = dll.my_strdup(s)
dll.my_free(res)
Does not occur consistently. Might be some sort of marshaling issue causing a double free?
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.
Research direction
Use CPython.ctypes.test_slicing and the shown Mono ctypes snippet as entry points; begin by reproducing the intermittent failure and checking whether it occurs during exit after my_free. Investigate marshaling and ownership around _ctypes_test.my_strdup and my_free, then verify that the failure no longer occurs consistently and that the relevant slicing test covers the regression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100