Skip to content

Commit

Permalink
Try to fix uffd failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Jun 10, 2021
1 parent b7ca4c9 commit a000746
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/runtime/src/instance/allocator/pooling/uffd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ struct FaultLocator {
instances_start: usize,
instance_size: usize,
max_instances: usize,
unguarded_memories_start: usize,
memories_start: usize,
memories_end: usize,
memory_size: usize,
Expand All @@ -175,6 +176,7 @@ impl FaultLocator {
Self {
instances_start,
instance_size: instances.instance_size,
unguarded_memories_start: instances.memories.mapping.as_ptr() as usize,
max_instances: instances.max_instances,
memories_start,
memories_end,
Expand Down Expand Up @@ -345,7 +347,7 @@ fn fault_handler_thread(uffd: Uffd, locator: FaultLocator) -> Result<()> {

let (start, end) = (start as usize, end as usize);

if start == locator.memories_start && end == locator.memories_end {
if start == locator.unguarded_memories_start && end == locator.memories_end {
break;
} else {
panic!("unexpected memory region unmapped");
Expand Down

0 comments on commit a000746

Please sign in to comment.