Hello,
I understand that having an error ==0 when having a page fault exception, when in kernel space, is not a dangerous thing.
http://wiki.osdev.org/Exceptions#Page_Fault
The cpu just means : "hey OS, map that address for me and we are done; nothing dangerous happened."
This situation seems pretty clear but I have no one else to ask/confirm but you.
Am I right ? Did I overlook something ?
Thanks
Trap -> page fault but error code == 0 ?
-
- Member
- Posts: 97
- Joined: Tue Mar 10, 2015 10:08 am
Trap -> page fault but error code == 0 ?
Last edited by JulienDarc on Mon Apr 06, 2015 3:27 am, edited 1 time in total.
Re: Trap -> page fault but error code == 0 ?
That's right. A page fault by reading from unmapped memory.
-
- Member
- Posts: 97
- Joined: Tue Mar 10, 2015 10:08 am
Re: Trap -> page fault but error code == 0 ?
Thanks Roflo
Re: Trap -> page fault but error code == 0 ?
It's not necessarily a dangerous thing as long as you handle it. In other words, just the same as any other page fault.
But normally, although it obviously depends upon the design of your kernel, any page fault in kernel space is a sign that something unexpected has happened.
But normally, although it obviously depends upon the design of your kernel, any page fault in kernel space is a sign that something unexpected has happened.
-
- Member
- Posts: 97
- Joined: Tue Mar 10, 2015 10:08 am
Re: Trap -> page fault but error code == 0 ?
Yes thanks a lot iansjack,
i am currently writing the routine to handle that.
Now that it is clear that there is nothing potentially malicious, i feel safer
OS development is a very rewarding process, that is amazing.
It helps improving the code on the application side. Should have started it earlier !
But I digress now,
Bye
Julien
i am currently writing the routine to handle that.
Now that it is clear that there is nothing potentially malicious, i feel safer
OS development is a very rewarding process, that is amazing.
It helps improving the code on the application side. Should have started it earlier !
But I digress now,
Bye
Julien
- xenos
- Member
- Posts: 1121
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: Trap -> page fault but error code == 0 ?
I would say if it is unexpected, then it is also potentially dangerous, because it shows there must be a bug in your code which causes this unexpected behavior. It's quite possible that this bug will do no harm, but it may just as well crash your kernel - in any case, your kernel will not do what you expect, so you should in any case be alerted and figure out the reason for the page fault.
But if you expect a page fault, because you design your kernel in such a way that you map pages on demand, and this demand is indicated by a page fault, then of course it is not dangerous.
But if you expect a page fault, because you design your kernel in such a way that you map pages on demand, and this demand is indicated by a page fault, then of course it is not dangerous.