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

New Post: .Call using R.Net

$
0
0
Hi,

Thanks for providing the stack trace, it is useful to provide conditions. It seems from it that you are running your program from visual studio; do you observed the same access violation crash if run from the command prompt? if not, this may be a threading issue when run from visual studio, though a surprise.

It sounds from your post that you can indeed run your '.C' call from R successfully: can you confirm?

Access Violation crashes, from what I experience, occur typically when the C code access a class/struct element via a pointer that is NULL, or accessing a pointer that points to freed memory. While it could in principle be because R or .NET garbage collects something you passed to your .C function, both R and R.NET are designed not to let that happen in your context, so far as I can see.

One thing you could do to diagnose further is to compile your C code with debug symbols and debug your program specifying that both the native and managed code should be debugged. Probably the behavior when launched from visual studio, and if you attach VS to a running process (Ctrl Alt P) you can specify what managed/unmanaged code you want debugged.

Hope this helps

Viewing all articles
Browse latest Browse all 1634

Trending Articles



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