Christoph_J
Christoph_J

Reputation: 6884

R terminates with error message: This application has requested the Runtime to terminate it in an unusual way

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.

Upvotes: 3

Views: 3007

Answers (2)

Oleg Melnikov
Oleg Melnikov

Reputation: 3298

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   

Upvotes: 1

Christoph_J
Christoph_J

Reputation: 6884

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.

Upvotes: 0

Related Questions