Mike Smith once wrote: > > >A signal handler is not guaranteed to work. It must be written > > >such that it does not require a new page of memory. Some possible > > >problems here are the stack growing, writing on a new page in the > > >data segment, etc. > > > > man sigaltstack > That doesn't help; there is no guarantee that your stack or your > alternate stack have been mapped.
Can I ensure the room availability for the signal handler by explicitly calling it once, _before_ doing the dangerous operation of touching every page of the freshly allocated memory? The thing itself (in the case of earlier described `safe malloc') will only change a value of a static variable and return, indicating to the malloc it should: . stop the touching . give the memory back to system . return NULL to the caller. This assumes, of course, that it is the process doing the malloc that is sent the signal, AND, that the signal is catchable. The kernel can try to remember the processes the signal went to, and send it a SIGKILL if it happens again withing a certain time -- to avoid the deadlock. Pretty horrible? Feasible? -mi To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-current" in the body of the message