Tomáš Ebenlendr wrote:
>> Error stack is statically allocated and it is protected so that it
>> cannot overflow. Error stack is defined as being static to file
>> kern/err.c so there is no direct access possible to error stack.
>>
>> Error stack is emptied in grub_print_error function. (And this is called
>> before prompt is printed to screen)
>>
>> Idea of the error stack is to record all error messages before they are
>> printed.
>>
>> Or did I miss your idea with the "unwanted stack overflow" ?
> 
> Okay. There is only minor issue then, that some loop over same
> error pushing function may fill up the stack. But it is not problem
> if first error (in the stack) and last error (in grub_errno) is printed
> (at prompt time).

Yes it is possible that some part might fill up the stack, that's way
there is a protection. When error is printed, whole stack will be dumped
to screen. So all error stack entries containing error code other than
GRUB_ERR_NONE will get displayed.

My idea is not to use this error stacking feature in all the place. Only
in places where there is a need to have a clean error state (grub_errno
== GRUB_ERR_NONE). This is because if grub_errno is being set, some
functions are required to fail.


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to