    if (!sched_verifytcb(htcb))
      {
        serr("ERROR: TCB 0x%08x is a stale handle, counts lost\n", htcb);
-+      DEBUGASSERT(!sched_verifytcb(htcb));
++      DEBUGASSERT(sched_verifytcb(htcb));
        sem_freeholder(sem, pholder);
      }
  

 #endif
       return OK;
diff --git NuttX/nuttx/sched/semaphore/sem_holder.c NuttX/nuttx/sched/semaphore/sem_holder.c
index 6b9f05a..bc5c186 100644
--- NuttX/nuttx/sched/semaphore/sem_holder.c
+++ NuttX/nuttx/sched/semaphore/sem_holder.c
@@ -93,7 +93,7 @@ static inline FAR struct semholder_s *sem_allocholder(sem_t *sem)

+  int i;
+  pholder = NULL;
+
+  /* We have two hard-allocated holder structures in sem_t */
+
+  for (i = 0; i < 2; i++)
     {
