Re: SIGSEGV handler Question
- From: "LaBird" <bowlcheflung@xxxxxxxxx>
- Date: Fri, 1 Sep 2006 00:28:25 +0800
Hi,
<gil_hamilton@xxxxxxxxxxx>
???????:1157032545.274513.144910@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LaBird wrote:
I'd like to ask if it is possible to write a signal handler to capture
SIGSEGV, and handles the fault by changing the virtual address the
program
is accessing instead? For example, if a read to VM address 0x12340000
causes
a SIGSEGV, instead of changing the memory protection of 0x12340000 to
readable or perform a memory mapping on this address inside the signal
handler, is it possible to change the VM address to be accessed to, say
0x56780000 inside the handler (assume 0x56780000 is mapped and is
readable)?
It's possible - barely - but it's a really bad idea and would be
fiendishly hard to implement (especially with any significant
generality). What exactly are you trying to accomplish?
Actually it's one of the ways I think of about the implementation of a
Distributed Shared Memory (DSM)... the 0x12340000 will be the original
(fixed) position of a shared object, and 0x56780000 is the (temporary)
address of a local copy of that object.
Best Regards,
LaBird (Benny).
GH
.
- References:
- SIGSEGV handler Question
- From: LaBird
- Re: SIGSEGV handler Question
- From: gil_hamilton@xxxxxxxxxxx
- SIGSEGV handler Question
- Prev by Date: Re: SMTP library??
- Next by Date: Re: linux programming
- Previous by thread: Re: SIGSEGV handler Question
- Next by thread: problem on /proc/self/exe and /proc/num/exe
- Index(es):
Relevant Pages
|