Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Using the print command i found that the page fault actually occurs in function place_ordered_array when it tries to clear the memory in which to place heap->index.
so as to create entries for the entire heap in the page directory. I came across this bug on this forum itself. So if anyone using JamesM heap code do make the latter change (if not already present).