-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlockImpTest failures with Clang 8 on RHEL8 #147
Comments
Do you have any unusual SELinux settings enabled? The block-to-imp code has been tested (in CI) on x86-64 Linux, but it may be that you have a setting that prevents changing permission of pages from read-write to read-execute. |
Hello, I use the default SELinux policy for CentOS 8. I can however confirm that all the tests pass with SELinux off. (tested it on another machine using the same OS) For reference, Clang version is: Thanks, |
A quick check reveals that using diff --git a/block_to_imp.c b/block_to_imp.c
index 655489a..8377623 100644
--- a/block_to_imp.c
+++ b/block_to_imp.c
@@ -163,7 +163,7 @@ static struct trampoline_set *alloc_trampolines(char *start, char *end)
#if _WIN32
metadata->buffers = VirtualAlloc(NULL, sizeof(struct trampoline_buffers), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
#else
- posix_memalign((void **)&metadata->buffers, getpagesize(), sizeof(struct trampoline_buffers));
+ metadata->buffers = mmap(NULL, sizeof(struct trampoline_buffers), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
#endif
for (int i=0 ; i<HEADERS_PER_PAGE ; i++)
{ |
Interesting. I'm not sure why we're using |
Should fix #147 (SELinux related segfault)
Should fix #147 (SELinux related segfault)
On latest master:
`98% tests passed, 4 tests failed out of 178
Total Test time (real) = 29.15 sec
The following tests FAILED:
25 - BlockImpTest (SEGFAULT)
26 - BlockImpTest_optimised (SEGFAULT)
27 - BlockImpTest_legacy (SEGFAULT)
28 - BlockImpTest_legacy_optimised (SEGFAULT)`
`$ lldb Test/BlockImpTest
(lldb) target create "Test/BlockImpTest"
Current executable set to 'Test/BlockImpTest' (x86_64).
(lldb) run
Process 4784 launched: '/home/ares/labs2/libobjc2/Build/Test/BlockImpTest' (x86_64)
Process 4784 stopped
frame #0: 0x0000000000652000
-> 0x652000: movq -0x1007(%rip), %rsi
0x652007: xchgq %rsi, %rdi
0x65200a: jmpq *-0x1008(%rip)
0x652010: movq -0x1007(%rip), %rsi
(lldb) bt
frame 1.7.1 release? #1: 0x00000000004016fa BlockImpTest
main at BlockImpTest.m:38:2 frame #2: 0x00007ffff75d9873 libc.so.6
.annobin_libc_start.c + 243frame Fix returning argument types from methods. #3: 0x000000000040140e BlockImpTest
.annobin_init.c.hot + 46
The text was updated successfully, but these errors were encountered: