segmentation fault when cpu is 100%

John Heryer jheryer at violet.jayhawks.net
Sun Sep 23 22:55:37 CDT 2001


> I'm running a multi threaded application.
> In a specific action of the application the cpu reaches 100% kernel mode
> and the application crashes with segmentation fault.
> I've run it on 3 deferent computers and got 3 slightly deferent behaviors.
> On the first the segmentation fault occurred mainly on memory de-allocation.

Make sure that a thread is not using the memory before you deallocate.
Make sure that your threads have halted execution before your main thread
dies off.

To be honest, this could be a number of things gone very wrong due to
poor synchronization in your threaded application. A common problem
that I have stubbed my toe on is the "deadlock". These happen when thread1
has a lock on resource A and can not continue execution until it has
resource B. While thread2 has a lock on resource B and can not continue
until it has resource A. I hope that made sense and may be the reason
behind the CPU spike. I do not know if this is applicable to your problem,
but maybe it will give you a start on finding a solution.

-- 
John Heryer
jheryer at jayhawks.net




More information about the Kclug mailing list