James Molloy's Tutorial Known Bugs: Difference between revisions
Jump to navigation
Jump to search
James Molloy's Tutorial Known Bugs (view source)
Revision as of 22:03, 23 January 2016
, 8 years agoMoved heap bug details from the user mode section to the heap section
[unchecked revision] | [unchecked revision] |
m (renamed real mode to user mode) |
(Moved heap bug details from the user mode section to the heap section) |
||
Line 82:
It is probably best that you write your own heap implementation.
There is an operator precedence bug in <tt>find_smallest_hole()</tt> that will cause bad allocations and memory overwrites if attempting to fork in user mode later on.
To fix the problem, change this:▼
<nowiki>▼
if ((location+sizeof(header_t) & 0xFFFFF000) != 0)</nowiki>▼
to this:▼
<nowiki>▼
if (((location+sizeof(header_t)) & 0xFFFFF000) != 0)</nowiki>▼
See the section on user mode below for more details.
== Problem: VFS Code ==
Line 237 ⟶ 249:
set_kernel_stack(current_task->kernel_stack+KERNEL_STACK_SIZE);</nowiki>
=== Problem 5:
▲To fix the problem, change this:
▲ <nowiki>
▲if ((location+sizeof(header_t) & 0xFFFFF000) != 0)</nowiki>
▲to this:
▲ <nowiki>
▲if (((location+sizeof(header_t)) & 0xFFFFF000) != 0)</nowiki>
== Conclusion ==
|