[ros-diffs] [tkreuzer] 40963: MmGrowKernelStack: Don't assert, but fail, when the kernel stack can't grow any more. Fixes a crash with recursive user calls. See issue #4060 for more details.

Alex Ionescu ionucu at videotron.ca
Mon May 18 08:29:15 CEST 2009


The code SHOULD assert.
This is a hack.

Best regards,
Alex Ionescu


On Sun, May 17, 2009 at 11:51 PM, <tkreuzer at svn.reactos.org> wrote:

> Author: tkreuzer
> Date: Mon May 18 01:51:31 2009
> New Revision: 40963
>
> URL: http://svn.reactos.org/svn/reactos?rev=40963&view=rev
> Log:
> MmGrowKernelStack: Don't assert, but fail, when the kernel stack can't grow
> any more. Fixes a crash with recursive user calls.
> See issue #4060 for more details.
>
> Modified:
>    trunk/reactos/ntoskrnl/mm/procsup.c
>
> Modified: trunk/reactos/ntoskrnl/mm/procsup.c
> URL:
> http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/procsup.c?rev=40963&r1=40962&r2=40963&view=diff
>
> ==============================================================================
> --- trunk/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] (original)
> +++ trunk/reactos/ntoskrnl/mm/procsup.c [iso-8859-1] Mon May 18 01:51:31
> 2009
> @@ -259,8 +259,11 @@
>     PETHREAD Thread = PsGetCurrentThread();
>
>     /* Make sure we have reserved space for our grow */
> -    ASSERT(((PCHAR)Thread->Tcb.StackBase - (PCHAR)Thread->Tcb.StackLimit)
> <=
> -           (KERNEL_LARGE_STACK_SIZE + PAGE_SIZE));
> +    if (((PCHAR)Thread->Tcb.StackBase - (PCHAR)Thread->Tcb.StackLimit) >
> +           (KERNEL_LARGE_STACK_SIZE + PAGE_SIZE))
> +    {
> +        return STATUS_NO_MEMORY;
> +    }
>
>     /*
>      * We'll give you three more pages.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20090518/85433a01/attachment.html 


More information about the Ros-diffs mailing list