If ashmem is not available, fall back to wrapping vanilla SYSV shared memory#22
Open
robertkirkman wants to merge 1 commit into
Open
If ashmem is not available, fall back to wrapping vanilla SYSV shared memory#22robertkirkman wants to merge 1 commit into
robertkirkman wants to merge 1 commit into
Conversation
Member
Author
… memory - Fixes termux/termux-docker#87 - Fixes termux#13 - If vanilla SYSV shared memory is allowed to be run on normal Android, the program will crash, but this can be worked around by attempting to always detect whether ashmem is available before doing anything, and only wrapping vanilla SYSV shared memory in the case that ashmem is not available. If ashmem is not available AND SYSV shared memory is still blocked by SELinux, then on that device, logically there is no codepath that `libandroid-shmem` could have used to work, so the program could not have worked, and crashing in that case might be acceptable. - Is passing all of these tests on all devices of all architectures and all types of Android that have been tested so far: - `cd ~/.termux-build/libandroid-shmem/src/test && make` - `initdb $PREFIX/var/lib/postgresql` - `shmem-share.c` - `shmem-test.c` - Derived from code primarily originating from https://android.googlesource.com/platform/bionic/+/02ce401d1e2b31586c94c8b6999364bbbce27388/libc/bionic/sys_shm.cpp - Potential alternative to termux#21
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.
Fixes
postgresqland some other reverse dependencies oflibandroid-shmemdo not work termux-docker#87Fixes Feature request. #13
If vanilla SYSV shared memory is allowed to be run on normal Android, the program will crash, but this can be worked around by attempting to always detect whether ashmem is available before doing anything, and only wrapping vanilla SYSV shared memory in the case that ashmem is not available. If ashmem is not available AND SYSV shared memory is still blocked by SELinux, then on that device, logically there is no codepath that
libandroid-shmemcould have used to work, so the program could not have worked, and crashing in that case might be acceptable.Is passing all of these tests on all devices of all architectures and all types of Android that have been tested so far:
cd ~/.termux-build/libandroid-shmem/src/test && makeinitdb $PREFIX/var/lib/postgresqlshmem-share.cshmem-test.cDerived from code primarily originating from https://android.googlesource.com/platform/bionic/+/02ce401d1e2b31586c94c8b6999364bbbce27388/libc/bionic/sys_shm.cpp
Potential alternative to Replace ashmem backend with memfd_create (runtime fallback) #21 (I think it is only a successful alternative for termux-docker and similar devices, not for Honor ALT-AN00)