mirror of
https://github.com/usatiuk/ficus.git
synced 2025-10-29 00:27:52 +01:00
Check for a funny bug
Sometimes first and last pages in extend_heap don't get properly mapped... They're there according to qemu's info tlb... But are they really? After reloading CR3 they seem to appear properly. Debugging with qemu reply produced one replay in which the bug disappeared when trying to debug it... So it cannot be excluded that it's a qemu bug...
This commit is contained in:
@@ -47,6 +47,13 @@ static void extend_heap(size_t n_pages) {
|
||||
void *p = get4k();
|
||||
assert2(p != NULL, "Kernel out of memory!");
|
||||
KERN_AddressSpace->map((void *) KERN_HeapEnd, (void *) HHDM_V2P(p), PAGE_RW);
|
||||
volatile char *bugcheck2 = (volatile char *) KERN_HeapEnd;
|
||||
for (size_t i = 0; i < PAGE_SIZE; i++) {
|
||||
bugcheck2[i] = '\xff';
|
||||
}
|
||||
for (size_t i = 0; i < PAGE_SIZE; i++) {
|
||||
assert2(bugcheck2[i] == '\xff', "I am insane");
|
||||
}
|
||||
KERN_HeapEnd += PAGE_SIZE;
|
||||
}
|
||||
allocated.fetch_add(n_pages * PAGE_SIZE);
|
||||
|
||||
@@ -62,8 +62,8 @@ SECTIONS
|
||||
} :data
|
||||
|
||||
/* Discard .note.* and .eh_frame since they may cause issues on some hosts. */
|
||||
/DISCARD/ : {
|
||||
*(.eh_frame)
|
||||
*(.note .note.*)
|
||||
}
|
||||
/* /DISCARD/ : {*/
|
||||
/* *(.eh_frame)*/
|
||||
/* *(.note .note.*)*/
|
||||
/* }*/
|
||||
}
|
||||
Reference in New Issue
Block a user