- Fix a serious bug in Kernel Queues. A condition existed where an inserted kernel queue with a timeout would crash the system once the thread waiting on it had its wait aborted or completed.

- Thanks a lot to Thomas for his brutal test application which allowed me to discover this bug and the bugs addressed in the previous commits (related to the wait list and thread scheduler list corruption).

svn path=/trunk/; revision=23057
This commit is contained in:
Alex Ionescu 2006-07-14 02:26:44 +00:00
parent 1f1857f96d
commit 514aa8290f
3 changed files with 14 additions and 6 deletions

View file

@ -764,7 +764,7 @@ KeInitializeThread(PKPROCESS Process,
/* Initialize the Suspend Semaphore */
KeInitializeSemaphore(&Thread->SuspendSemaphore, 0, 128);
/* FIXME OPTIMIZATION OF DOOM. DO NOT ENABLE FIXME */
/* Setup the timer */
Timer = &Thread->Timer;
KeInitializeTimer(Timer);
TimerWaitBlock = &Thread->WaitBlock[TIMER_WAIT_BLOCK];

View file

@ -390,6 +390,10 @@ KeRemoveQueue(IN PKQUEUE Queue,
&WaitBlock->WaitListEntry;
Timer->Header.WaitListHead.Blink =
&WaitBlock->WaitListEntry;
WaitBlock->WaitListEntry.Flink =
&Timer->Header.WaitListHead;
WaitBlock->WaitListEntry.Blink =
&Timer->Header.WaitListHead;
/* Create Timer */
KiInsertTimer(Timer, *Timeout);
@ -427,8 +431,8 @@ KeRemoveQueue(IN PKQUEUE Queue,
/* Check if we had a timeout */
if (Timeout)
{
/* FIXME: Fixup interval */
DPRINT1("FIXME!!!\n");
DPRINT1("If you see this message, contact Alex ASAP\n");
KEBUGCHECK(0);
}
}

View file

@ -360,7 +360,9 @@ KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode,
return WaitStatus;
}
/* FIXME: Fixup interval */
/* Check if we had a timeout */
DPRINT1("If you see this message, contact Alex ASAP\n");
KEBUGCHECK(0);
}
/* Acquire again the lock */
@ -533,7 +535,8 @@ KeWaitForSingleObject(PVOID Object,
/* Check if we had a timeout */
if (Timeout)
{
/* FIXME: Fixup interval */
DPRINT1("If you see this message, contact Alex ASAP\n");
KEBUGCHECK(0);
}
}
@ -813,7 +816,8 @@ KeWaitForMultipleObjects(IN ULONG Count,
/* Check if we had a timeout */
if (Timeout)
{
/* FIXME: Fixup interval */
DPRINT1("If you see this message, contact Alex ASAP\n");
KEBUGCHECK(0);
}
/* Acquire again the lock */