Skip to content

[Windows only] RProvider doesn't work with R > 4.0.2 #224

@AndrewIOM

Description

@AndrewIOM

Thank you for the tips @dsyme. I enabled logging and get the same log output as you. Tracing the code, I think this is an upstream problem caused by an interaction between newer versions of R and a Windows security feature "Control Flow Guard" as mentioned in this RDotNet issue rdotnet/rdotnet#139 (comment). That would also explain why the failure is only happening on windows.

It looks like we'll have to wait for that fix to resolve this windows build problem. But I'll also keep poking at it to see if we can get it to build either on on R <= 4.0.2 or with the workaround noted in that RDotNet issue.

More details:
The s.GetPackages() code seems to be failing after the first call to eval("1+4") because the log doesn't print the 5 after eval("1+4").Value:

    let getPackages() : string[] =
        Logging.logf "Communicating with R to get packages"
        Logging.logf "Test: %O" (eval("1+4"))
        Logging.logf "Test: %O" (eval("1+4").Value)
        eval(".packages(all.available=T)").GetValue()

The above referenced RDotNet issue says calling Evaluate on x64 for R >= 4.0.3 causes crashes. I installed R 4.0.2 and set that as R_HOME to make RProvider use it and the logs a) confirm use of 4.02 and b) get farther. Here the System.Double output should be the results of eval("1+4").

[9/17/2021 11:09:02 AM] [Pid:1484, Tid:1, Apid:1] eval(1+4)
[9/17/2021 11:09:02 AM] [Pid:1484, Tid:1, Apid:1] Output: 
[9/17/2021 11:09:02 AM] [Pid:1484, Tid:1, Apid:1] Converting value from R...
[9/17/2021 11:09:02 AM] [Pid:1484, Tid:1, Apid:1] [DEBUG] MEF Container
[9/17/2021 11:09:02 AM] [Pid:1484, Tid:1, Apid:1] [DEBUG] MEF Container 2
[9/17/2021 11:09:02 AM] [Pid:1484, Tid:1, Apid:1] [DEBUG] MEF Container 3
[9/17/2021 11:09:02 AM] [Pid:1484, Tid:1, Apid:1] Test: System.Double[]

The build tests still hang with the log stopping after trying to do something with Test.RProvider\data/sample.rdata. But the fact that we get farther with 4.0.2 than 4.0.3 is consistent with the problem being caused by the R/RDotNet/Control Guard issue.

Originally posted by @nhirschey in #216 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: HighStatus: BlockedAnother issue, pull request, or external dependency is holding up this item.Type: BugSomething is broken!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions