|
|
page fault and SIGSEGV
hi,
When a function call is made if the stack frame grows to an address which is
beyond what is currently allocated it leads to a page fault exception. Kernel
while handling this allocates a new page for the stack and maps it in into
the address space of the process. When this kind of page fault exception
occurs does the kernel send a SIGSEV to the process ?(my guess is no because
the default action for SIGSEV is abort of the process).
13.3 in 'Unix Internals' by Uresh Vahalia says..
----
In all such cases (Bounds error, Validation error or Protection error), the
MMU raises an exception and passes control to a handler in the kernel. Such
an exception is called page fault, and the fault handler is passed the
offending virtual address as well as the type of fault (validation or
protection - bounds errors result in a validation fault). The handler may
try to service the fault by bringing the page into memeory or notify the
process by sending it a signal (usually SIGSEGV)
---
Author says 'kernel *may* try to service the fault by brining the page into
memory of send SIGSEV'. I think for cases like an infinite recursion where
the entire stack space is exhausted SIGSEGV will be sent.
What are the cases in which kernel can't bring in the page and resort to
sending a SIGSEGV ? I presume kernel won't do both for a page fault exception.
Other than SIGSEGV what other signal can be generated in this context ?
(Author says 'usually SIGSEGV')
TIA,
Santhosh.
|
|
0
|
|
|
|
Reply
|
salsacts (2)
|
8/10/2004 11:33:04 AM |
|
santhosh wrote:
> hi,
>
> When a function call is made if the stack frame grows to an address which is
> beyond what is currently allocated it leads to a page fault exception. Kernel
> while handling this allocates a new page for the stack and maps it in into
> the address space of the process. When this kind of page fault exception
> occurs does the kernel send a SIGSEV to the process ?(my guess is no because
> the default action for SIGSEV is abort of the process).
If it sucesssfully maps the page, it shouln't affect the process in any way.
> Author says 'kernel *may* try to service the fault by brining the page into
> memory of send SIGSEV'. I think for cases like an infinite recursion where
> the entire stack space is exhausted SIGSEGV will be sent.
> What are the cases in which kernel can't bring in the page and resort to
> sending a SIGSEGV ? I presume kernel won't do both for a page fault exception.
If it e.g. runs out of virtual address space for the stack, or if it's
really
out of physival ram. Some OS's sends SIGTERM,SIGQUIT or similar
as well, if it kills the process cause out of memory scenarioes.
|
|
0
|
|
|
|
Reply
|
ISO
|
8/10/2004 11:52:43 AM
|
|
In article <5a1b8709.0408100333.51cb0211@posting.google.com>,
salsacts@yahoo.com (santhosh) wrote:
> hi,
>
> When a function call is made if the stack frame grows to an address which is
> beyond what is currently allocated it leads to a page fault exception. Kernel
> while handling this allocates a new page for the stack and maps it in into
> the address space of the process. When this kind of page fault exception
> occurs does the kernel send a SIGSEV to the process ?(my guess is no because
> the default action for SIGSEV is abort of the process).
>
> 13.3 in 'Unix Internals' by Uresh Vahalia says..
> ----
> In all such cases (Bounds error, Validation error or Protection error), the
> MMU raises an exception and passes control to a handler in the kernel. Such
> an exception is called page fault, and the fault handler is passed the
> offending virtual address as well as the type of fault (validation or
> protection - bounds errors result in a validation fault). The handler may
> try to service the fault by bringing the page into memeory or notify the
> process by sending it a signal (usually SIGSEGV)
> ---
>
> Author says 'kernel *may* try to service the fault by brining the page into
> memory of send SIGSEV'. I think for cases like an infinite recursion where
> the entire stack space is exhausted SIGSEGV will be sent.
>
> What are the cases in which kernel can't bring in the page and resort to
> sending a SIGSEGV ? I presume kernel won't do both for a page fault exception.
It depends on whether the address you're trying to access is available
to the process. If you're accessing an address that's in your virtual
address space but currently paged out, it will simply page it in
transparently. If you're growing the stack, it will also be handled
automatically. But if you dereference an invalid pointer, it will often
point to memory that's not yet assigned to the process, and a SIGSEGV
will be raised.
> Other than SIGSEGV what other signal can be generated in this context ?
> (Author says 'usually SIGSEGV')
If the system runs out of swap space so it can't grow the process, it
could be killed with something like SIGTERM.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
|
|
0
|
|
|
|
Reply
|
Barry
|
8/10/2004 12:21:35 PM
|
|
|
2 Replies
254 Views
(page loaded in 0.04 seconds)
Similiar Articles: segmentation fault (SIGSEGV) - comp.lang.fortranSolaris SIGSEGV signal handlers - comp.unix.programmer segmentation fault (SIGSEGV) - comp.lang.fortran Solaris SIGSEGV signal handlers - comp.unix.programmer page fault ... Solaris SIGSEGV signal handlers - comp.unix.programmer... Solaris SIGSEGV signal handlers - comp.unix.programmer segmentation fault (SIGSEGV) - comp.lang.fortran Solaris SIGSEGV signal handlers - comp.unix.programmer page fault ... ored bus -- Fatal: (SIGSEGV) Bad handle or reference. - comp.lang ...System handle - comp.sys.hp.hpux ored bus -- Fatal: (SIGSEGV) Bad handle or reference. - comp.lang ... Page fault - Homepage | Reference.com The operating system ... can't declare .double in gas and SIGSEGV (x86_64) - comp.lang.asm ...Wolfnoliir wrote: ..... > When I run acosSSE, I get a SIGSEGV (gdb output): > Program received signal SIGSEGV, Segmentation fault. > asm_acos at asmacos.s:27 ... May be slightly OT: Apache on Solaris Segmentation Fault - comp ...Making a depot compatible with Apache 2.0 and 2.2 - comp.sys.hp ... segmentation fault (SIGSEGV) - comp.lang.fortran My OS is openSUSE 11 ... came up with some rule to ... What is lwp_park w/ ETIME error and ... - comp.unix.solaris ...When I run truss -c -p process, I have the following: faults ... process, I have the following: > > These two are related: you got 246 SIGSEGV each ... error code 53 when compiling - comp.soft-sys.matlabsegmentation fault (SIGSEGV) - comp.lang.fortran After compiling the whole codes without no errors ... On 6/1/2010 8:53 AM, Benjamin wrote: > > After compiling the whole ... comp.sys.hp.hpux - page 24This is page 24 of the comp.sys.hp.hpux group which contains 4415 articles. ... SIGSEGV error on execve system call 1 12 (9/8/2003 9:43:33 AM) I write a code with ... The file just loaded does not appear to be executable - comp.unix ...comp.sys.sun.admin - page 23 I just can't get it to mount.. Thanks, Ron Hager ... ***** It seems that when that error occurs, something happens to the disk. I am completely ... comp.unix.programmer - page 20This is page 20 of the comp.unix.programmer group which ... 8/1/2003 3:50:04 AM) Hi, Want to catch SIGSEGV in a ... deleting a record using dbp->del command, I get a error ... GNU libsigsegv - Handling page faults in user modeGNU libsigsegv - Handling page faults in user mode. What is libsigsegv? Installation; Copyright notice; Download; Developers; What is libsigsegv? This is a library ... SIGSEGV - Wikipedia, the free encyclopediaOn POSIX -compliant platforms, SIGSEGV is the signal sent to a process when it makes an invalid memory reference, or segmentation fault. The symbolic constant for ... 7/22/2012 1:34:49 AM
|
|
|
|
|
|
|
|
|