Re: SIGSEGV handler Question
- From: Joe Pfeiffer <pfeiffer@xxxxxxxxxxx>
- Date: 01 Sep 2006 08:00:06 -0600
"LaBird" <bowlcheflung@xxxxxxxxx> writes:
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.
I don't see how it could be done in any real useful sense -- in order
to avoid crippling performance delays, you'd have to change not just the
one memory reference, but also the code that generated the memory
reference, and any other code that wound up calculating the same
address in any way whatever (the last of which isn't even
theoretically possible).
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer
.
- Prev by Date: Creation of a Software Installation Package which can be installed on all Linux Distributions
- Next by Date: Re: SIGSEGV handler Question
- Previous by thread: Re: SIGSEGV handler Question
- Next by thread: Re: split a /path/filename into components
- Index(es):
Relevant Pages
|