R Under development (unstable) (2021-02-22 r80031) -- "Unsuffered Consequences" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "polynomial" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('polynomial') Loading required package: essentials Attaching package: ‘polynomial’ The following object is masked from ‘package:graphics’: lcm > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("CommonPolynomials") > ### * CommonPolynomials > > flush(stderr()); flush(stdout()) > > ### Name: CommonPolynomials > ### Title: Common Polynomials > ### Aliases: CommonPolynomials Abel Bessel rBessel Chebyshev Chebyshev1 > ### Chebyshev2 ChebyshevT ChebyshevU Cyclotomic Hermite > > ### ** Examples > ## Don't show: > opar <- graphics::par(mar = c(5.1, 4.5, 2.1, 0.4)) > ## End(Don't show) > colours <- grDevices::palette.colors()[c("vermillion", "bluishgreen", + "blue", "skyblue", "reddishpurple", "orange")] > > > ## Abel polynomials > n <- 0:4 > plot( + xlim = c(-3, 6), ylim = c(-20, 30), + panel.first = graphics::grid(col = "gray69"), + x = NA_real_, y = NA_real_, + xlab = "x", ylab = as.call(list(call("[", as.symbol("p"), + as.symbol("n")), as.symbol("x"))), + main = "Abel Polynomials" + ) > for (i in seq_along(n)) { + graphics::lines(as.polynomial(Abel(n[[i]])), + col = colours[[i]], n = 1001, lwd = 2, + xlim = graphics::par("usr")[1:2]) + } > graphics::box() > graphics::legend( + x = "bottomright", + legend = as.expression(lapply(X = n, FUN = function(n1) { + call("==", as.symbol("n"), n1) + })), + col = colours[seq_along(n)], + lwd = 2, + bty = "n" + ) > graphics::title(sub = ~"All with" ~ list(a == 1), adj = 1) > > > ## Bessel polynomials > n <- 0:5 > plot( + xlim = c(-3, 6), ylim = c(-10, 20), + panel.first = graphics::grid(col = "gray69"), + x = NA_real_, y = NA_real_, + xlab = "x", ylab = as.call(list(call("[", as.symbol("y"), + as.symbol("n")), as.symbol("x"))), + main = "Bessel Polynomials" + ) > for (i in seq_along(n)) { + graphics::lines(as.polynomial(Bessel(n[[i]])), + col = colours[[i]], n = 1001, lwd = 2, + xlim = graphics::par("usr")[1:2]) + } > graphics::box() > graphics::legend( + x = "bottomright", + legend = as.expression(lapply(X = n, FUN = function(n1) { + call("==", as.symbol("n"), n1) + })), + col = colours[seq_along(n)], + lwd = 2, + bty = "n" + ) > > > ## Reverse Bessel polynomials > n <- 0:5 > plot( + xlim = c(-10, 10), ylim = c(-10, 20), + panel.first = graphics::grid(col = "gray69"), + x = NA_real_, y = NA_real_, + xlab = "x", ylab = as.call(list(call("[", as.symbol("theta"), + as.symbol("n")), as.symbol("x"))), + main = "Reverse Bessel Polynomials" + ) > for (i in seq_along(n)) { + graphics::lines(as.polynomial(rBessel(n[[i]])), + col = colours[[i]], n = 1001, lwd = 2, + xlim = graphics::par("usr")[1:2]) + } > graphics::box() > graphics::legend( + x = "bottomright", + legend = as.expression(lapply(X = n, FUN = function(n1) { + call("==", as.symbol("n"), n1) + })), + col = colours[seq_along(n)], + lwd = 2, + bty = "n" + ) > > > ## Chebyshev polynomials of the first kind > n <- 0:4 > plot( + xlim = c(-1, 1), ylim = c(-1, 1), + panel.first = graphics::grid(col = "gray69"), + x = NA_real_, y = NA_real_, + xlab = "x", ylab = as.call(list(call("[", as.symbol("T"), + as.symbol("n")), as.symbol("x"))), + main = "Chebyshev polynomials of the first kind" + ) > for (i in seq_along(n)) { + graphics::lines(as.polynomial(Chebyshev1(n[[i]])), + col = colours[[i]], n = 1001, lwd = 2, + xlim = graphics::par("usr")[1:2] + ) + } > graphics::box() > graphics::legend( + x = "bottomright", + legend = as.expression(lapply(X = n, FUN = function(n1) { + call("==", as.symbol("n"), n1) + })), + col = colours[seq_along(n)], + lwd = 2, + bty = "n" + ) > > > ## Chebyshev polynomials of the second kind > n <- 0:4 > plot( + xlim = c(-1, 1), ylim = c(-4, 5), + panel.first = graphics::grid(col = "gray69"), + x = NA_real_, y = NA_real_, + xlab = "x", ylab = as.call(list(call("[", as.symbol("U"), + as.symbol("n")), as.symbol("x"))), + main = "Chebyshev polynomials of the second kind" + ) > for (i in seq_along(n)) { + graphics::lines(as.polynomial(Chebyshev2(n[[i]])), + col = colours[[i]], n = 1001, lwd = 2, + xlim = graphics::par("usr")[1:2] + ) + } > graphics::box() > graphics::legend( + x = "bottomright", + legend = as.expression(lapply(X = n, FUN = function(n1) { + call("==", as.symbol("n"), n1) + })), + col = colours[seq_along(n)], + lwd = 2, + bty = "n" + ) > > > ## Cyclotomic polynomials > n <- 1:5 > plot( + xlim = c(-3, 3), ylim = c(-10, 10), + panel.first = graphics::grid(col = "gray69"), + x = NA_real_, y = NA_real_, + xlab = "x", ylab = as.call(list(call("[", as.symbol("Phi"), + as.symbol("n")), as.symbol("x"))), + main = "Cyclotomic Polynomials" + ) > for (i in seq_along(n)) { + graphics::lines(as.polynomial(Cyclotomic(n[[i]])), + col = colours[[i]], n = 1001, lwd = 2, + xlim = graphics::par("usr")[1:2] + ) + } > graphics::box() > graphics::legend( + x = "bottomright", + legend = as.expression(lapply(X = n, FUN = function(n1) { + call("==", as.symbol("n"), n1) + })), + col = colours[seq_along(n)], + lwd = 2, + bty = "n" + ) > > > ## Hermite polynomials > n <- 0:5 > plot( + xlim = c(-3, 6), ylim = c(-10, 20), + panel.first = graphics::grid(col = "gray69"), + x = NA_real_, y = NA_real_, + xlab = "x", ylab = as.call(list(call("[", as.symbol("H"), + as.symbol("n")), as.symbol("x"))), + main = "Hermite Polynomials" + ) > for (i in seq_along(n)) { + graphics::lines(as.polynomial(Hermite(n[[i]])), + col = colours[[i]], n = 1001, lwd = 2, + xlim = graphics::par("usr")[1:2] + ) + } main.c:31:12: runtime error: variable length array bound evaluates to non-positive value 0 #0 0x7f380beff356 in hermite /data/gannet/ripley/R/packages/tests-gcc-SAN/polynomial/src/main.c:31 #1 0x57e313 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:598 #2 0x638c61 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7671 #3 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #4 0x675304 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1897 #5 0x6777a7 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823 #6 0x646a5e in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083 #7 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #8 0x672062 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555 #9 0x6727f7 in FORCE_PROMISE /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5136 #10 0x6727f7 in getvar /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5177 #11 0x636c8a in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:6867 #12 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #13 0x675304 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1897 #14 0x6777a7 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823 #15 0x646a5e in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083 #16 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #17 0x672062 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555 #18 0x670e04 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:763 #19 0x72271d in do_usemethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:563 #20 0x6235ac in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7135 #21 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #22 0x675304 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1897 #23 0x6777a7 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823 #24 0x646a5e in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083 #25 0x683b90 in R_compileAndExecute /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1518 #26 0x684449 in do_for /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302 #27 0x670d08 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:802 #28 0x6f030d in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264 #29 0x6f0958 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:314 #30 0x6f0aa4 in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1113 #31 0x6f0af2 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1120 #32 0x41b3d8 in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #33 0x7f381c3e7081 in __libc_start_main (/lib64/libc.so.6+0x27081) #34 0x41db5d in _start (/data/gannet/ripley/R/gcc-SAN/bin/exec/R+0x41db5d) main.c:53:12: runtime error: index 1 out of bounds for type 'double [*]' #0 0x7f380beffe6c in hermite /data/gannet/ripley/R/packages/tests-gcc-SAN/polynomial/src/main.c:53 #1 0x57e313 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:598 #2 0x638c61 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7671 #3 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #4 0x675304 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1897 #5 0x6777a7 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823 #6 0x646a5e in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083 #7 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #8 0x672062 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555 #9 0x6727f7 in FORCE_PROMISE /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5136 #10 0x6727f7 in getvar /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5177 #11 0x636c8a in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:6867 #12 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #13 0x675304 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1897 #14 0x6777a7 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823 #15 0x646a5e in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083 #16 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #17 0x672062 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555 #18 0x670e04 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:763 #19 0x72271d in do_usemethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:563 #20 0x6235ac in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7135 #21 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #22 0x675304 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1897 #23 0x6777a7 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823 #24 0x646a5e in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083 #25 0x683b90 in R_compileAndExecute /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1518 #26 0x684449 in do_for /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302 #27 0x670d08 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:802 #28 0x6f030d in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264 #29 0x6f0958 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:314 #30 0x6f0aa4 in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1113 #31 0x6f0af2 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1120 #32 0x41b3d8 in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #33 0x7f381c3e7081 in __libc_start_main (/lib64/libc.so.6+0x27081) #34 0x41db5d in _start (/data/gannet/ripley/R/gcc-SAN/bin/exec/R+0x41db5d) ================================================================= ==3320361==ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address 0x7fffab601968 at pc 0x7f380beffd67 bp 0x7fffab601930 sp 0x7fffab601920 WRITE of size 8 at 0x7fffab601968 thread T0 #0 0x7f380beffd66 in hermite /data/gannet/ripley/R/packages/tests-gcc-SAN/polynomial/src/main.c:53 #1 0x57e313 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:598 #2 0x638c61 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7671 #3 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #4 0x675304 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1897 #5 0x6777a7 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823 #6 0x646a5e in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083 #7 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #8 0x672062 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555 #9 0x6727f7 in FORCE_PROMISE /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5136 #10 0x6727f7 in getvar /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5177 #11 0x636c8a in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:6867 #12 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #13 0x675304 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1897 #14 0x6777a7 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823 #15 0x646a5e in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083 #16 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #17 0x672062 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555 #18 0x670e04 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:763 #19 0x72271d in do_usemethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:563 #20 0x6235ac in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7135 #21 0x670017 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727 #22 0x675304 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1897 #23 0x6777a7 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823 #24 0x646a5e in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083 #25 0x683b90 in R_compileAndExecute /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1518 #26 0x684449 in do_for /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302 #27 0x670d08 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:802 #28 0x6f030d in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264 #29 0x6f0958 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:314 #30 0x6f0aa4 in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1113 #31 0x6f0af2 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1120 #32 0x41b3d8 in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #33 0x7f381c3e7081 in __libc_start_main (/lib64/libc.so.6+0x27081) #34 0x41db5d in _start (/data/gannet/ripley/R/gcc-SAN/bin/exec/R+0x41db5d) Address 0x7fffab601968 is located in stack of thread T0 SUMMARY: AddressSanitizer: dynamic-stack-buffer-overflow /data/gannet/ripley/R/packages/tests-gcc-SAN/polynomial/src/main.c:53 in hermite Shadow bytes around the buggy address: 0x1000756b82d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000756b82e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000756b82f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000756b8300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000756b8310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x1000756b8320: 00 00 00 00 00 00 00 00 ca ca ca ca 00[cb]cb cb 0x1000756b8330: cb cb cb cb 00 00 00 00 00 00 00 00 00 00 00 00 0x1000756b8340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000756b8350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000756b8360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000756b8370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==3320361==ABORTING