[Rd] traceback does not show source line number of long calls when truncating output
Hi, in R-3.1.0 (Linux), traceback() does not show the source file line number for the truncated calls, when limiting the number of lines output for each call with argument max.lines. See sample code, output and session info below (in particular, output for call number 5). I guess this is not intended. Thank you. Bests, Renaud ## File: traceback.R a <- function(...){ stop('this is an error') } # code to generate the long call # set.seed(123) # v <- unique(replicate(10, { paste0(sample(letters[1:26]), collapse = "") })) # sprintf("a(%s)", paste0(v, '=', 1, collapse = ", ")) a(htjuwakqxzpgrsbncvyofdmeli=1, ozgdvsnpaimweybtkulrhcfjxq=1, udnecprhlbgwtfjisyzoxaqmvk=1, jcfpzqyirwotbsehdngauxlkvm=1, mwvojdsfbqlchznegyirpkautx=1, qwzxlnyorhegackmvubfsjtipd=1, ofkylhmugjvdwzscirnexptbqa=1, sgolfwzrevpjnythbqxmdckuai=1, ezlfyoangrspdmihtuxkvwcbqj=1, gjetdqkmvwxufslhcbpirnazoy=1) ## In R source('traceback.R', keep.source = TRUE) traceback() traceback(max.lines = 2) sessionInfo() ## Output > source('traceback.R', keep.source = TRUE) Error in a(htjuwakqxzpgrsbncvyofdmeli = 1, ozgdvsnpaimweybtkulrhcfjxq = 1, : this is an error > traceback() 6: stop("this is an error") at traceback.R#1 5: a(htjuwakqxzpgrsbncvyofdmeli = 1, ozgdvsnpaimweybtkulrhcfjxq = 1, udnecprhlbgwtfjisyzoxaqmvk = 1, jcfpzqyirwotbsehdngauxlkvm = 1, mwvojdsfbqlchznegyirpkautx = 1, qwzxlnyorhegackmvubfsjtipd = 1, ofkylhmugjvdwzscirnexptbqa = 1, sgolfwzrevpjnythbqxmdckuai = 1, ezlfyoangrspdmihtuxkvwcbqj = 1, gjetdqkmvwxufslhcbpirnazoy = 1) at traceback.R#8 4: eval(expr, envir, enclos) 3: eval(ei, envir) 2: withVisible(eval(ei, envir)) 1: source("traceback.R", keep.source = TRUE) > traceback(max.lines = 2) 6: stop("this is an error") at traceback.R#1 5: a(htjuwakqxzpgrsbncvyofdmeli = 1, ozgdvsnpaimweybtkulrhcfjxq = 1, udnecprhlbgwtfjisyzoxaqmvk = 1, jcfpzqyirwotbsehdngauxlkvm = 1, ... 4: eval(expr, envir, enclos) 3: eval(ei, envir) 2: withVisible(eval(ei, envir)) 1: source("traceback.R", keep.source = TRUE) > sessionInfo() R version 3.1.0 (2014-04-10) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 [6] LC_MESSAGES=en_US.UTF-8LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crash using Sys.which on Windows
This is a change in behaviour of the Windows API function since the code was written (years ago). It will be changed in R 3.1.1: meanwhile you can always use the shortPathName to abbreviate the name. On 06/05/2014 19:28, Tobias Verbeke wrote: Dear list, When installing the latest version of Rtools (3.1.0.1942) into a path that contains more than 96 characters on Windows 7 64-bit, e.g. into C:\TheLatestRtoolsInAPathWithMoreThanNinetySixCharactersWillCrashTheRSessionUponCallingTheSysWhichFunctionInRToGetTheGccPath and assuming that the Rtools bin paths have been appropriately added to the PATH environment variable as in c:\TheLatestRtoolsInAPathWithMoreThanNinetySixCharactersWillCrashTheRSessionUponCallingTheSysWhichFunctionInRToGetTheGccPath\bin;c:\TheLatestRtoolsInAPathWithMoreThanNinetySixCharactersWillCrashTheRSessionUponCallingTheSysWhichFunctionInRToGetTheGccPath\gcc-4.6.3\bin the following call from RGui 64-bit (version 3.1.0) reproducibly causes R to crash: Sys.which("ls") Sys.which seems to use an internal function on Windows. Is this a known issue? Please let me know if I can provide any more relevant information. Best, Tobias __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R crash using Sys.which on Windows
Dear Prof. Ripley, Many thanks for the change in R 3.1.1 to be as well as for the description of the workaround for R 3.1.0. Best regards, Tobias Verbeke - Original Message - > From: "Prof Brian Ripley" > To: r-devel@r-project.org > Sent: Monday, May 12, 2014 12:40:17 PM > Subject: Re: [Rd] R crash using Sys.which on Windows > > This is a change in behaviour of the Windows API function since the code > was written (years ago). It will be changed in R 3.1.1: meanwhile you > can always use the shortPathName to abbreviate the name. > > > On 06/05/2014 19:28, Tobias Verbeke wrote: > > Dear list, > > > > When installing the latest version of Rtools (3.1.0.1942) into a path that > > contains more than 96 characters on Windows 7 64-bit, > > e.g. into > > > > C:\TheLatestRtoolsInAPathWithMoreThanNinetySixCharactersWillCrashTheRSessionUponCallingTheSysWhichFunctionInRToGetTheGccPath > > > > and assuming that the Rtools bin paths have been appropriately added to the > > PATH environment variable as in > > > > c:\TheLatestRtoolsInAPathWithMoreThanNinetySixCharactersWillCrashTheRSessionUponCallingTheSysWhichFunctionInRToGetTheGccPath\bin;c:\TheLatestRtoolsInAPathWithMoreThanNinetySixCharactersWillCrashTheRSessionUponCallingTheSysWhichFunctionInRToGetTheGccPath\gcc-4.6.3\bin > > > > the following call from RGui 64-bit (version 3.1.0) reproducibly causes R > > to crash: > > > > Sys.which("ls") > > > > Sys.which seems to use an internal function on Windows. Is this a known > > issue? > > > > Please let me know if I can provide any more relevant information. > > > > Best, > > Tobias > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > > -- > Brian D. Ripley, rip...@stats.ox.ac.uk > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (PA) > Oxford OX1 3TG, UKFax: +44 1865 272595 > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel