On 10/2/2013 6:15 PM, Adam D. Ruppe wrote:
Segfaults aren't necessarily bugs... though I'm not sure if a userspace handler
can do much about it. But from a kernel perspective, they can be generated by
page faults too, which can be successfully handled by loading the requested
memory block (e.g. from a swap file) and then retrying the operation, or copying
the page into a writable location and mapping that in; hardware assisted
copy-on-write.

That's true, and in fact I implemented a generational GC once that relied on catching seg faults from invalid writes to keep track of which pages were 'dirty'. It did work fine, although it turned out to be too slow.


I've never tried to do this in a unix program so I don't know how much you can
do, but presumably Sean's example did something along these lines, so it would
be by design rather than bugs.

If that is the design, then I misunderstood it.

Reply via email to