[Mono-dev] Fwd: register content changed

2010-10-11 Thread Dick Porter
Hi all

We're getting this assertion occasionally on Solaris.  I don't have a  
particular test case, but does anyone know what it means?

- Dick


Begin forwarded message:

 From: psant...@codicesoftware.com psant...@codicesoftware.com
 Date: 10 October 2010 10:53:13 AMBST
 To: Dick Porter dpor...@codicesoftware.com
 Subject: register content changed

 got this running on Solaris. It happened to me several times in the
 past, randomly, both in SPARC and x86

 0: 0 - 0
 1: 92 - 0
 2: 0 - 0
 3: 0 - 0
 4:  - 0
 5: fd3d1af4 - 0
 6: 0 - 0
 7: fe7f3400 - 0
 8: 0 - 0
 9: 1201c90 - 0
 10: 0 - 0
 11: 0 - 0
 12: 0 - 0
 13: 0 - 0
 14: fc623d68 - 0
 15: fed94070 - 0
 16: 1 - 0
 17: 0 - 0
 18: 0 - 0
 19: 0 - 0
 20: 0 - 0
 21: 0 - 0
 22: 0 - 0
 23: 0 - 0
 24: fe7f3400 - 0
 25: 0 - 0
 26: 0 - 0
 27: ff01 - 0
 28: feeb60f0 - 0
 29: 1 - 0
 30: fc623dc8 - 0
 31: fed95cd8 - 0
 32: fe401003 - 0
 33: fed9c580 - 0
 34: fed9c584 - 0
 35: 0 - 0
 36: 0 - 0
 37: 0 - 0
 Register contents changed
 Stacktrace:

  at (wrapper managed-to-native)
 object.__icall_wrapper_mono_array_new_specific (intptr,int) 0x4
  at (wrapper managed-to-native)
 object.__icall_wrapper_mono_array_new_specific (intptr,int)  
 0x
  at System.Reflection.Emit.ILGenerator..ctor
 (System.Reflection.Module,System.Reflection.Emit.TokenGenerator,int)
 0x00020
  at System.Reflection.Emit.ConstructorBuilder.GetILGenerator (int)
 0x000c0
  at System.Reflection.Emit.ConstructorBuilder.GetILGenerator ()  
 0xc
  at
 System 
 .Runtime 
 .Serialization 
 .Formatters.Binary.CodeGenerator.GenerateMetadataTypeInternal
 (System.Type,System.Runtime.Serialization.StreamingContext) 0x001b8
  at
 System 
 .Runtime 
 .Serialization.Formatters.Binary.CodeGenerator.GenerateMetadataType
 (System.Type,System.Runtime.Serialization.StreamingContext) 0x00048
  at
 System 
 .Runtime 
 .Serialization.Formatters.Binary.ObjectWriter.CreateMemberTypeMetadata
 (System.Type) 0x00048
  at
 System 
 .Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData  
 (object 
 ,System.Runtime.Serialization.Formatters.Binary.TypeMetadata,object)
 0x005d4
  at
 System 
 .Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject
 (System.IO.BinaryWriter,long,object) 0x0001c
  at
 System 
 .Runtime 
 .Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance
 (System.IO.BinaryWriter,object,bool) 0x001fc
  at
 System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteValue
 (System.IO.BinaryWriter,System.Type,object) 0x00118
  at PNUnitTestResult__TypeMetadata.WriteObjectData
 (System 
 .Runtime 
 .Serialization 
 .Formatters.Binary.ObjectWriter,System.IO.BinaryWriter,object)
 0x000a4
  at
 System 
 .Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject
 (System.IO.BinaryWriter,long,object) 0x00338
  at
 System 
 .Runtime 
 .Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance
 (System.IO.BinaryWriter,object,bool) 0x001fc
  at
 System 
 .Runtime 
 .Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects
 (System.IO.BinaryWriter) 0x00034
  at
 System 
 .Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph
 (System 
 .IO.BinaryWriter,object,System.Runtime.Remoting.Messaging.Header[])
 0x00050
  at
 System 
 .Runtime 
 .Serialization.Formatters.Binary.MessageFormatter.WriteMethodCall
 (System 
 .IO 
 .BinaryWriter 
 ,object 
 ,System 
 .Runtime 
 .Remoting 
 .Messaging 
 .Header 
 [],System.Runtime.Serialization.Formatters.Binary.BinaryFormatter)
 0x006b4
  at
 System 
 .Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
 (System.IO.Stream,object,System.Runtime.Remoting.Messaging.Header[])
 0x0014c
  at
 System 
 .Runtime 
 .Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage
 (System.Runtime.Remoting.Messaging.IMessage) 0x001fc
  at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke
 (System.Runtime.Remoting.Messaging.IMessage) 0x00478
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke
 (System 
 .Runtime 
 .Remoting 
 .Proxies 
 .RealProxy 
 ,System 
 .Runtime.Remoting.Messaging.IMessage,System.Exception,object[])
 0x00430
  at (wrapper runtime-invoke)
 Module.runtime_invoke_object_object_object_Exception_object[]
 (object,intptr,intptr,intptr) 0x
  at (wrapper managed-to-native)
 object.__icall_wrapper_mono_remoting_wrapper (intptr,intptr) 0x4
  at (wrapper managed-to-native)
 object.__icall_wrapper_mono_remoting_wrapper (intptr,intptr)  
 0x
  at (wrapper remoting-invoke) PNUnit.Launcher.Runner.NotifyResult
 (string,NUnit.Core.TestResult) 0x
  at PNUnit.Agent.PNUnitTestRunner.ThreadProc () 0x00428
  at (wrapper delegate-invoke) Module.invoke_void__this__ ()  
 0x
  at System.Threading.Thread.StartUnsafe () 0x0008c
  at (wrapper delegate-invoke) Module.invoke_void__this__ ()  
 0x
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__
 (object,intptr,intptr,intptr) 0x
 Abort (core dumped)


Re: [Mono-dev] Fwd: register content changed

2010-10-11 Thread Zoltan Varga
Hi,

  It looks like an assertion in libgc, in solaris_threads.c. No idea what it
means.

   Zoltan

On Mon, Oct 11, 2010 at 11:02 AM, Dick Porter dpor...@codicesoftware.comwrote:

 Hi all

 We're getting this assertion occasionally on Solaris.  I don't have a
 particular test case, but does anyone know what it means?

 - Dick


 Begin forwarded message:

  From: psant...@codicesoftware.com psant...@codicesoftware.com
  Date: 10 October 2010 10:53:13 AMBST
  To: Dick Porter dpor...@codicesoftware.com
  Subject: register content changed
 
  got this running on Solaris. It happened to me several times in the
  past, randomly, both in SPARC and x86
 
  0: 0 - 0
  1: 92 - 0
  2: 0 - 0
  3: 0 - 0
  4:  - 0
  5: fd3d1af4 - 0
  6: 0 - 0
  7: fe7f3400 - 0
  8: 0 - 0
  9: 1201c90 - 0
  10: 0 - 0
  11: 0 - 0
  12: 0 - 0
  13: 0 - 0
  14: fc623d68 - 0
  15: fed94070 - 0
  16: 1 - 0
  17: 0 - 0
  18: 0 - 0
  19: 0 - 0
  20: 0 - 0
  21: 0 - 0
  22: 0 - 0
  23: 0 - 0
  24: fe7f3400 - 0
  25: 0 - 0
  26: 0 - 0
  27: ff01 - 0
  28: feeb60f0 - 0
  29: 1 - 0
  30: fc623dc8 - 0
  31: fed95cd8 - 0
  32: fe401003 - 0
  33: fed9c580 - 0
  34: fed9c584 - 0
  35: 0 - 0
  36: 0 - 0
  37: 0 - 0
  Register contents changed
  Stacktrace:
 
   at (wrapper managed-to-native)
  object.__icall_wrapper_mono_array_new_specific (intptr,int) 0x4
   at (wrapper managed-to-native)
  object.__icall_wrapper_mono_array_new_specific (intptr,int)
  0x
   at System.Reflection.Emit.ILGenerator..ctor
  (System.Reflection.Module,System.Reflection.Emit.TokenGenerator,int)
  0x00020
   at System.Reflection.Emit.ConstructorBuilder.GetILGenerator (int)
  0x000c0
   at System.Reflection.Emit.ConstructorBuilder.GetILGenerator ()
  0xc
   at
  System
  .Runtime
  .Serialization
  .Formatters.Binary.CodeGenerator.GenerateMetadataTypeInternal
  (System.Type,System.Runtime.Serialization.StreamingContext) 0x001b8
   at
  System
  .Runtime
  .Serialization.Formatters.Binary.CodeGenerator.GenerateMetadataType
  (System.Type,System.Runtime.Serialization.StreamingContext) 0x00048
   at
  System
  .Runtime
  .Serialization.Formatters.Binary.ObjectWriter.CreateMemberTypeMetadata
  (System.Type) 0x00048
   at
  System
  .Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData
  (object
  ,System.Runtime.Serialization.Formatters.Binary.TypeMetadata,object)
  0x005d4
   at
  System
  .Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject
  (System.IO.BinaryWriter,long,object) 0x0001c
   at
  System
  .Runtime
  .Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance
  (System.IO.BinaryWriter,object,bool) 0x001fc
   at
  System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteValue
  (System.IO.BinaryWriter,System.Type,object) 0x00118
   at PNUnitTestResult__TypeMetadata.WriteObjectData
  (System
  .Runtime
  .Serialization
  .Formatters.Binary.ObjectWriter,System.IO.BinaryWriter,object)
  0x000a4
   at
  System
  .Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject
  (System.IO.BinaryWriter,long,object) 0x00338
   at
  System
  .Runtime
  .Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance
  (System.IO.BinaryWriter,object,bool) 0x001fc
   at
  System
  .Runtime
  .Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects
  (System.IO.BinaryWriter) 0x00034
   at
  System
  .Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph
  (System
  .IO.BinaryWriter,object,System.Runtime.Remoting.Messaging.Header[])
  0x00050
   at
  System
  .Runtime
  .Serialization.Formatters.Binary.MessageFormatter.WriteMethodCall
  (System
  .IO
  .BinaryWriter
  ,object
  ,System
  .Runtime
  .Remoting
  .Messaging
  .Header
  [],System.Runtime.Serialization.Formatters.Binary.BinaryFormatter)
  0x006b4
   at
  System
  .Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
  (System.IO.Stream,object,System.Runtime.Remoting.Messaging.Header[])
  0x0014c
   at
  System
  .Runtime
  .Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage
  (System.Runtime.Remoting.Messaging.IMessage) 0x001fc
   at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke
  (System.Runtime.Remoting.Messaging.IMessage) 0x00478
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke
  (System
  .Runtime
  .Remoting
  .Proxies
  .RealProxy
  ,System
  .Runtime.Remoting.Messaging.IMessage,System.Exception,object[])
  0x00430
   at (wrapper runtime-invoke)
  Module.runtime_invoke_object_object_object_Exception_object[]
  (object,intptr,intptr,intptr) 0x
   at (wrapper managed-to-native)
  object.__icall_wrapper_mono_remoting_wrapper (intptr,intptr) 0x4
   at (wrapper managed-to-native)
  object.__icall_wrapper_mono_remoting_wrapper (intptr,intptr)
  0x
   at (wrapper remoting-invoke) PNUnit.Launcher.Runner.NotifyResult
  (string,NUnit.Core.TestResult) 0x
   at PNUnit.Agent.PNUnitTestRunner.ThreadProc () 0x00428
   at (wrapper delegate-invoke) 

Re: [Mono-dev] Fwd: register content changed

2010-10-11 Thread Burkhard Linke
Hi,

On Monday 11 October 2010 09:14:59 Zoltan Varga wrote:
 Hi,

   It looks like an assertion in libgc, in solaris_threads.c. No idea what
 it means.

Not sure about the assertion itself, but for running mono in Solaris you 
should use the latest Boehm GC. The bundled version is somewhat outdated.

I've applied a little patch to enable using Boehm GC 7.2 or later. These 
versions require an additional setup step of automatic registration of 
threads. Not sure whether the patch still applies to Mono 2.8.

Best regards,

Burkhard Linke


Index: configure.in
===
--- configure.in	(revision 157935)
+++ configure.in	(working copy)
@@ -859,6 +859,13 @@
 		if test x$found_gc_enable = xyes; then
 			AC_DEFINE(HAVE_GC_ENABLE, 1, [Have 'GC_enable'])
 		fi
+
+		# check whether we need to explicitly allow
+		# thread registering
+		AC_CHECK_LIB(gc, GC_allow_register_threads, found_allow_register_threads=yes,,$libdl)
+		if test x$found_allow_register_threads = xyes; then
+			AC_DEFINE(HAVE_GC_ALLOW_REGISTER_THREADS, 1, [GC requires thread registration])
+		fi
 		;;
 
 	xincluded)
Index: mono/metadata/boehm-gc.c
===
--- mono/metadata/boehm-gc.c	(revision 157935)
+++ mono/metadata/boehm-gc.c	(working copy)
@@ -123,6 +123,10 @@
 #ifdef HAVE_GC_GCJ_MALLOC
 	GC_init_gcj_malloc (5, NULL);
 #endif
+#ifdef HAVE_GC_ALLOW_REGISTER_THREADS
+	GC_allow_register_threads();
+#endif
+
 	mono_gc_enable_events ();
 	gc_initialized = TRUE;
 }
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] F# Interactive on Mono 2.8 (DefineDynamicAssembly troubles)

2010-10-11 Thread Tomas Petricek
Hi,
I was trying to run the F# Interactive on Mono 2.8 (on both Mac and
Windows) and I'm having some issues. F# Interactive is essentially a
REPL tool that allows you to enter some F# code and compiles it on the
fly using System.Reflection (in case someone wanted to reproduce that,
there is a download on Microsoft web site [1] and now also packages
for various Linux distributions and Mac [2].

I tried entering a simple F# snippet that declares a type (this
creates a class under the cover using Reflection.Emit and then uses
Reflection again to find some information about the created class and
prints it). On Mono 2.6.7, this behaves as expected:

 type Foo = | Bar of int;;
type Foo = | Bar of int

The first line is my input which defines a discriminated union type
and the second line shows information about the type printed later by
F# Interactive. When I try the same thing on Mono 2.8, I get an
exception:

 type Foo = | Bar of int;;
error FS0193: Operation is not supported.

I looked into the F# source code (which is available with the oficial
release [1] and can be actually compiled, but has currently an
annoying license limiations) and I find out that this is caused by a
NotSupportedException thrown from GetConstructorImpl in
System.Reflection.MonoGenericClass. Apparently, this exception is
thrown when IsCompilerContext is false (but looking at Mono sources,
I'm not quite sure what this property means). I was trying to
understand how can this become true and I noticed that there is a
check for some special flag in the constructor of AssemblyBuilder:

internal AssemblyBuilder (AssemblyName n, string directory,
AssemblyBuilderAccess access, bool corlib_internal) {
is_compiler_context = (access  COMPILER_ACCESS) != 0;
// ...
}

I couldn't find any documentation on this flag anywhere, so I'm a bit
confused. However, I tried modifying the public F# sources to pass the
flag when creating a dynamic assembly (the value COMPILER_ACCESS is a
private constant with value 0x800). It feels like a horrible hack,
because I just need to pass some magical constant converted to an
enum value, but it does the trick and F# Interactive works just fine
after the change... The C# translation of the change I did would look
like this:

// The original code (throws NotSupportedException in GetConstrucorImpl)
var dyn = domain.DefineDynamicAssembly(asmName,
AssemblyBuilderAccess.RunAndSave, .)

// Pass the magic flag to the assembly builder (works fine!)
var dyn = domain.DefineDynamicAssembly(asmName,
AssemblyBuilderAccess.RunAndSave | (AssemblyBuilderAccess)0x800, .)

Is this some kind of special flag that the F# compiler should pass to
the DefineDynamicAssembly or is there another way to fix the issue
(without passing magical constants as arguments)? Should I send this
information to the F# team, so that they can make the next release of
F# working on Mono 2.8, or is this something that can be changed in
the next Mono release?

Thanks!
Tomas Petricek

[1] 
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=f8c623ae-aef6-4a06-a185-05f59be47d67displaylang=en
[2] http://fsxplat.codeplex.com/releases/view/51797
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] F# Interactive on Mono 2.8 (DefineDynamicAssembly troubles)

2010-10-11 Thread Rodrigo Kumpera
Hi Tomas,

On Mon, Oct 11, 2010 at 9:58 AM, Tomas Petricek tomas.petri...@gmail.comwrote:

 Hi,
 Is this some kind of special flag that the F# compiler should pass to
 the DefineDynamicAssembly or is there another way to fix the issue
 (without passing magical constants as arguments)? Should I send this
 information to the F# team, so that they can make the next release of
 F# working on Mono 2.8, or is this something that can be changed in
 the next Mono release?


CompilerContext is a special SRE mode that enables some extra features that
mcs
used to require. Since the 2.8 release mcs no longer requires it and this is
going away
for the 3.0 release. Else so, this is an internal flag that it's not meant
for general use.

The Operation is not supported problem is caused by F# using an instance
of a TypeBuilder
instead of a runtime type. Somewhere in the guts of mono' s SR(E) where
doing something
different from what F# expect and everything breaks.

There is a bugzilla entry tracking this problem:
https://bugzilla.novell.com/show_bug.cgi?id=419828
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] libgdiplus-2.8 - no need to go long long

2010-10-11 Thread Ralph Leckett
In libgdiplus-2.8, the following is dumb:

unsigned long long int size;

size = bmi.biWidth;
size *= 4;
if (size  G_MAXINT32)
goto error;

The following is a better way:

long size;

size = bmi.biWidth;
if (size  G_MAXINT32 / 4)
goto error;
size *= 4;
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] libgdiplus-2.8 - no need to go long long

2010-10-11 Thread Alexander Shulgin
On 11.10.2010 18:56, Ralph Leckett wrote:
 In libgdiplus-2.8, the following is dumb:

   unsigned long long int size;

   size = bmi.biWidth;
   size *= 4;
   if (size  G_MAXINT32)
   goto error;

 The following is a better way:

   long size;

   size = bmi.biWidth;
   if (size  G_MAXINT32 / 4)
   goto error;
   size *= 4;

Yes, you are right, but make it a patch, so a committer won't need to 
find the file and line where to change this.

--
Alex
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Retrieving file type names.

2010-10-11 Thread naurispunk

Hi

Im trying to create a function (Function GetFileTypeName(Extension As
String) as String) that returns file type name -  the one you can see under
file Properties (Basic tab). For example text file would have something like
plain text document (text/plain). 

As far as I can understand information about file type captions are kept in
more than one place in xml files:
/usr/share/mime
/usr/local/share/mime
~/.local/share/mime
-- 
View this message in context: 
http://mono.1490590.n4.nabble.com/Retrieving-file-type-names-tp2989743p2989743.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Problem running mkbundle using cygwin/windows

2010-10-11 Thread Robert Jordan
Hey,

On 11.10.2010 18:43, Patrick Kowalzick wrote:
 Dear List,

 I get an error running mkbundle using cygwin/windows. I installed
 mono-2.8, cygwin 1.7 (gcc-mingw, mingw-zlib) and set up the paths in my
 .bashrc.

 A test run looks like:

...


 temp.c: In function `main':
 temp.c:170: warning: implicit declaration of function `g_utf16_to_utf8'

...


 Any ideas what is missing? (I'd guess a header with a valid definition
 of g_utf16_to_utf8, but I was not able to figure out where to find it).

Mono 2.8 has switched to its own eglib (embedded glib).
This means that every tool that depends on glib (like mkbundle)
does not work anymore, especially on platforms that don't come
with glib (Windows, Mac OSX).

A simple workaround would be to comment out all #ifdef _WIN32 blocks
from mcs/tools/mkbundle/template_main.c and recompile mkbundle.

If you can't recompile, using mkbundle's -c option and a manual
compilation after you've changed to output accordingly should
work as well.

Please file a bug.

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list