[Mono-list] Mono embeded : NullReferenceException for a lock on a non-null object

Damien maitredede at gmail.com
Mon Jun 26 01:56:55 UTC 2017


Hi,

I am embedding mono in a qt application on Windows, and when executing
code, I have a SIGSEGV in managed code, that is a NullReferenceException,
but my variable is not null.

I am on Windows 10 x64.
I have installed Mono 5.0.1 (Visual Studio built mono) x86.
I code on Qt 5.3 with MinGW x86.

I have a native method that calls a managed method :
mono_runtime_invoke(method, obj, args, &exceptionObject).

In my managed method, I have a "lock" statement :
lock(this.myVar) { ... }

The SIGSEGV (or NullReferenceException) is raised only when the native
method is called on the second time. When called the first time, it works
well.
Between the two calls, nothing has changed.

What can be the source of the error ?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-list/attachments/20170626/216bb3a7/attachment.html>


More information about the Mono-list mailing list