Re: Tlb Load Exception!
- From: RamSen <ramsenthil@xxxxxxxxx>
- Date: Thu, 25 Sep 2008 00:57:21 -0700 (PDT)
On Sep 24, 10:06 pm, noiset...@xxxxxxxxx wrote:
On Sep 24, 12:50 am, RamSen <ramsent...@xxxxxxxxx> wrote:
Gurus,
We are using Tornado212 MIPS, vxWorks 5.4.2. The TLB Load
exception is happening while accessing NULL pointer ie *(0x0) or
strcmp (0,""). But the Tornado221 PPC doesn't have this problem; it is
simply returning zero.
Though the NULL pointer access is invalid; I want to stop the
Exception and reboot because of that exception.
Is there any way to fix / handle this in MIPS?
Thanks & Regards,
Ramsenthil.
It's my understanding that page 0 is never mapped on the MIPS
architecture and doing an access there always causes a trap. I think
on PPC, the exception vector table lives in page 0, so it is mapped.
However this does not mean that a NULL pointer dereference is not a
bug on PPC: it just means that instead of an explicit trap, you get
silent data corruption. The MIPS case is actually preferable since it
exposes the problem immediately.
In any case, the correct thing to do is _not_ to ignore the trap.
There is no legitimate reason to have such invalid pointer use in your
code: it is a sign of a bug, and you need to fix it instead of
sweeping it under the rug. The trap generated on MIPS is actually
useful for debugging exactly this sort of problem (the exception info
should include the program counter value of the instruction that
triggered the trap).
-Bill
Thanks Bill! I do understand, NULL pointer dereference is illegal. We
are doing porting from PPC to MIPS. We are facing lot of exceptions
due to poor coding. We almost corrected everthing. For saferside, the
client wants to have the support for NULL access...
Is there any way to map Page 0 in MIPS? Or atleast some other dummy
mapping for address 0x0?
Where could we find these mapping in VxWorks 5.4.2?
Thanks & Regards,
Ramsenthil.
.
- Follow-Ups:
- Re: Tlb Load Exception!
- From: noisetube
- Re: Tlb Load Exception!
- References:
- Tlb Load Exception!
- From: RamSen
- Re: Tlb Load Exception!
- From: noisetube
- Tlb Load Exception!
- Prev by Date: Re: vxWorks "Exception at interrupt level" problem
- Next by Date: Re: "shared memory" sample code on VxWorks
- Previous by thread: Re: Tlb Load Exception!
- Next by thread: Re: Tlb Load Exception!
- Index(es):
Relevant Pages
|