AnsweredAssumed Answered

Exception in VDK_ReleaseMutex: EXCAUSE=2E (Illegal use of supervisor resource)

Question asked by mastermind3001 on Feb 10, 2012
Latest reply on Feb 14, 2012 by PrasanthR

Without trying to dive into many details about what's going on in our system, what use cases can cause the exception named in the title when trying to release a mutex? EXCAUSE=2E ("Illegal use of supervisor resource").

 

This happens when a thread wakes up from sleeping and goes to print something using printf(), which we redirect to a UART. The relevant stack trace shown in the stack trace window is:

 

<__KernelPanic>

<_adi_rtl_release_mutex + 0x20>

<_printf + 0x4a>

 

And something else that the stack trace doesn't show, but that can be gleaned from the assembly, the Sequencer register RETX, and the source code, is that _adi_rtl_release_mutex calls VDK_ReleaseMutex(), and the exception happens in there. Also, the RETS register takes me to the system "sti" function, so I believe that sti was called, woke up the thread that causes that problem (because its timer expired during the execution of that cli/sti block), that thread tried to print something (it prints debug statements once a second), and crashed.

 

To fill in the last part of the stack using some arithmetic:

 

<__KernelPanic>

<ReleaseMutex__3VDKF7MutexID + 0x74> (RETX = 0xFFA04D98, function is at 0xFFA04D24)

<_adi_rtl_release_mutex + 0x20>

<_printf + 0x4a>

 

There is a lot going on at this point (several thousand Ethernet packets per second and other processing).

 

The offending instruction is "R1 = [ P1 - 0x4 ] ;" and P1 = 0x00000000. Please provide me with any information on how I may continue to debug this.

 

Thank you.

Outcomes