Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

Commented Issue: NullReference exception when using CharacterDevice [154]

$
0
0
I tried updating to the latest version of R.NET in RProvider, but I keep getting an exception when running R provider on Mac (this might be failing on Windows too, but I only tried on Mac). Version 1.5.19 does not work, but version 1.5.19 works.

R provider initialises REngine with custom CharacterDevice to capture the output. When we later run some command that prints (I think), we get the following error:

```
[13/01/2015 17:36:24] [Pid:2240, Tid:1, Apid:0] eval(fsr_2240_1('grDevices'))
[13/01/2015 17:36:24] [Pid:2240, Tid:1, Apid:0] Output:
[13/01/2015 17:36:24] [Pid:2240, Tid:1, Apid:0] Operation failed:
System.NullReferenceException: Object reference not set to an instance of an object
at RDotNet.Devices.CharacterDeviceAdapter.WriteConsoleEx (System.String buffer, Int32 length, ConsoleOutputType outputType) [0x00000] in <filename unknown>:0
at RDotNet.Devices.CharacterDeviceAdapter.WriteConsole (System.String buffer, Int32 length) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) object:wrapper_native_0x109a04670 (intptr)
at RDotNet.REngine.Parse (System.String statement, System.Text.StringBuilder incompleteStatement) [0x00000] in <filename unknown>:0
at RDotNet.REngine+<Defer>d__0.MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.Last[SymbolicExpression] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.LastOrDefault[SymbolicExpression] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at RDotNet.REngine.Evaluate (System.String statement) [0x00000] in <filename unknown>:0
at RProvider.RInteropInternal+eval@292.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00000] in <filename unknown>:0
at RProvider.Internal.Logging.logWithOutput[SymbolicExpression] (RProvider.CharacterDeviceInterceptor characterDevice, Microsoft.FSharp.Core.FSharpFunc`2 f) [0x00000] in <filename unknown>:0

```

I can dig deeper and probably give you a concrete repro for this, but I thought I'd share the error message first to see if you can think of any change that might be causing this...
Comments: I was also getting 'this == null' in the character device. I put together a hacky wokararound: http://rdotnet.codeplex.com/workitem/154

Viewing all articles
Browse latest Browse all 1634

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>