Re: check if memory is accessible
- From: kcool <karan.rath@xxxxxxxxx>
- Date: Thu, 27 Dec 2007 00:17:15 -0800 (PST)
On Dec 27, 12:06 pm, rakesh uv <uvrak...@xxxxxxxxx> wrote:
On Dec 27, 5:14 am, phil-news-nos...@xxxxxxxx wrote:
On Wed, 26 Dec 2007 02:11:08 -0800 (PST) rakesh uv <uvrak...@xxxxxxxxx> wrote:
| On Dec 24, 11:08 pm, Mike <michael.h.william...@xxxxxxxxx> wrote:
|> On Dec 24, 4:23 am, rakesh uv <uvrak...@xxxxxxxxx> wrote:
|>
|> > Hi,
|> > Does there exist an assembly instruction to check if a
|> > particular memory is accessible
|>
|> > Best Regards,
|> > Rakesh UV
|>
|> I do not understand the question. Can you re-phrase it?
|>
|> -Mike
|
| since every process has its own address space and it would be killed
| if it tries to access some one else or read only address space.
| i was thinking of a method which would help me in finding that whether
| an address is accessible or not before actually reading /writing
If it is a method, rather than a CPU instruction, you seek, then open and
read the file "/proc/self/maps" and see if the address of interest is in
that list or not.
--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2007-12-26-1...@xxxxxxxx |
|------------------------------------/-------------------------------------|
i know a method named access_ok defined in asm/uaccess.h which is used
by kernel modules
and there exist a assembly instruction named PROBER in VAX.
i would like to give an simple example
stringcopy(str1 , str2)
suppose str1 or str2 are result of some functions,not in my control
and if before passing it to stringcopy if i am able check the
validity of address, i would be able to provide some alternative str1
and str2(some valid strings).
i was debugging my application with gdb (it was getting a segmention
fault ) , since i was using GDB, i was able to control the flow and i
was able to know that the address was invalid, prior to calling
stringcopy, just by using the command
print str1
gdb informed me that the address is not accessible.
I wished that if i was able to find it by myself as done by
gdb............. and this triggered me to put this question!!
Thank you
Rakesh UV- Hide quoted text -
- Show quoted text -
An invalid address? Does GDB show that the address contained in str1
is NULL or something? Or do you have an actual address which in turn
contains garbage?
I dont think there's any address which is not accessible unless it
points to NULL in which case, a "print str1" statement would thow an
exception. Please clarify.
.
- Follow-Ups:
- Re: check if memory is accessible
- From: rakesh uv
- Re: check if memory is accessible
- References:
- check if memory is accessible
- From: rakesh uv
- Re: check if memory is accessible
- From: Mike
- Re: check if memory is accessible
- From: rakesh uv
- Re: check if memory is accessible
- From: phil-news-nospam
- Re: check if memory is accessible
- From: rakesh uv
- check if memory is accessible
- Prev by Date: Re: check if memory is accessible
- Next by Date: Looking for jukebox software
- Previous by thread: Re: check if memory is accessible
- Next by thread: Re: check if memory is accessible
- Index(es):
Relevant Pages
|
|