[VxW] Re: GPF, stack problems?

wiktor wiktorn at poczta.fm
Tue Apr 22 15:19:23 PDT 2003


> Hello,
>
> > I get exception in this line:
> >     if ( true ==  state().handleEvent( *this, *a_event )  )
>
>
> > I get:
> >
> > Exception number 0: Task: 0x4ad0780 (CTelephone)
> >
> > General Protection Fault
> > Program Counter:            0x00000008
> > Status Register:            0x00010216
>
> OK, so it seems that the code tried to jump through a null pointer,
> either state() or handleEvent() since those are the two functions. Try
> attaching the debugger or checking the stack trace with the tt command
> from the shell. That should tell you which one of the two, assuming
> the stack has not been killed.

tt returns: WTX Error 0x100ca (AGENT_MEM_ACCESS_ERROR)
It looks like stack was corrupted. (right?)



> And that leads to another possibility... have you checked if you have
> overflowed a stack? Use the checkStack() function from the shell
> prompt just after the crash happens to see whether you have overflowed
> a stack.

checkStack shows that stack hasn't been overflowed :
CTelephone   processTask(  4acf0e8 27984   288  2072  25912
CTelephone   processTask(  4ac7e50 27984   256  2072  25912   <- this
process fails

> It is very much architecture dependent. MIPS systems, and perhaps the
> simulators since they are running under an OS that does check for NULL
> pointer accesses, might. PowerPC, ARM and I believe x86 targets will
> not generate an exception for a null pointer dereference. You didn't
> say which system you were using when you tried it.

I use VxSim on WindowsNT.
So I get GPF on NULL pointer dereference.

Btw.
Parameters passed to the function in line:
    if ( true ==  state().handleEvent( *this, *a_event )  )
are not NULLs.
It looks like state() or handleEvent() is NULL.
How to check which one...?
How to find out why it is...?

Regards

Wojtek




>
> HTH,
> John...
>
> =====
> Contribute to the VxWorks Cookbook at
> http://www.bluedonkey.org/cgi-bin/twiki/bin/view/Books/WebHome




More information about the VxWexplo mailing list