Hi All!
this week i tried to implement JNI library written on Nim(v.1.0.2) using templates from https://gist.github.com/jangko/48ba0b76716d0631560e5f2ff470256d and also jnim https://github.com/yglukhov/jnim but unfortunately on linux OS got error at runtime:
No stack traceback available
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
i recognized that it happens when Java starts GC collect.
Steps to reproduce:
public class Sample
{
  
  public static void main(String[] args)
  {
    System.load("/absolute/path/to/libempty.so");
    //System.load("absolute\\path\\to\\empty.dll");
    
    for(int j=0; j<50000; j++){
        System.out.println("Java GC starts...");
        System.gc();
        System.gc();
        System.gc();
        System.gc();
        System.gc();
        System.gc();
        System.gc();
        System.gc();
        System.gc();
        System.gc();
        System.gc();
        System.gc();
        System.out.println("Java GC finished...");
    }
  }
}
Please any suggestion on it, perhaps additional switches for Nim compiler?
Thanks.
Araq, awesome, that solves it!
thanks a lot!