Re: Overcomittable memory

From: John Ripley (john@empeg.com)
Date: Fri Mar 31 2000 - 05:44:35 EST


Olaf Weber wrote:
> John Ripley writes:
> > Have you tried implementing a program that handles SIGBUS? It's a bloody
> > nightmare that will drive you insane (especially if you plan on using
> > threads).
> > I think I have previously sent an example pseudo-program demonstrating
> > this. But for other viewers in linux-kernel who may have missed it:
>
> Based on your pseudo-code:
>
> --------
...
> volatile caddr_t bad_addr;
> jmp_buf env;
>
> void sigbus_action(int sig, siginfo_t *siginfo, void *dummy)
> {
> if (siginfo) {
> bad_addr = siginfo->si_addr;
> }
> longjmp(env, 1);
> }
...
> --------
>
> When I tried this with a 2.2.14 kernel, the process was just killed
> though, without any chance of fixing things up.

longjmp won't work because it'll be running the program from within the
signal handler. You need to modify the interrupted address so it returns
to a different point in the code. This is horribly ugly and I haven't a
clue how to do it without a few kernel patches.

-- 
John Ripley, empeg Ltd.
http://www.empeg.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:29 EST