[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hurd_thread_cancel cancelling other threads

From: Samuel Thibault
Subject: hurd_thread_cancel cancelling other threads
Date: Sun, 27 Sep 2009 14:53:10 +0200
User-agent: Mutt/1.5.12-2006-07-14


ext2fs quite often aborts with

ext2fs.static: thread-cancel.c:55: hurd_thread_cancel: Assertion `! 
__spin_lock_locked (&ss->critical_section_lock)' failed.

Here is the relevant code:

error_t hurd_thread_cancel (thread_t thread) {
  struct hurd_sigstate *ss = _hurd_thread_sigstate (thread);
  if (! ss)
      return EINVAL;
  if (ss == _hurd_self_sigstate ())
      return 0;

/* line 55: */
  assert (! __spin_lock_locked (&ss->critical_section_lock));
  __spin_lock (&ss->critical_section_lock);

I.e. here ss is not NULL and not the current thread's sigstate, but the
sigstate of another thread.  Is the assertion really correct?  To my
understanding, the other thread could have been preempted by Mach in the
middle of a critical section, and in that case the spinlock is indeed
not available and the current thread should indeed spin-lock it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]