fsprojects / IfSharp

F# for Jupyter Notebooks
Other
442 stars 71 forks source link

NullReferenceExceptionObject on memory limit #174

Closed ShalokShalom closed 6 years ago

ShalokShalom commented 6 years ago

The complete code:

let x = 42

x + 3

let greet name = 
    printfn "Hello, %s" name

open System
open System.IO

let path = "/home/nbuser/trainingsample.csv"
let data0 = File.ReadAllLines path

let data1 = 
    data0 
    |> Array.map (fun line -> line.Split(','))

data0.[1..50] |> Array.map (fun (line:string) -> line.Split(','))

See here the working case:

screenshot_20180412_203637

Change data0.[1..10] into a higher value like [1..50] and you get the following error:

screenshot_20180412_203924

Full Error here: https://gist.github.com/ShalokShalom/84c4d8a488925189fd9a99ffc09ca7fd

And here is the used trainingsample.csv. Right click on View Raw OR Download and then on Save Link/Target as.. in order to download it.

https://github.com/c4fsharp/Dojo-Digits-Recognizer/blob/master/Dojo/trainingsample.csv

cgravill commented 6 years ago

Looks like another instance of #143 on Mono.

ShalokShalom commented 6 years ago

Yeah, might be. So this can be closed? Do you consider a switch to dotnetcore?

cgravill commented 6 years ago

Sure, happy either way on closing. There's a self-contained test case on the other issue but once fixed it would be good to have people confirm.

I'd really like to get it fixed on Mono but haven't found anyone experienced with Mono debugging and available to help so far.

I'm also really interested in a dotnetcore build - I've started experimenting on other projects and it looks good. The challenge with something like the notebooks is compatibility, it might be a bit soon in the ecosystem to move over. The first step would be to check if everything in paket.dependencies has a dotnetcore build then could see about a test build.