3

I have a rather large chunk of code that breaks sometimes, as far as I can see randomly, with the error message:

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

Some research showed me that this seems to be a Windows/C runtime message when abort is called (see for example this link). This drives me nuts: Since it is not an error thrown by R I have no idea where to look. Does anyone have any clue where R or maybe data.table (if that's possible that a package calls the abort function in C runtime [??]) calls the abort function?

Here are some further information:

  1. The problem is independent from the machine: I tried it on two different machines, it crashed on both of them sometimes.
  2. The problem is independent on the R version: I tried it with 2.13.1, 2.13.2, and 2.14.0.
  3. Both machines run Windows 7 (64 bit).
  4. The problem seems to be related to the size of my data.tables. When I artificially reduce the size of the bigger data.table, the code runs like a charm. Interestingly, however, one machine has far more RAM than the other (16 GB compared to 6 GB). This additional RAM, however, doesn't really help, at least it seems so.
  5. The problem is not reproducible and breaks at different sections in my code. I noticed this because my code is run in a Sweave document, so I can open the .tex file after R has crashed and it always stops at a different position. However, it always seems to be when a data.table operation is called (that doesn't mean a lot though because my code relies heavily on data.table). However, even when I don't call Sweave, but just run the code, it breaks sometimes as well. So it does not seem to be related to Sweave.
  6. It has nothing to do with the editor I'm using. I use RStudio, but reproduced this behavior by running the code in a plain R command window.

That's basically all possible explanations I've come up with. So it would be great if anyone has any hints on where this error could come from or what else I could check.

PS: I won't be at my machine the next couple of days, so I hope you forgive me when I don't give feedback immediately. Nevertheless, I wanted to post this question before Xmas, otherwise I couldn't enjoy it with my beloved R suffering and I'm sitting at home, not trying to cure it...

UPDATE

I looked further into the issue and after a while, I got a rather minimal example with data.table that breaks my R session. If this issue is fixed and it solves the crash of R as described here (note that this is a big if because the example I posted on the data.table list just breaks my R session and does not end it with the error message I described here), I will write an answer here and accept it.

Community
  • 1
  • 1
Christoph_J
  • 6,804
  • 8
  • 44
  • 58
  • a reproducible example would really, really help here. I appreciate that it may be difficult in this situation though. – richiemorrisroe Dec 23 '11 at 14:26
  • I totally agree, but I just don't see how I could produce one since the code breaks at different parts of the code and the code seems to be OK since it runs sometimes. Also, the error message let me assume that there is not one corrupted line of code in my routine, but rather that I face a situation that is not really well defined. And that's what I was hoping some expert could help: when does `R` or maybe a package call `abort`? Or am I completely wrong and it is an OS problem that only happens to coincide whenever I run R code because this is the only time the `OS` is taken to its limits? – Christoph_J Dec 23 '11 at 14:55
  • I honestly don't know, but with a reproducible example we could eliminate some of the possible causes. It may be worth emailing the package maintainer, and if that fails the R-devel mailing list. – richiemorrisroe Dec 23 '11 at 15:24
  • What version of `data.table`? – Ryogi Dec 23 '11 at 18:06
  • @RYogi The version I have currently installed is version `1.7.7`. But I had this error occur with older versions of `data.table` as well. – Christoph_J Dec 24 '11 at 00:12
  • Short update: I just recollect the sample and will run the code again after that. If the problem still exists (which I assume bc I don't change anything else) I will ask Matthew Dowle first if he has any clue if the problem could be a `data.table` specific one (I looked at the source code of this package yesterday, but that was overload for me and I didn't figure out how to search for a specific word `abort`; or I did, but the package doesn't use this function). If he is not aware of such an `abort` function in the package, I write to the R-devel mailing list, as suggested by richiemorrisroe. – Christoph_J Dec 29 '11 at 10:11

2 Answers2

1

Suddenly, same error came up from rvest package in the lines:

 raw_HTML %>% html_nodes(xpath=HTML_table_xpath)

Switching to R 3.3.1 64bit fixed the problem (which remains with 32 bit R for now). That may be a workaround for some. In my case, rJava package requires 32 bit R :(

In case it helps anyone:

> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] rvest_0.3.2         xml2_1.0.0          xts_0.9-7           zoo_1.7-13          doParallel_1.0.10   iterators_1.0.8    
 [7] foreach_1.4.3       plyr_1.8.4          jsonlite_0.9.22     futile.logger_1.4.1

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.5          lattice_0.20-33      codetools_0.2-14     XML_3.98-1.4         R6_2.1.2             grid_3.3.1          
 [7] futile.options_1.0.0 magrittr_1.5         mail_1.0             httr_1.2.0           stringi_1.1.1        curl_0.9.7          
[13] lambda.r_1.1.7       tools_3.3.1          stringr_1.0.0        selectr_0.2-3   
Oleg Melnikov
  • 3,080
  • 3
  • 34
  • 65
  • Thanks for posting this. I was using `readr`, `tidyr`, and `dplyr` on a computer that was using 32-bit R. updating to 64-Bit and the latest version of Rstudio solved the problem – chandler Nov 23 '16 at 17:50
0

OK, this was basically a hard to detect issue with data.table that should be fixed with the version 1.7.8. For more information, see the NEWS file.

Christoph_J
  • 6,804
  • 8
  • 44
  • 58