[Mono-list] Crash in mono_monitor_exit

2013-11-18 Thread Carlo Kok

Hi,

I've got a user that using latest mono on Mavericks which app crashes on
what seems to be mono_monitor_exit. Where can I start looking for what
could possibly cause this?


Crashed Thread:  16

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x, 0x

Application Specific Information:
abort() called


..
Thread 16 Crashed:
0   libsystem_kernel.dylib  0x9b486952 __pthread_kill + 10
1   libsystem_pthread.dylib 0x9000a167 pthread_kill + 101
2   libsystem_c.dylib   0x9026f40c __abort + 187
3   libsystem_c.dylib   0x9026f351 abort + 172
4   crossbox0x0028f9cc monoeg_g_logv + 188
5   crossbox0x0028f9fb monoeg_assertion_message + 43
6   crossbox0x002718a4
_wapi_handle_set_signal_state + 596
7   crossbox0x00271bb5 sem_release + 261
8   crossbox0x00201b35 mono_monitor_exit + 117
9   crossbox0x000e92c1 mono_monitor_exit_trampoline
+ 17
10  ??? 0x00479b4c 0 + 4692812
11  ??? 0x02e0ebd4 0 + 48294868
12  ??? 0x02e0eac8 0 + 48294600
13  ??? 0x02e0e714 0 + 48293652
14  ??? 0x02e0d8fc 0 + 48290044
15  ??? 0x02e0d614 0 + 48289300
16  ??? 0x02e0d5f8 0 + 48289272
17  ??? 0x02769d6b 0 + 41327979
18  ??? 0x00554d9d 0 + 5590429
19  crossbox0x0004b4ee mono_jit_runtime_invoke + 798
20  crossbox0x0020504e mono_runtime_invoke + 126
21  crossbox0x002051bc mono_runtime_delegate_invoke
+ 140
22  crossbox0x001dc7f5 async_invoke_thread + 2165
23  crossbox0x001d5474 start_wrapper + 468
24  crossbox0x0027aeca thread_start_routine + 154
25  crossbox0x0028b411 inner_start_thread + 65
26  libsystem_pthread.dylib 0x900095fb _pthread_body + 144
27  libsystem_pthread.dylib 0x90009485 _pthread_start + 130
28  libsystem_pthread.dylib 0x9000ecf2 thread_start + 34


(full log at
http://talk.remobjects.com/uploads/default/45/1a31a25a21082b12.txt)

--
Carlo Kok
RemObjects Software
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Lockup with callstack on osx (2.10.9)

2012-09-21 Thread Carlo Kok

Op 10-9-2012 20:49, Rodrigo Kumpera schreef:

Do you have a reproducible test case? Please file a bug report with it.





Not really. only happens in a heavy (tied to lots of internal things) 
application when mono.security is used. Hence I'm asking how i can 
narrow this down

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


[Mono-list] Lockup with callstack on osx (2.10.9)

2012-09-10 Thread Carlo Kok
I have an ever growing set of threads stuck in this pattern: 
http://pastebin.com/raw.php?i=GgrmkWWU


I checked the mono sources, this seems to be the code:

http://pastebin.com/6kVBXz6U (CHECK_OBJECT)

it gets stuck in. I see no reason 6 threads should be there. I'm using 
Mono.Security which calls delegate.BeginInvoke for it's callbacks. What 
can I do to narrow down what causes this?


Mono/OSX 2.10.9

Carlo Kok
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] simple socket code on osx fails to flush

2012-08-29 Thread Carlo Kok
I'm probably missing something simple, but this following code on OSX 
sometimes doesn't properly send every bit before closing when talking to 
OSX from Windows (over network).


At first I thought it was my network but a colleague had at the same 
issue at home. What am I missing? If i set a breakpoint on the shutdown 
(in monodevelop) it does end up sending everything.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading;
using System.Net.Sockets;
namespace msock
{

class Program {
static void Main (string[] args)
{
TcpListener t = new TcpListener (1118);
t.Start ();
while (true) {
var socket = t.AcceptSocket();

var x = new byte[130400];
for (int i = 0; i  x.Length; i ++)
x[i] = (byte)((int)('a')+(i % 26));
x[x.Length-4] = (int)'D';x[x.Length-3] = 
(int)'O';x[x.Length-2] = (int)'N';x[x.Length-1] = (int)'E';


SocketError er;
int n;
n= socket.Send(x, 0, x.Length, 
SocketFlags.None, out er);

socket.Shutdown(SocketShutdown.Both);
socket.Close();
}
}
}
}
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Packaging for Iron* non-core parts of the DLR

2010-11-10 Thread Carlo Kok
Given that the DLR and IronRuby, IronPython are now being maintained by 
(among others), parts of the mono team, will there be any plans for 
proper, strong name signed, versions of the Iron* code and the non-core 
parts of DLR?

We currently compile  sign our own for our JavaScript implementation, 
however it would be better if there was a standard version used by everyone.

--
Carlo Kok
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-dev] License compiler for mono (the actual tool)

2009-10-21 Thread Carlo Kok

On 10/17/2009 12:35 AM, Gonzalo Paniagua Javier wrote:


I'm afraid I have no idea how to do that. I've never created a MAN file.


Use one from mono/man as a template and don't be afraid :-)



heh,

attached is an lc.1 file that contains the man page for lc. Also 
attached is a patch for trunk to support the resourceAssembly parameter 
for runtime license.


--
Carlo Kok

RemObjects Software
The Infrastructure Company
http://www.remobjects.com
.\ 
.\ lc manual page.
.\ (C) 2009 Carlo Kok
.\  
.\ Author:
.\   Carlo Kok (c...@remobjects.com)
.\
.de Sp \ Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.TH lc lc for mono 2.0
.SH NAME
lc \- Mono License Compiler
.SH SYNOPSIS
.PP
.B lc -c filename -t targetassembly [-i reference...] [-v] [-o outputpath] 
[-nologo]
.SH DESCRIPTION
\fIlc\fP tool is a license compiler for Mono. It's used to convert a 
licenses.licx file to a resource that can be embedded into an executable. 
.PP
When using commercial components for .NET they often require a license
resource at runtime to make sure the developer was licensed to use this 
control. The most common way of making sure the component was properly
licensed is by using license resources. At compile time the developer
uses the \fIlc\fp tool to convert a licenses.licx file to a 
programname.exe.resources file and embed that as a managed resource 
during compilation.
.SH RUNTIME OPTIONS
The following options are available:
.TP
\fB--complist=filename\fR, \fB-c filename\fR
This option is used to specify the input file, the licenses.licx file
to create a license reesource for. This option is required. The license 
compiler will read each line in this file and try to load the types
specified on that line.
.TP
\fB--target=assemblyname\fR, \fB-t targetassembly\fR
full assembly name with file extension for the target assembly. The
license compiler uses this as a key when compiling the licenses. It
has to match the assembly the resource will be embedded in. This option
is required.
.TP
\fB--load=reference\fR, \fB-i reference\fR
Assembly reference to load before trying to compile a license. This
option is needed for assemblies where the references are not in the 
gac. Compilers should pass all references to the license compiler.
.TP
\fB--verbose,\fR, \fB-v\fR
Gives more verbose output about the license compiling process.
.TP
\fB--help\fR, \fB-h\fR
Displays usage instructions.
.TP
\fB--output=path\fR, \fB-o path\fR
Target path file the licenses resource. By default the license
compiler emits the resource in the current directory. The filename
will always match the target assembly passed to --target with .licenses 
added.
.TP
\fB--nologo\fR
Do not emit the Mono License Compiler logo  on stdout while compilng.

.SH LICENSE FILES
The format for the license files (licenses.licx) is the following:
.nf
# comment
namespace.type, assemblyname
namespace.type, full-assemblyname
.fi
.Sp
All lines starting with a # are ignored. the first form requires
that the assembly was loaded through the --load,-i option but
does not require the full assembly name, only the first part.

The second form requires the full assembly name including locale,
version and publickeytoken.

.SH MAILING LISTS
Mailing lists are listed at the
http://www.mono-project.com/Mailing_Lists
.SH WEB SITE
http://www.mono-project.com
.SH SEE ALSO
.PP
mono(1), mcs(1)

Index: Changelog
===
--- Changelog   (revision 144512)
+++ Changelog   (working copy)
@@ -1,3 +1,7 @@
+2009-10-21  Carlo Kok  c...@remobjects.com
+
+   * RuntimeLicenseContext.cs: Support for the resourceAssembly parameter.
+
 2009-10-12  Carlo Kok  c...@remobjects.com
 
* DesigntimeLicenseContextSerializer.cs: Properly serialize licenses.
Index: RuntimeLicenseContext.cs
===
--- RuntimeLicenseContext.cs(revision 144512)
+++ RuntimeLicenseContext.cs(working copy)
@@ -44,6 +44,7 @@
 {
internal class RuntimeLicenseContext : LicenseContext
{
+private Hashtable extraassemblies;
private Hashtable keys;
 
public RuntimeLicenseContext () : base ()
@@ -58,17 +59,17 @@
 
Assembly asm = Assembly.GetEntryAssembly ();
if (asm != null)
-   LoadAssemblyLicenses (asm);
+   LoadAssemblyLicenses (keys, asm);
else {
foreach (Assembly asmnode in 
AppDomain.CurrentDomain.GetAssemblies ()) {
-   if (String.Compare 
(asmnode.GetName().Name, App_Licenses, true) == 0)
-   LoadAssemblyLicenses (asmnode);
+   LoadAssemblyLicenses (keys, 
asmnode

Re: [Mono-dev] License compiler for mono (the actual tool)

2009-10-16 Thread Carlo Kok
On 10/16/2009 5:20 AM, Gonzalo Paniagua Javier wrote:
 On Tue, 2009-10-13 at 15:43 +0200, Carlo Kok wrote:
 attached to this mail is a (working) license compiler for mono (converts
 a licx file to a .licenses file that can be embedded as a resource).
 Works with the patch I sent earlier but also without (has a temporary
 workaround for that). It accepts the same cmdline arguments as the .NET
 lc.exe and makes it possible to compile these files as required for any
 project that uses commercial components that use license files (most do).

 The program.cs file contains the actual logic. It uses Options.cs from
 the mono/windows install (ndesk.options) for the command line parsing.

 This is now in mcs/tools/lc (trunk and mono-2-6).

 Thanks a lot!

Very cool. This will end up as an executable for future binary builds?

 -Gonzalo

 P.S.: btw, care to contribute a manual page for it?

I'm afraid I have no idea how to do that. I've never created a MAN file.

 On Tue, 2009-10-13 at 13:49 +0200, Carlo Kok wrote:
  The attached patch implements the loading into the runtime license
  context to allow pre-compiled websites  applications with licenses to
  properly run.
 
  It also implements the DesignTimeLicenseContext serialization support so
  once an LC compiler is written it can actually generate licenses.
 This is in svn now (trunk, mono-2-4 and mono-2-6). I had to make 'keys'
 internal for the patch to compile...

Sorry about that, that's what was supposed to be in the diff.

-- 
Carlo Kok

RemObjects Software
The Infrastructure Company
http://www.remobjects.com
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] [patch] implements RuntimeLicenseContext (Deserialization) design time serialization

2009-10-13 Thread Carlo Kok
The attached patch implements the loading into the runtime license 
context to allow pre-compiled websites  applications with licenses to 
properly run.


It also implements the DesignTimeLicenseContext serialization support so 
once an LC compiler is written it can actually generate licenses.



comments appreciated.

--
Carlo Kok

RemObjects Software
The Infrastructure Company
http://www.remobjects.com
Index: Changelog
===
--- Changelog   (revision 144003)
+++ Changelog   (working copy)
@@ -1,3 +1,8 @@
+2009-10-12  Carlo Kok  c...@remobjects.com
+
+   * DesigntimeLicenseContextSerializer.cs: Properly serialize licenses.
+   * RuntimeLicenseContext.cs: Properly deserialize licenses.
+
 2008-06-18  Ivan N. Zlatev  cont...@i-nz.net
 
* ServiceContainer.cs: Lazy initialize the services hashtable so that 
Index: DesigntimeLicenseContextSerializer.cs
===
--- DesigntimeLicenseContextSerializer.cs   (revision 144003)
+++ DesigntimeLicenseContextSerializer.cs   (working copy)
@@ -4,9 +4,11 @@
 // Authors:
 //   Martin Willemoes Hansen (m...@sysrq.dk)
 //   Andreas Nahr (classdevelopm...@a-softtech.com)
+//   Carlo Kok  (c...@remobjects.com)
 //
 // (C) 2003 Martin Willemoes Hansen
 // (C) 2003 Andreas Nahr
+// (C) 2009 Carlo Kok
 //
 
 //
@@ -31,6 +33,8 @@
 //
 
 using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.Collections;
 
 namespace System.ComponentModel.Design
 {
@@ -41,12 +45,23 @@
{
}
 
-   [MonoTODO]
public static void Serialize (Stream o,
  string cryptoKey,
  DesigntimeLicenseContext context)
{
-   throw new NotImplementedException();
+Object[] lData = new Object [2];
+lData [0] = cryptoKey;
+Hashtable lNewTable = new Hashtable();
+foreach (DictionaryEntry et in context.keys)
+{
+lNewTable.Add(((Type)et.Key).AssemblyQualifiedName, et.Value);
+}
+lData[1] = lNewTable;
+
+BinaryFormatter lFormatter = new BinaryFormatter ();
+lFormatter.Serialize (o, lData);
+
}
+   
}
 }
Index: RuntimeLicenseContext.cs
===
--- RuntimeLicenseContext.cs(revision 144003)
+++ RuntimeLicenseContext.cs(working copy)
@@ -5,10 +5,12 @@
 //   Ivan Hamilton (i...@chimerical.com.au)
 //   Martin Willemoes Hansen (m...@sysrq.dk)
 //   Andreas Nahr (classdevelopm...@a-softtech.com)
+//   Carlo Kok  (c...@remobjects.com)
 //
 // (C) 2004 Ivan Hamilton
 // (C) 2003 Martin Willemoes Hansen
 // (C) 2003 Andreas Nahr
+// (C) 2009 Carlo Kok
 //
 
 //
@@ -35,26 +37,77 @@
 using System.ComponentModel;
 using System.Reflection;
 using System.Collections;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
 
 namespace System.ComponentModel.Design
 {
internal class RuntimeLicenseContext : LicenseContext
{
-   private Hashtable keys = new Hashtable ();
+   private Hashtable keys;
 
-   public RuntimeLicenseContext () : base()
+   public RuntimeLicenseContext () : base ()
{
}
 
+private void loadKeys ()
+{
+if (keys != null) return;
+keys = new Hashtable ();
+
+Assembly asm = Assembly.GetEntryAssembly ();
+if (asm != null)
+loadAssemblyLicenses (asm);
+else {
+foreach (Assembly asmnode in 
AppDomain.CurrentDomain.GetAssemblies ()) {
+if (String.Compare (asmnode.GetName().Name, 
App_Licenses, true) == 0)
+loadAssemblyLicenses (asmnode);
+}
+}
+}
+
+private void loadAssemblyLicenses (Assembly asm)
+{
+string asmname = Path.GetFileName (asm.Location);
+string resourcename = asmname + .licenses;
+try
+{
+foreach (string name in asm.GetManifestResourceNames ())
+{
+if (name == resourcename) {
+using (Stream stream = asm.GetManifestResourceStream 
(name))
+{
+BinaryFormatter formatter = new BinaryFormatter ();
+object[] res = formatter.Deserialize (stream) as 
object[];
+if (String.Compare ((string) res[0], asmname, 
true) == 0)
+{
+Hashtable table = (Hashtable) res[1];
+foreach (DictionaryEntry et in table

[Mono-dev] [PATCH] cecil emitting 4.0 dlls properly

2009-07-13 Thread Carlo Kok
While Cecil can currently load 4.0 dlls, it does not properly emit the 
headers  detect running on a 4.0 runtime. The attached patch fixes that.



--
Carlo Kok

RemObjects Software
The Infrastructure Company
http://www.remobjects.com
Index: ChangeLog
===
--- ChangeLog   (revision 137766)
+++ ChangeLog   (working copy)
@@ -1,3 +1,11 @@
+2009-07-13  Carlo Kok  c...@remobjects.com
+
+   * Mono.Cecil.Binary/ImageWriter.cs
+   * Mono.Cecil.Metadata/MetadataWriter.cs
+   * Mono.Cecil/AssemblyFactory.cs
+   * Mono.Cecil/AssemblyInfo.cs: Support for properly writing 4.0 dlls.
+
+
 2009-06-05  Jb Evain  jbev...@novell.com
 
* Mono.Cecil/BaseAssemblyResolver.cs: properly look for the 4.0 corlib
Index: Mono.Cecil.Binary/ImageWriter.cs
===
--- Mono.Cecil.Binary/ImageWriter.cs(revision 137766)
+++ Mono.Cecil.Binary/ImageWriter.cs(working copy)
@@ -317,7 +317,7 @@
{
m_textWriter.Write (header.Cb);
 
-   if (m_mdWriter.TargetRuntime == TargetRuntime.NET_2_0) {
+   if (m_mdWriter.TargetRuntime = TargetRuntime.NET_2_0) {
m_textWriter.Write ((ushort) 2);
m_textWriter.Write ((ushort) 5);
} else {
Index: Mono.Cecil.Metadata/MetadataWriter.cs
===
--- Mono.Cecil.Metadata/MetadataWriter.cs   (revision 137766)
+++ Mono.Cecil.Metadata/MetadataWriter.cs   (working copy)
@@ -465,6 +465,7 @@
heap.MajorVersion = 1;
heap.MinorVersion = 0;
break;
+   case TargetRuntime.NET_4_0 :
case TargetRuntime.NET_2_0 :
heap.MajorVersion = 2;
heap.MinorVersion = 0;
Index: Mono.Cecil/AssemblyFactory.cs
===
--- Mono.Cecil/AssemblyFactory.cs   (revision 137766)
+++ Mono.Cecil/AssemblyFactory.cs   (working copy)
@@ -93,10 +93,12 @@
static TargetRuntime CurrentRuntime ()
{
Version corlib = typeof (object).Assembly.GetName 
().Version;
-   if (corlib.Major == 1)
+   if(corlib.Major == 1)
return corlib.Minor == 0 ? 
TargetRuntime.NET_1_0 : TargetRuntime.NET_1_1;
-   else // if (corlib.Major == 2)
+   else if(corlib.Major == 2)
return TargetRuntime.NET_2_0;
+   else //if (corlib.Major == 4)
+   return TargetRuntime.NET_4_0;
}
 
public static AssemblyDefinition DefineAssembly (string name, 
AssemblyKind kind)
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-list] stetic on windows

2007-10-31 Thread Carlo Kok
I read somewhere Stetic can also be used standalone. Is it possible to 
use this on Windows for GTK# form design?

--
Carlo Kok
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Hashtable behaviour

2006-09-05 Thread Carlo Kok
Glen Ford wrote:
 
 Has else anyone noticed the following on mono 1.1.16.1 ...
 
 Hashtable table = new Hashtable();
 int myvalue = (int)table[32];
 
 Generates an exception:
 
 Unhandled Exception: System.NullReferenceException: Object reference not
 set to an instance of an object
 
 
 However the following doesn't ...
 
 Hashtable table = new Hashtable();
 string myvalue = (string)table[blah];
 
 
 I would have expected a NullReferenceException in the second case as well.

Same happens on .NET. First one is an unbox operation and unboxing
requires an instance (it's a valuetype). Second is a cast operation.
((string)null) is perfectly valid.

--
Carlo Kok
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] sigsegv under trampoline

2005-11-15 Thread Carlo Kok
when executing my application, it throws a SIGSEGV while trying to jit 
InitializeComponent. Mono svn checked out this morning.


How do I get more useful information so I can post a bugzilla report on 
this?


(Note this is a 2.0 project and most likely there are properties missing 
that aren't implemented yet in winforms 2.0)


$ ~/mtmp/bin/mono MegaDemoClient.exe
Mono System.Windows.Forms Assembly [Revision: 52467; built: 2005/11/3 
12:50:32]

Keyboard: VNC keyboard layout
Gtk colorscheme read

=
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=

Stacktrace:

in 0x MegaDemoClient.Form1:.ctor ()
in 0x3e MegaDemoClient.Form1:.ctor ()
in 0xffd0 (wrapper remoting-invoke-with-check) 
MegaDemoClient.Form1:.ctor ()

in 0x18 MegaDemoClient.Form1:Main ()
in 0x50bf9899 (wrapper runtime-invoke) 
System.Object:runtime_invoke_void (object,intptr,intptr,intptr)


Native stacktrace:

/home/carlokok/mtmp/bin/mono(mono_handle_native_sigsegv+0x7f) 
[0x81383cf]

/home/carlokok/mtmp/bin/mono [0x810c2cb]
[0xe440]
/home/carlokok/mtmp/bin/mono [0x80d1d87]

/home/carlokok/mtmp/bin/mono(mono_metadata_parse_type_full+0x104) 
[0x80d2064]
/home/carlokok/mtmp/bin/mono(mono_metadata_parse_mh_full+0x3fc) 
[0x80d2cbc]
/home/carlokok/mtmp/bin/mono(mono_method_get_header+0xa7) 
[0x80d8f67]

/home/carlokok/mtmp/bin/mono [0x8124b42]
/home/carlokok/mtmp/bin/mono [0x812652b]
/home/carlokok/mtmp/bin/mono(mono_magic_trampoline+0x12) 
[0x81395d2]

[0xb7c2a032]
[0xb7497b82]
[0xb7497b31]
[0xb7496c0e]
/home/carlokok/mtmp/bin/mono(mono_runtime_exec_main+0x52) 
[0x8090482]
/home/carlokok/mtmp/bin/mono(mono_runtime_run_main+0x15e) 
[0x8092dae]

/home/carlokok/mtmp/bin/mono(mono_main+0x1002) [0x805d472]
/lib/tls/libc.so.6(__libc_start_main+0xd0) [0xb7d5de40]
/home/carlokok/mtmp/bin/mono [0x805bf41]
Aborted


--
Carlo Kok
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] sigsegv under trampoline

2005-11-15 Thread Carlo Kok

Carlo Kok wrote:
when executing my application, it throws a SIGSEGV while trying to jit 
InitializeComponent. Mono svn checked out this morning.


How do I get more useful information so I can post a bugzilla report on 
this?


(Note this is a 2.0 project and most likely there are properties missing 
that aren't implemented yet in winforms 2.0)




snip

Solved with help from Lupus on #mono. A class was missing for 2.0

--
Carlo Kok
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] generic KeyedCollection implementation

2005-10-19 Thread Carlo Kok
Attached to this email an incremental patch for the KeyedCollection ( to 
be applied in the \mcs\class\corlib\System.Collections.ObjectModel 
directory. Also included is a testcase, tested with both Beta2 and my 
own implementation.


I followed the existing testcases I could find in SVN. The two almost 
idental guides on the wiki seem to be out of date:


http://www.mono-project.com/Test_Suite
http://www.mono-project.com/Mono_Contribution_HOWTO

comments?

I used the SVN Patch ability of tortoisesvn, if I did that wrong, please 
tell me what I should use instead.


--
Carlo Kok
Index: Collection.cs
===
--- Collection.cs   (revision 51865)
+++ Collection.cs   (working copy)
@@ -68,11 +68,17 @@
 
public void Add (T item)
{
-   list.Add (item);
+   int idx = list.Count;
+   InsertItem (idx, item);
}
 
public void Clear ()
{
+   ClearItems ();
+   }
+
+   protected virtual void ClearItems ()
+   {
list.Clear ();
}
 
@@ -98,16 +104,32 @@
 
public void Insert (int index, T item)
{
+   InsertItem (index, item);
+   }
+
+   protected virtual void InsertItem (int index, T item)
+   {
list.Insert (index, item);
}
 
public bool Remove (T item)
{
-   return list.Remove (item);
+   int idx = IndexOf (item);
+   if (idx == -1) 
+   return false;
+   
+   RemoveItem (idx);
+   
+   return true;
}
 
public void RemoveAt (int index)
{
+   RemoveItem (index);
+   }
+
+   protected virtual void RemoveItem (int index)
+   {
list.RemoveAt (index);
}
 
@@ -117,12 +139,18 @@
 
public virtual T this [int index] {
get { return list [index]; }
-   set { list [index] = value; }
+   set { SetItem (index, value); }
}
 
public bool IsReadOnly {
get { return list.IsReadOnly; }
}
+
+   protected virtual void SetItem (int index, T item)
+   {
+   list[index] = item;
+   }
+

 #region Helper methods for non-generic interfaces

@@ -173,8 +201,9 @@

int IList.Add (object item)
{
-   list.Add (ConvertItem (item));
-   return list.Count - 1;
+   int idx = list.Count;
+   InsertItem (idx, ConvertItem (item));
+   return idx;
}

bool IList.Contains (object item)
@@ -193,13 +222,16 @@

void IList.Insert (int index, object item)
{
-   list.Insert (index, ConvertItem (item));
+   InsertItem (index, ConvertItem (item));
}

void IList.Remove (object item)
{
CheckWritable (list);
-   list.Remove (ConvertItem (item));
+
+   int idx = IndexOf (ConvertItem (item));
+
+   RemoveItem (idx);
}

bool ICollection.IsSynchronized {
@@ -219,7 +251,7 @@

object IList.this [int index] {
get { return list [index]; }
-   set { list [index] = ConvertItem (value); }
+   set { SetItem (index, ConvertItem (value)); }
}
 #endregion
}
Index: KeyedCollection.cs
===
--- KeyedCollection.cs  (revision 51865)
+++ KeyedCollection.cs  (working copy)
@@ -42,58 +42,167 @@
[Serializable]
public abstract class KeyedCollectionTKey, TItem : CollectionTItem
{
+   private DictionaryTKey, TItem dictionary;
+   private IEqualityComparerTKey comparer;
+   private int dictionaryCreationThreshold;
+
+   protected KeyedCollection ()
+   : this (null, 0)
+   { 
+   }
+
+   protected KeyedCollection (IEqualityComparerTKey comparer)
+   : this(comparer, 0

Re: [Mono-list] Existing non-case-sensitive .net languages?

2005-02-24 Thread Carlo Kok
Freddy BL wrote:
But still today I have no non-case-sensitive .net language seen. 
Existing such languages? And if not: Would it be possible to create one 
or don't permit the CLR it, so that native-compiler have in this point 
more freedom then .net/mono-compiler?
Chrome is case insensitive. There are some things to take in account, 
like you have to make sure the name of a method matches when overriding 
it or implementing an interface. But besides that there are no real 
limitations.

--
Carlo Kok
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] ANN: RemObjects Chrome for Mono - Public Preview available now!

2005-01-07 Thread Carlo Kok
RemObjects Software is proud to announce that the January 2005 Preview
of the free Chrome Command Line Edition for Mono is now available for
download.
Chrome is RemObjects' next generation Object Pascal language for the
.NET and Mono Platforms and it enables you to write fully managed
native applications inside the well known Visual Studio .NET IDE. While
implementing a language that stays true to the beauty and elegance of
Object Pascal, Chrome adds useful design elements from other languages
such as C#, Java and Eiffel and it introduces its own language
innovations. More information on Chrome is available at
http://www.chromesville.com.
The preview has been tested Mono version 1.0.5 and the current beta
1.1.3, and the compiler supports running Mono as well as cross-linking
against Mono from Microsoft .NET.
To help you get started with the new compiler, please check out the
article Introducing the Chrome Command Line Compiler, which will show
you how to build and debug Pascal applications for .NET and Mono using
Chrome and the .NET SDK; this article is available at
http://www.chromesville.com/?ch01.
Download the preview here: http://www.chromesville.com/downloads
Read the first Chrome article here: http://www.chromesville.com/?ch01
Join our newsgroup: news://news.remobjects.com/remobjects.public.chrome
Follow-ups set to public.chrome.
Enjoy Chrome,
The RemObjects Team
http://www.remobjects.com

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


Re: [Mono-list] Mod_mono permission issues...

2004-11-17 Thread Carlo Kok
Charles Martin wrote:
Hi all !
Could you guys help me resolving this issue with mod_mono :
I've got the following error when trying to run the demo application :
  Server error in '/demo' application

*Description: *Error processing request.
*Error Message: *HTTP 500.
*Stack Trace: * ||
System.UnauthorizedAccessException: Access to the path /root/tmp/nobody-temp-aspnet/e367c7b0 is denied.
Make sure path is set to /tmp instead of /root/tmp when starting apache 
and xsp.

--
Carlo Kok
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Mod_mono permission issues...

2004-11-17 Thread Carlo Kok
Charles Martin wrote:
Thanks for your rapid answer Carlo...
Not to sound to dumb or anything but, where/which path variable 
should I change to make that work? With apache+mono+mod_mono+xsp, there 
are SO many different configuration files that I'm a bit lost in all of 
this.
There probably is a better way. but I'd set it in the start part of the 
initscript of xsp.
 --
Carlo Kok
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Custom attributes metadata problem

2004-11-05 Thread Carlo Kok
I've managed to create an assembly (using PERWAPI) that contains an 
attribute on a field that shows up on monodis and reflector but doesn't 
show up when using the mono reflection classes nor does it work on 
microsoft .net but I have no clue on where to look on why this strange 
behaviour happens. anyone with experience on CIL metadata that can help 
me out on this?

When decompiling in ms ildasm, it shows up as:
.custom (UNKNOWN_OWNER) instance void TestNUnitChrome.x::.ctor() = ( 01 
00 00 00 )
.custom (UNKNOWN_OWNER) instance void 
[mscorlib]System.ObsoleteAttribute::.ctor() = ( 01 00 00 00 )
which is different from normally where it's after the field def.
in reflector it's there. Monodis also shows it fine. When running the 
executable it tries to use reflection to find the attributes, but cannot 
find it.

I've uploaded a zip file with the exe and .il files to:
http://carlo-kok.com/j/1.zip
anyone that can help me with this?
// If this mail arrived twice, sorry about that. something went wrong 
when sending it.

--
Carlo Kok
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list