-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
engine.Evaluate("library(xgboost)") throws StackOverflow error. #74
Comments
Curious if you have tested it with other versions of R, or just 3.4.4? |
I tested this on: Windows 10 - 64 For each version of R, I used this code and did not get an exception. Just curious how to replicate the same issue you're seeing. I will note that I pulled down R.NET from NuGet and used that. Are you using a locally built version? https://gist.github.com/lrasmus/1decc4c4af6dc61e45167a64b638c2f0
|
I only tested againts R3.4.4 I'm using .R NET package from nuget as well.
The details error is:
|
Thanks for the details - I updated my project to match, so it's now building against .NET 4.6.1 and I've installed all of the same packages (although they are not needed in my instance, but just to get on the same ground). Unfortunately I don't get the exception. I was wondering if you could create a simple command line project based on the code I had posted before and see if you can replicate the problem? You're not the only one seeing this - there's a SO post with the same general approach and error. |
Thank you for your suggestion, However, using MVC web application on the same settings it throws the error. What could be the solution? |
Ahhh! Okay, that's good to know. I'll try and replicate this with a simple MVC web application to see if I can get the exception now. |
So, I think I've somewhat replicated your problem - but what's odd is I get a different exception. I created a simple MVC controller and call the following code:
It loads caTools fine, and throws an RDotNet.EvaluationException when trying to load xgboost (not StackOverflow):
I was wondering where and how you're initializing the REngine in your application, and how you're calling code to execute? Are you doing it all from within a single controller action? |
I'm having the same problem. It happens for some libraries (e.g. plyr, dplyr, tidyr, xml2) and not others (e.g. sqldf, jsonlite). The thing is that this only happens when I'm testing/running in IIS Express and not in Console app or MS Test classes. Here are my specs: I've tried using 32-bit and 64-bit R and same results. |
Hi Luke,
Sorry for getting back to you late.
I was calling the library directly from controller in one action.
Thanks,
Abi
…On Fri, 27 Apr 2018, 09:59 Luke R., ***@***.***> wrote:
So, I think I've somewhat replicated your problem - but what's odd is I
get a different exception. I created a simple MVC controller and call the
following code:
REngine.SetEnvironmentVariables();
var engine = REngine.GetInstance();
engine.Evaluate("library(caTools)");
engine.Evaluate("library(xgboost)");
It loads caTools fine, and throws an RDotNet.EvaluationException when
trying to load xgboost (not StackOverflow):
RDotNet.EvaluationException was unhandled by user code
HResult=-2146233088
Message=Error: package or namespace load failed for 'xgboost' in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-3.4.4/library/stats/libs/i386/stats.dll':
LoadLibrary failure: The specified module could not be found.
Source=RDotNet
StackTrace:
at RDotNet.REngine.Parse(String statement, StringBuilder incompleteStatement)
at RDotNet.REngine.<Defer>d__46.MoveNext()
at System.Linq.Enumerable.LastOrDefault[TSource](IEnumerable`1 source)
at RDotNet.REngine.Evaluate(String statement)
at RDotNetTest.Controllers.DefaultController.Index() in C:\Development\RDotNetTest\RDotNetTest\Controllers\DefaultController.cs:line 18
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
I was wondering where and how you're initializing the REngine in your
application, and how you're calling code to execute? Are you doing it all
from within a single controller action?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#74 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAc5tgXpx3pVJThUwliGsE9ORcofJKJuks5tsnt2gaJpZM4TR_-j>
.
|
@mentezam-nf @abidzar @lrasmus I have not looked in details, nor reproduced, and I do little to no web dev, but my understanding is that IIS expect thread safe code, and the R engine is NOT thread safe. I may be off the mark here but my experience is that IIS and R via R.NET do not play well. |
Yes, I'm aware of the threading issue but I don't think that this is the problem here. I've already put in code to synchronize thread access to the REngine instance. The problem happens when calling library() on the packages that I mentioned. It throws a StackOverflowException. |
I figured out the issue. I posted my solution on SO: |
My environment:
Windows 7 - 64
Visual Studio 2015
Version: R 3.4.4
R platform: i386-w64-mingw32
Not able to load library although the library xgboost is installed and located in R_HOME library folder.
Other library catools can be loaded fine. However, xgboost throws Stackoverflow error.
The text was updated successfully, but these errors were encountered: