[Mono-dev] Static Variables

Patrick Earl patearl at patearl.net
Mon Sep 11 01:39:27 EDT 2006

Hi all.  I'm trying to track down a bug relating to static variables.  
You can see what the bug is all about here:


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
    mini/jit-icalls.c: mono_class_static_field_address
But neither seem to be called for a field with the name of 

The variables seem to be initialized properly (they contain -1 when 
the runtime lookup occurs), but after 1 is assigned to them, the 
runtime system still thinks they have -1 in them.

Any hints on how to proceed with debugging or how this issue might be 
fixed are much appreciated.


        Patrick Earl

More information about the Mono-devel-list mailing list