Skip to content
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

Fix libc error detection #182

Merged
merged 2 commits into from
Jun 15, 2021
Merged

Fix libc error detection #182

merged 2 commits into from
Jun 15, 2021

Conversation

Lichtso
Copy link

@Lichtso Lichtso commented Jun 15, 2021

posix_memalign and mprotect did not check for errors.

@Lichtso Lichtso added the bug Something isn't working label Jun 15, 2021
@Lichtso Lichtso force-pushed the fix/libc_error_detection branch 3 times, most recently from d342296 to 6f0effe Compare June 15, 2021 10:59
@Mrmaxmeier
Copy link

Note: mprotect might return -EAGAIN/-EINTR in strange edge-cases (lock contention in Linux's memory manager?):
https://elixir.bootlin.com/linux/latest/source/mm/mprotect.c#L541
It'd probably be safe to re-try the call in this case.

@Lichtso Lichtso force-pushed the fix/libc_error_detection branch 4 times, most recently from 01bb0cb to 38e64f9 Compare June 15, 2021 14:21
@Lichtso
Copy link
Author

Lichtso commented Jun 15, 2021

Note: mprotect might return -EAGAIN/-EINTR in strange edge-cases (lock contention in Linux's memory manager?):
https://elixir.bootlin.com/linux/latest/source/mm/mprotect.c#L541
It'd probably be safe to re-try the call in this case.

Thanks for the hint, I implemented a retry loop (with 3 trys max).

@Lichtso Lichtso force-pushed the fix/libc_error_detection branch from 38e64f9 to 36a0de3 Compare June 15, 2021 15:10
@Lichtso Lichtso merged commit 5178eda into main Jun 15, 2021
@Lichtso Lichtso deleted the fix/libc_error_detection branch June 15, 2021 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants