R: Stack Overflow Errors (original) (raw)
StackOverflows {base} | R Documentation |
---|
Description
Errors signaled by R when stacks used in evaluation overflow.
Details
R uses several stacks in evaluating expressions: the C stack, the pointer protection stack, and the node stack used by the byte code engine. In addition, the number of nested R expressions currently under evaluation is limited by the value set as[options](../../base/help/options.html)("expressions")
. Overflowing these stacks or limits signals an error that inherits from classesstackOverflowError
, error
, and condition
.
The specific classes signaled are:
CStackOverflowError
: Signaled when the C stack overflows. Theusage
field of the error object contains the current stack usage.protectStackOverflowError
: Signaled when the pointer protection stack overflows.nodeStackOverflowError
: Signaled when the node stack used by the byte code engine overflows.expressionStackOverflowError
: Signaled when the the evaluation depth, the number of nested R expressions currently under evaluation, exceeds the limit set by[options](../../base/help/options.html)("expressions")
Stack overflow errors can be caught and handled by exiting handlers established with [tryCatch](../../base/help/tryCatch.html)()
. Calling handlers established by [withCallingHandlers](../../base/help/withCallingHandlers.html)()
may fail since there may not be enough stack space to run the handler. In this case the next available exiting handler will be run, or error handling will fall back to the default handler. Default handlers set by[tryCatch](../../base/help/tryCatch.html)("error")
may also fail to run in a stack overflow situation.
See Also
[Cstack_info](../../base/help/Cstack%5Finfo.html)
for information on the environment and the evaluation depth limit.
[Memory](../../base/help/Memory.html)
and [options](../../base/help/options.html)
for information on the protection stack.
[Package _base_ version 4.6.0 Index]