Invoking mutex_enter()


Looking at the PC , we saw that the failing instruction is at location mutex_enter +0x4 . So, we had just entered the mutex_enter() routine.

mutex_enter() is invoked whenever a mutex ( mutually exclusive) lock is needed. The mutex locks protect data structures from being used by more than one thread at a time. (Of course, this only works if everyone agrees to use the locking mechanism and to follow the rules that go with it.)

Whenever mutex_enter() is invoked, it is called with a pointer to a mutex structure. Once in mutex_enter() , the mutex is tested to see if it is already in use. If it is not, the requesting thread gets the mutex and the address of the thread (aka "the owner") is stored in the mutex structure. There's a good explanation of this in /usr/include/sys/mutex.h , should you want to learn more.

In this crash, we see that mutex_enter() was called with an incoming parameter of zero. This null pointer is obviously incorrect, as a valid memory address was expected.

So, we've found the reason that the system panic'ed ” illegal access to page zero caused by a null pointer argument in the call to mutex_enter() . Now we need to find out why this happened in the first place.



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net