A long time ago, for linux, emu and kernel were separated into separate
library targets, but for some reason memory.c was kept in emu/ despite
only being linked into kernel. Now's a good time to move it where it
belongs.
select() takes a timeval, but pselect() takes a timespec, So large
nanosecond fractions were getting passed as microseconds to select()
and causing havoc. An earlier fix for Emacs somewhat limited the
damage by converting excessively large microsecond values into a +1s
increment.
This seems moderately successful, I was able to get logging out of the
CLI build with syslog(). I may marely have been having trouble with
logging on my Mac.
Remove spurious blank line
Cleanup commit history
One more try to clean up the commit history
Treat missing syscalls the same as stubbed one for logging
Treat missing syscalls the same as stubbed ones
Previously tlb_refresh would compare the specified MMU with the
uninitialized garbage value. If a new process is started and reuses
enough things (host stack, memory pointer) it will also reuse the old
garbage TLB entries and thus summon nasal demons.
This was causing the random node segfaults. Node does manual ASLR, so it
would randomly pick an address for a memory mapping near the brk region,
then later something would raise the brk and clobber that mapping,
replacing it with zeroes. Shortly afterward something would crash on a
null pointer.
Took a lot of digging around in rr to find this. The crash is never
directly connected to the brk call, of course. I set a watchpoint on the
pointer that got clobbered and saw it had been zero since the page was
mapped, but it took setting a watchpoint on the pointer to that pointer
to find that when it was mapped before that and was valid at that point.
At this point I'm ready to say node is fixed! #90