ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
if a pointer is initialized with an address which actually falls after the last address in the logical memory , that we call as an invalid address or illegal address.
and whats the difference between the two?
Hmm
i guess what you are referring is that you have an address not belonging to the Virtual address space of your process.
I guess they both refer to the same thing.
i m not pretty much sure whether they r same or not!
When u have an address which actually doesn't exists at all,
(may be b'coz u r addressing an address out of the range of
physical memory, any absurd address) Will that cause a page
fault or an ILLEGAL address error?
i m talking about the case when the mapping of this virtual address may lead u to any astronomical ! non existent address
i.e out of the rang of our whole computer memory,
which is, of course, not present at all .Isn't that address ILLEGAL.
but an invalid address is simply what u find as its entry in the page table marked as INVALID. i.e 'I'. meaning u r not authorized to access that page or simply the page needs to be mapped and swapped in.
I guess you are talking from an Application level.
So when you access a address you basically provide the virtual address.
say you are trying to read from a virtual address. now when the processor sees this it will try to find out the physical address from this virtual address. It does this basically by reading from the page table entries. if the translation cannot be found then it will cause a page fault. The kernel will find out the application which causes the same and deliver a signal (SIGSEGV)
In windows environment I think this is called illegal address fault or something like that.
Now you were asking about what if the translation was not proper ie the physical address we get from the translation is not correct and does not lie in a valid physical memory range.
The kernel is the guy who sets up the translation and if this happens then it means something is terribily wrong with the kernel.
how the cases are handled , when they occur, by each architecture is dependent on the architecture. Some archs have a special exception condition raised and delivered to the processor (for ex MCA on Itanium).
The invalid bit for page table just says that the translation is invalid. Thats all.
ur answer was well understood , thanx for the details.
what i exactly intended to know was something related to vxWorks, as it gives u an error related to illegal address, specifically.And if u access any invalid address then it may issue a page fault, thus distinguishing the two cases.
Well, it could be that , its applying its own terminology!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.