This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Determining if an address is valid prior to using it.
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: jimmie dot davis at l-3com dot com
- Cc: libc-help at sourceware dot org
- Date: Wed, 6 Aug 2008 23:40:55 -0400
- Subject: Re: Determining if an address is valid prior to using it.
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=DoPiR1MK+2hpTanRqzWNNk2ororVYZTv8C9FcEy0V6U=; b=CHVce3uvwPwiM0pttPsYzwszL5xjXnGixGwBoAz3yIFcTer1cuooD/w59gAEdbddwp cdf2O1L4uzam91LJxT6pEuvlQKRxmE9Nrgwslgzl+7vYs0SwvYKzpoV6B5dDtr158w7q BkaT+kr/+bIuX5sZWLFVhqPwGAVWP8xhz6fX8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=NA/xYVT4BRpoN3MnMJ6ZcheBq99CzEthzDHDaKvz3cl6L8qbtpRuj3Y+5p7IG3SQcX /TcP8Q9vRFClNBIt1YoxaYnWrodnmaJvLtVE8yNXvUDEs+plgjoPLVsNlncfuBz8iS7/ B95SQcbiMJS1ajre56xFmKlcnDMTc9jqRgZyI=
- References: <46835D054D115449BBE84934E2F2000901E54827@ARLEXCHVS02.lst.link.l-3com.com>
On Wed, Jul 23, 2008 at 4:06 PM, <jimmie.davis@l-3com.com> wrote:
> Given an arbitrary address, is it possible to test and see if it is in
> the process's address space ?
>
> My current technique is to create a new thread, then access the memory
> from that thread. Then if it did not segfault i know the address was
> valid.
>
> Is there a better way to do this ?
Portably? No.
Unportable? Yes. Use ptrace and PTRACE_PEEK?
Cheers,
Carlos.