Rev 81150 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/StackOverflows.Rd% Part of the R package, https://www.R-project.org% Copyright 1995-2021 R Core Team% Distributed under GPL 2 or later\name{StackOverflows}\alias{StackOverflows}\alias{stackOverflowError}\alias{CStackOverflowError}\alias{expressionStackOverflowError}\alias{protectStackOverflowError}\alias{nodeStackOverflowError}\title{Stack Overflow Errors}\description{Errors signaled by \R when stacks used in evaluation overflow.}\details{\R uses several stacks in evaluating expressions: the C stack, thepointer protection stack, and the node stack used by the byte codeengine. In addition, the number of nested \R expressions currentlyunder evaluation is limited by the value set as\code{\link{options}("expressions")}. Overflowing these stacks orlimits signals an error that inherits from classes\code{stackOverflowError}, \code{error}, and \code{condition}.The specific classes signaled are:\itemize{\item \code{CStackOverflowError}: Signaled when the C stackoverflows. The \code{usage} field of the error object contains thecurrent stack usage.\item \code{protectStackOverflowError}: Signaled when the pointerprotection stack overflows.\item \code{nodeStackOverflowError}: Signaled when the node stackused by the byte code engine overflows.\item \code{expressionStackOverflowError}: Signaled when the theevaluation depth, the number of nested \R expressions currentlyunder evaluation, exceeds the limit set by\code{\link{options}("expressions")}}Stack overflow errors can be caught and handled by exiting handlersestablished with \code{\link{tryCatch}()} Calling handlers establishedby \code{\link{withCallingHandlers}()} may fail since there may not beenough stack space to run the handler. In this case the next availableexiting handler will be run, or error handling will fall back to thedefault handler. Default handlers set by\code{\link{tryCatch}("error")} may also fail to run in a stackoverflow situation.}\seealso{\code{\link{Cstack_info}} for information on the environment and theevaluation depth limit.\code{\link{Memory}} and \code{\link{options}} for information on theprotection stack.}\keyword{programming}\keyword{error}\keyword{classes}