The R Project SVN R

Rev

Rev 81150 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
81150 luke 1
% File src/library/base/man/StackOverflows.Rd
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2021 R Core Team
4
% Distributed under GPL 2 or later
5
 
6
\name{StackOverflows}
7
\alias{StackOverflows}
8
\alias{stackOverflowError}
9
\alias{CStackOverflowError}
10
\alias{expressionStackOverflowError}
11
\alias{protectStackOverflowError}
12
\alias{nodeStackOverflowError}
13
\title{Stack Overflow Errors}
14
\description{
15
  Errors signaled by \R when stacks used in evaluation overflow.
16
}
17
\details{
18
 
19
  \R uses several stacks in evaluating expressions: the C stack, the
20
  pointer protection stack, and the node stack used by the byte code
21
  engine. In addition, the number of nested \R expressions currently
22
  under evaluation is limited by the value set as
23
  \code{\link{options}("expressions")}.  Overflowing these stacks or
24
  limits signals an error that inherits from classes
25
  \code{stackOverflowError}, \code{error}, and \code{condition}.
26
 
27
  The specific classes signaled are:
28
 
29
  \itemize{
30
    \item \code{CStackOverflowError}: Signaled when the C stack
31
    overflows. The \code{usage} field of the error object contains the
32
    current stack usage.
33
 
34
    \item \code{protectStackOverflowError}: Signaled when the pointer
35
    protection stack overflows.
36
 
37
    \item \code{nodeStackOverflowError}: Signaled when the node stack
38
    used by the byte code engine overflows.
39
 
40
    \item \code{expressionStackOverflowError}: Signaled when the the
41
    evaluation depth, the number of nested \R expressions currently
42
    under evaluation, exceeds the limit set by
43
    \code{\link{options}("expressions")}
44
  }
45
 
46
  Stack overflow errors can be caught and handled by exiting handlers
87299 smeyer 47
  established with \code{\link{tryCatch}()}. Calling handlers established
81150 luke 48
  by \code{\link{withCallingHandlers}()} may fail since there may not be
49
  enough stack space to run the handler. In this case the next available
50
  exiting handler will be run, or error handling will fall back to the
51
  default handler. Default handlers set by
52
  \code{\link{tryCatch}("error")} may also fail to run in a stack
53
  overflow situation.
54
}
55
 
56
\seealso{
57
  \code{\link{Cstack_info}} for information on the environment and the
58
  evaluation depth limit.
59
 
60
  \code{\link{Memory}} and \code{\link{options}} for information on the
61
  protection stack.
62
}
63
 
64
\keyword{programming}
65
\keyword{error}
66
\keyword{classes}