#81 shutdown crash

closed-fixed
nobody
None
5
2006-08-13
2006-05-28
Pav Lucistnik
No

Sometimes, etherape crashes when exiting. My
understanding is that mutex condition is destroyed from
thread 1 while pthread_cond_wait() is still executing
on thread 2. My fix is to move close_mutex() call from
thread_close() to the end of thread_pool_routine().
That way, the condition variable can not go away while
pthread library is using it. Patch attached.

I hope I haven't misunderstood pthreads, I'm really a
newbie in this area.

Discussion

  • Pav Lucistnik
    Pav Lucistnik
    2006-05-28

    fix shutdown crash

     
  • R. Ghetta
    R. Ghetta
    2006-08-13

    Logged In: YES
    user_id=611026

    Unfortunately I can't apply this patch, because it suffers from the same problem it tries to avoid.
    At the end of the thread routine the mutex is unlocked, so another thread could have grabbed it and be waiting on it.
    Anyway, I've redone the termination code to using cancellations, so it should be fine now.
    Can you try it to see if works ?

     
  • R. Ghetta
    R. Ghetta
    2006-08-13

    • status: open --> closed-fixed