Re: Tlb Load Exception!



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.
.



Relevant Pages

  • Re: Tlb Load Exception!
    ... Exception and reboot because of that exception. ... architecture and doing an access there always causes a trap. ... 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 ...
    (comp.os.vxworks)
  • Re: Tlb Load Exception!
    ... Exception and reboot because of that exception. ... architecture and doing an access there always causes a trap. ... 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 ...
    (comp.os.vxworks)
  • Re: Tlb Load Exception!
    ... Though the NULL pointer access is invalid; ... Exception and reboot because of that exception. ... Is there any way to fix / handle this in MIPS? ... architecture and doing an access there always causes a trap. ...
    (comp.os.vxworks)
  • Tlb Load Exception!
    ... But the Tornado221 PPC doesn't have this problem; ... Though the NULL pointer access is invalid; ... Exception and reboot because of that exception. ... Is there any way to fix / handle this in MIPS? ...
    (comp.os.vxworks)
  • Re: Proper Error Handling of SQL Connection opening
    ... I've read (and I'm a .NET book junkie) has to be Jeffrey Richter's Applied ... Exception handling is and how to employ it. ... Don't trap exceptions just to trap them. ...
    (microsoft.public.dotnet.framework.compactframework)