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

New Post: Entry point was not found exception

$
0
0
The function is exposed from R.dll and I actually see it being resolved successfully multiple times.
I think it might be a race condition, where the handle is being closed before all objects are being released, leading to GetProcAddress to fail and return null.

I see that when this issue occurs, it is happening during a finalizer call.
So probably what happened is that the engine handle was disposed (either in a different finalizer or by explicitly calling Dispose) and then a GC kicked in and started finalizing other objects. At this point, they failed.

It seems like either:
  1. Some references are not being kept, so the GC releases the engine before other objects.
  2. Maybe some objects should be IDisposable and they should be disposed earlier (and not wait for the finalizaer).
Quick question about GetFunction. Wouldn't it be a good idea to cache all resolved functions in a dictionary, instead of PInvoking multiple times per function?

Viewing all articles
Browse latest Browse all 1634

Trending Articles



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