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:16: runtime error: variable length array bound evaluates to non-positive value 0 #0 0x7f065c1d2c75 in hermite /data/gannet/ripley/R/packages/tests-clang-SAN/polynomial/src/main.c:31:5 #1 0x6e3cbd in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:598:17 #2 0x847463 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7671:21 #3 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #4 0x895a30 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #5 0x890c57 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823:16 #6 0x84f677 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083:12 #7 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #8 0x88e6a6 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555:8 #9 0x8c0260 in FORCE_PROMISE /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5136:15 #10 0x8c0260 in getvar /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5177:14 #11 0x862392 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:6867:20 #12 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #13 0x895a30 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #14 0x890c57 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823:16 #15 0x84f677 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083:12 #16 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #17 0x88e6a6 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555:8 #18 0x82bf8f in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:763:6 #19 0x9b99e7 in do_usemethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:563:2 #20 0x849d07 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7135:15 #21 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #22 0x895a30 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #23 0x890c57 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823:16 #24 0x84f677 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083:12 #25 0x89f5a3 in R_compileAndExecute /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1518:2 #26 0x89c41b in do_for /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302:9 #27 0x82b95c in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:802:12 #28 0x9638e7 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264:2 #29 0x966cc0 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:314:11 #30 0x966ae9 in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1113:5 #31 0x966e42 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1120:5 #32 0x4de22a in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29:5 #33 0x7f066cd00081 in __libc_start_main (/lib64/libc.so.6+0x27081) #34 0x4312dd in _start (/data/gannet/ripley/R/R-clang-SAN/bin/exec/R+0x4312dd) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior main.c:31:16 in main.c:53:9: runtime error: index 1 out of bounds for type 'double [degree]' #0 0x7f065c1d2ac9 in hermite /data/gannet/ripley/R/packages/tests-clang-SAN/polynomial/src/main.c:53:20 #1 0x6e3cbd in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:598:17 #2 0x847463 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7671:21 #3 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #4 0x895a30 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #5 0x890c57 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823:16 #6 0x84f677 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083:12 #7 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #8 0x88e6a6 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555:8 #9 0x8c0260 in FORCE_PROMISE /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5136:15 #10 0x8c0260 in getvar /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5177:14 #11 0x862392 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:6867:20 #12 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #13 0x895a30 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #14 0x890c57 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823:16 #15 0x84f677 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083:12 #16 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #17 0x88e6a6 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555:8 #18 0x82bf8f in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:763:6 #19 0x9b99e7 in do_usemethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:563:2 #20 0x849d07 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7135:15 #21 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #22 0x895a30 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #23 0x890c57 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823:16 #24 0x84f677 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083:12 #25 0x89f5a3 in R_compileAndExecute /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1518:2 #26 0x89c41b in do_for /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302:9 #27 0x82b95c in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:802:12 #28 0x9638e7 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264:2 #29 0x966cc0 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:314:11 #30 0x966ae9 in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1113:5 #31 0x966e42 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1120:5 #32 0x4de22a in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29:5 #33 0x7f066cd00081 in __libc_start_main (/lib64/libc.so.6+0x27081) #34 0x4312dd in _start (/data/gannet/ripley/R/R-clang-SAN/bin/exec/R+0x4312dd) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior main.c:53:9 in ================================================================= ==3461552==ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address 0x7ffeeec7cf88 at pc 0x7f065c1d2cfd bp 0x7ffeeec7cf50 sp 0x7ffeeec7cf48 WRITE of size 8 at 0x7ffeeec7cf88 thread T0 #0 0x7f065c1d2cfc in hermite /data/gannet/ripley/R/packages/tests-clang-SAN/polynomial/src/main.c:53:20 #1 0x6e3cbd in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:598:17 #2 0x847463 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7671:21 #3 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #4 0x895a30 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #5 0x890c57 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823:16 #6 0x84f677 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083:12 #7 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #8 0x88e6a6 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555:8 #9 0x8c0260 in FORCE_PROMISE /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5136:15 #10 0x8c0260 in getvar /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:5177:14 #11 0x862392 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:6867:20 #12 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #13 0x895a30 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #14 0x890c57 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823:16 #15 0x84f677 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083:12 #16 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #17 0x88e6a6 in forcePromise /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:555:8 #18 0x82bf8f in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:763:6 #19 0x9b99e7 in do_usemethod /data/gannet/ripley/R/svn/R-devel/src/main/objects.c:563:2 #20 0x849d07 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7135:15 #21 0x82b309 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:727:8 #22 0x895a30 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #23 0x890c57 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1823:16 #24 0x84f677 in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7083:12 #25 0x89f5a3 in R_compileAndExecute /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1518:2 #26 0x89c41b in do_for /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302:9 #27 0x82b95c in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:802:12 #28 0x9638e7 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264:2 #29 0x966cc0 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:314:11 #30 0x966ae9 in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1113:5 #31 0x966e42 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1120:5 #32 0x4de22a in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29:5 #33 0x7f066cd00081 in __libc_start_main (/lib64/libc.so.6+0x27081) #34 0x4312dd in _start (/data/gannet/ripley/R/R-clang-SAN/bin/exec/R+0x4312dd) Address 0x7ffeeec7cf88 is located in stack of thread T0 SUMMARY: AddressSanitizer: dynamic-stack-buffer-overflow /data/gannet/ripley/R/packages/tests-clang-SAN/polynomial/src/main.c:53:20 in hermite Shadow bytes around the buggy address: 0x10005dd879a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005dd879b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005dd879c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005dd879d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005dd879e0: 00 00 00 00 00 00 00 00 00 00 00 00 ca ca ca ca =>0x10005dd879f0: 00[cb]cb cb cb cb cb cb 00 00 00 00 00 00 00 00 0x10005dd87a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005dd87a10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005dd87a20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005dd87a30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005dd87a40: 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 ==3461552==ABORTING