Implement shm_open for _posixshmem. Fixes oracle/graalpython#502#1004
Open
ztawfick-ux wants to merge 2 commits into
Open
Implement shm_open for _posixshmem. Fixes oracle/graalpython#502#1004ztawfick-ux wants to merge 2 commits into
ztawfick-ux wants to merge 2 commits into
Conversation
Signed-off-by: Zac Tawfick <ztawfick@netflix.com>
msimacek
approved these changes
Jul 2, 2026
msimacek
left a comment
Contributor
There was a problem hiding this comment.
Thank you for the contribution
…eption in emulated posix backend Signed-off-by: Zac Tawfick <ztawfick@netflix.com>
Contributor
Author
|
I don't think the CI failures were due to my code changes. How can I verify this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_posixshmemwas only a skeleton (a no-opshm_unlink, noshm_open), somultiprocessing.shared_memory.SharedMemoryfailed withAttributeError: module '_posixshmem' has no attribute 'shm_open'. This implements real POSIX shared memory end to end, so shared-memory IPC works on GraalPy without user code changes.Fixes #502.
Changes
python-libposix/src/posix.c): addcall_shm_open/call_shm_unlinkwith errno capture.shmOpen/shmUnlinktoPosixSupportLibrarywith implementations in all backends —NativePosixSupport(NFI downcalls), plusEmulated/Logging/PreInitwrappers.PosixShMemModuleBuiltins): implementshm_open(path, flags, mode=0o777)returning the fd and a realshm_unlink(path), using the sharedPathConversionNodeand raising the correctOSErrorsubclasses (FileExistsError/FileNotFoundError), mirroringos.open.multiprocessing/resource_tracker.py): restore the upstreamshared_memory→_posixshmem.shm_unlinkcleanup registration (previously commented out).suite.py): linklibrt(-lrt) on Linux so the symbols resolve on older glibc/musl.Notes
OSError, consistent with the existingsem_*behavior.Testing
SharedMemoryTestintest_multiprocessing.py(create/write/read across handles, missing-segment and duplicate-create errors).