[Mono-dev] Static Variables

Robert Jordan robertj at gmx.net
Mon Sep 11 04:46:52 EDT 2006

Patrick Earl wrote:
> Hi all.  I'm trying to track down a bug relating to static variables.  
> You can see what the bug is all about here:
>     http://bugzilla.ximian.com/show_bug.cgi?id=79211
> I can easily examine the call that attempts to retrieve the value for 
> ipv4Supported.  However, I can't find the call where the variable is 
> set.  I can see it being set in the C# code in Socket.cs.  I have 
> debug code there that indicates that it is indeed being set.  It's 
> being set in the same domain, but for some reason, the values are 
> different in the C# code and in the mono internal calls.
> Any suggestions on how I might proceed?  I've checked:
>     metadata/object.c: mono_field_static_set_value
> And:
>     mini/jit-icalls.c: mono_class_static_field_address
> But neither seem to be called for a field with the name of 
> ipv4Supported.

These (at least mono_field_static_set_value) are never called by
JIT code. They are part of the metadata API and are used
by the runtime code and maybe by System.Reflection.
The JIT code is accessing the fields directly.

About your issue: I was not able to reproduce it, even with
multiple domains.

Please provide (attach it to the bug entry) *exactly* the same
test case which failed on your machine.


More information about the Mono-devel-list mailing list