Date: Thu, 15 Apr 1999 14:22:56 -0400 (EDT) From: Mikhail Teterin <mi@misha.cisco.com> To: mike@smith.net.au (Mike Smith) Cc: current@freebsd.org Subject: Re: swap-related problems Message-ID: <199904151822.OAA98506@misha.cisco.com> In-Reply-To: <199904151743.KAA02998@dingo.cdrom.com> from Mike Smith at "Apr 15, 1999 10:43:55 am"
next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904151822.OAA98506>
