Skip to content

Refactor - AccessViolationHandler #42

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

Lichtso
Copy link
Collaborator

@Lichtso Lichtso commented May 13, 2025

Currently the MemoryCowCallback is only invoked when an access is completely contained within a region marked as CoW. Furthermore, it automatically removes the CoW marking and the region will become a normal writable region, meaning the next access will not invoke the MemoryCowCallback anymore.

This PR switches to a model which is closer to SIGSEGV in other operating systems: It is invoked on every failed access and the handler the access type, location and length passed in and is also responsible for adjusting the memory regions. The memory region which has the next lowest starting virtual address, as well as the virtual address space available to that region, is also supplied as that is typically of interest and has been found already.

@Lichtso Lichtso force-pushed the refactor/access_violation_handler branch 6 times, most recently from b8f4a7d to 3cd5b10 Compare May 14, 2025 14:58
LucasSte
LucasSte previously approved these changes May 14, 2025
@LucasSte LucasSte dismissed their stale review May 14, 2025 19:59

I didn't mean to approve it. It was supposed to be a comment only.

@Lichtso Lichtso force-pushed the refactor/access_violation_handler branch 2 times, most recently from 09698f7 to 67065d3 Compare May 15, 2025 15:59
@Lichtso Lichtso requested a review from LucasSte May 15, 2025 16:05
@Lichtso Lichtso force-pushed the refactor/access_violation_handler branch from 67065d3 to 85ce712 Compare May 16, 2025 08:11
@Lichtso Lichtso requested a review from LucasSte May 16, 2025 16:44
@Lichtso Lichtso force-pushed the refactor/access_violation_handler branch from c74ef53 to f26d6c8 Compare May 30, 2025 19:11
@Lichtso Lichtso force-pushed the refactor/access_violation_handler branch from f26d6c8 to 8e597c0 Compare June 1, 2025 20:39
@Lichtso Lichtso force-pushed the refactor/access_violation_handler branch from 8e597c0 to 601541c Compare June 1, 2025 20:58
@Lichtso Lichtso force-pushed the refactor/access_violation_handler branch from 601541c to 1c70214 Compare June 10, 2025 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants