[Mono-aspnet-list] Nhibernate3: Failed to convert parameters

2011-02-17 Thread Antoine Cailliau
Dear all,

(I'm not sure the error is due to NHibernate and not to mono. This cause 
double posting: here and on nhibernate forum.)

I setup a small web application to test nHibernate with mono and 
postgresql.

I'm facing a problem I can't find a solution. Nhibernate throws an 
ArgumentException with message failed to convert parameters.

Here is the stack trace:

System.ArgumentException: failed to convert parameters
   at System.Reflection.MonoMethod.Invoke (System.Object obj, 
BindingFlags invokeAttr, System.Reflection.Binder binder, 
System.Object[] parameters, System.Globalization.CultureInfo culture) 
[0x0] in filename unknown:0
   at System.Reflection.MonoProperty.SetValue (System.Object obj, 
System.Object value, BindingFlags invokeAttr, System.Reflection.Binder 
binder, System.Object[] index, System.Globalization.CultureInfo culture) 
[0x0] in filename unknown:0
   at System.Reflection.PropertyInfo.SetValue (System.Object obj, 
System.Object value, System.Object[] index) [0x0] in filename 
unknown:0
   at NHibernate.Properties.BasicPropertyAccessor+BasicSetter.Set 
(System.Object target, System.Object value) [0x0] in filename 
unknown:0

My project is a very simple ASP.NET MVC. The error shows up when I do 
session.save:

Product p = new Product { Name = Cool, Id = 0 };
session.Save(p);
tx.Commit();

Product is defined as:

public class Product
{
public virtual int Id { get ; set ; }
public virtual string Name { get ; set ; }
}

With the mapping

class name=Product
   id name=Id
 generator class=counter /
   /id
   property name=Name /
/class

The table is correctly created.

create table Product (
   Id int4 not null,
   Name varchar(255),
   primary key (Id)
)

Any idea on why I'm getting this error?

Thanks in advance for your help !

Antoine


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


[Mono-aspnet-list] unintentional App_Data external access Apache

2011-02-17 Thread japsai

Hi All,

I deployed a simple web project with ASP.NET MVC on a server running Ubuntu
with Apache. 

I used the Apache Mono Configuration tool, for an Application/ virtual
directory: http://go-mono.com/config-mod-mono/.

However, surfing to mydomain.com/myapp/App_Data/mydatabase.db downloads my
database? 

www-data (the apache user) has read/write permissions on App_Data, which i
think is necessary..

How do I configure this so only the typical static files (i.e. in /Content)
can be downloaded?

Thanks for any help,

Jasper
-- 
View this message in context: 
http://mono.1490590.n4.nabble.com/unintentional-App-Data-external-access-Apache-tp3311287p3311287.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list


Re: [Mono-aspnet-list] `System.Web.Mvc.AuthorizationContext' does not contain a definition for `ActionDescriptor'

2011-02-17 Thread Jesse Pasichnyk
  

Did you Copy Local the MVC related assemblies? I had some
problems when moving to asp.net 4.0 under mono, and had to remove all
those assemblies from my bin. I think this was one of the errors, but I
don't recall for sure. 

- 

Jesse 

On Thu, 17 Feb 2011 03:18:17 -0800
(PST), orhanveli wrote: 

 any idea?

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


Re: [Mono-aspnet-list] unintentional App_Data external access Apache

2011-02-17 Thread japsai

Ok, I think I figured it out. Mono seems to bypass apache Directory
containers below the main mono Location.

I was able to restrict access with 

Location /myapp/App_Data
   Deny from all
/Location

But not with similar things in a Directory container. Note that the apache
documentation warns against using Location containers to restrict filesystem
access..

It might even be wise to put this for all App_* folders in the
Configuration tool, since users coming from windows might expect that access
to these folders is restricted by default, as it says in the ASP.NET
documentation, right?

It might also be to some mistake in my apache configuration, as I'm not
exactly a crack at that stuff.


japsai wrote:
 
 Hi All,
 
 I deployed a simple web project with ASP.NET MVC on a server running
 Ubuntu with Apache. 
 
 I used the Apache Mono Configuration tool, for an Application/ virtual
 directory: http://go-mono.com/config-mod-mono/.
 
 However, surfing to mydomain.com/myapp/App_Data/mydatabase.db downloads my
 database? 
 
 www-data (the apache user) has read/write permissions on App_Data, which i
 think is necessary..
 
 How do I configure this so only the typical static files (i.e. in
 /Content) can be downloaded?
 
 Thanks for any help,
 
 Jasper
 

-- 
View this message in context: 
http://mono.1490590.n4.nabble.com/unintentional-App-Data-external-access-Apache-tp3311287p3311495.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
___
Mono-aspnet-list mailing list
Mono-aspnet-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-aspnet-list


[Mono-dev] System.Data.SQLite ado.net provider moving to new home at sqlite.org

2011-02-17 Thread Daniel Morgan
System.Data.SQLite - statement from Robert Simposon:
http://sqlite.phxsoftware.com/forums/t/2750.aspx

From above:

I've been in close contact with Dr. Richard Hipp and Shane Harrelson at 
sqlite.org for the past couple of months.  They came to me and offered to take 
over management of the System.Data.SQLite project.

The new home for the provider is now at 
http://system.data.sqlite.org
and I will continue to be involved in its development.  
I'm both relieved and excited for the future of the project, 
and it's new home will undoubtedly benefit the community in the long term.

System.Data.SQLite at sqlite.org
http://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki

This is a fork of the popular ADO.NET 4.0 adaptor for SQLite known as 
System.Data.SQLite. The originator of System.Data.SQLite, Robert Simpson, is 
aware of this fork, has expressed his approval, and has commit privileges on 
the new Fossil repository. The SQLite development team intends to maintain 
System.Data.SQLite moving forward. 




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


[Mono-dev] Assertion failures when using Moq on Linux/ARM

2011-02-17 Thread Weeble
(My messages to the list seem to keep vanishing. This is the third
attempt to send this one. The first two were yesterday and a few hours
ago. Might anyone know why they're not working?)

On Mon, Feb 7, 2011 at 12:09 PM, Weeble clockworksa...@gmail.com wrote:
 I'm currently running Mono 2.6.7 on an ARM box (a Sheevaplug) running
 Linux. When I try to run unit tests that work on Windows-x86 with
 Microsoft's CLR and on Linux-x86 with Mono, they fail often (but not
 always) with an assertion:

 thunk failed for 0x40368c80 from 0x4f2a20d8
 ERROR:mini-arm.c:2579:handle_thunk: assertion failed: (pdata.found == 1)

I have been unable so far to extricate the native library to produce a
simple test case that reproduces this. However, I have now built Mono
2.8.2 from source for the ARM device and edited in some extra
diagnostic output in mini-arm.c. It would appear that the when the
failure happens, handle_thunk uses search_thunk_slot to search for an
appropriate thunk slot, but every thunk table it considers is too far
away from the address it wants to branch from. Every invocation of
search_thunk_slot thus takes an early return and cannot create a thunk
entry in any of them.

Is there someone I can talk to who is familiar with this code, and
could advise me on how to address the problem? I imagine I could pore
over mini-arm.c for long enough to understand how and when thunk
tables are allocated and then maybe I could figure out how to make
sure that when memory is allocated for emitting code into that if
there's no thunk table in range a new one is created, or something
like that. However, I think I'd fare a lot better under advice from
someone familiar with it. Is it rude just to directly email the
authors (Paolo Molaro, Dietmar Maurer) who are recorded in the file?

Regards,

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


[Mono-dev] Assertion failures when using Moq on Linux/ARM

2011-02-17 Thread weeble

(Sorry if the formatting is a bit wonky here. I have repeatedly tried to send
this message to the list by email, but it keeps vanishing. I'm copying and
pasting it into the go-mono forum instead. If anyone can help me figure out
why my emails are vanishing, please let me know.)

On Mon, Feb 7, 2011 at 12:09 PM, Weeble clockworksa...@gmail.com wrote:
 I'm currently running Mono 2.6.7 on an ARM box (a Sheevaplug) running
 Linux. When I try to run unit tests that work on Windows-x86 with
 Microsoft's CLR and on Linux-x86 with Mono, they fail often (but not
 always) with an assertion:

 thunk failed for 0x40368c80 from 0x4f2a20d8
 ERROR:mini-arm.c:2579:handle_thunk: assertion failed: (pdata.found == 1)

I have been unable so far to extricate the native library to produce a
simple test case that reproduces this. However, I have now built Mono
2.8.2 from source for the ARM device and edited in some extra
diagnostic output in mini-arm.c. It would appear that the when the
failure happens, handle_thunk uses search_thunk_slot to search for an
appropriate thunk slot, but every thunk table it considers is too far
away from the address it wants to branch from. Every invocation of
search_thunk_slot thus takes an early return and cannot create a thunk
entry in any of them.

Is there someone I can talk to who is familiar with this code, and
could advise me on how to address the problem? I imagine I could pore
over mini-arm.c for long enough to understand how and when thunk
tables are allocated and then maybe I could figure out how to make
sure that when memory is allocated for emitting code into that if
there's no thunk table in range a new one is created, or something
like that. However, I think I'd fare a lot better under advice from
someone familiar with it. Is it rude just to directly email the
authors (Paolo Molaro, Dietmar Maurer) who are recorded in the file?

Regards,

Weeble.
-- 
View this message in context: 
http://mono.1490590.n4.nabble.com/Assertion-failures-when-using-Moq-on-Linux-ARM-tp3310641p3310641.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] About System.Core.dll System.Security.Cryptography and Cng

2011-02-17 Thread Sebastien Pouliot
Le 2011-02-17 à 07:56, Juho Vähä-Herttua juh...@gmail.com a écrit :

Hi,

Sorry for spamming the list a bit, but I think this is quite big chunk of
code so it's worth to note

16.2.2011 21:55, Juho V�h�-Herttua kirjoitti:

I started from the most simple one and added some enumerations that are
required by the classes, a patch can be seen in my github tree. They should
go without any testing, I checked the values match values in .NET, but if
someone else wants to check I wouldn't mind.


https://github.com/juhovh/mono/commit/4b0866fb10774644e2976a439c27889f720de12a


Next I should move to the Serializable classes CngKeyBlobFormat and
CngProvider that are very similar to CngAlgorithm and CngAlgorithmGroup. I
can probably also get the needed unit tests from there.


CngKeyCreationParameters, CngProperty, CngPropertyCollection and CngUIPolicy
are also very simple classes but need their own unit tests.


These classes are now also in GitHub in my repository.
https://github.com/juhovh/mono/commit/f148a7641aae2c7a1d3ea66ebf5aff82ef17adc0

The corresponding unit tests can be found in another commit.
https://github.com/juhovh/mono/commit/400f52aba8e0daae23d5e04175fc98ed8f3070e2

Only thing worth to mention was the CngProperty.GetHashCode() method, it
should be similar to the .NET method and I figured it out by creating a lot
of CngProperty objects and changing the constructor parameters a bit one at
the time. I got different GetHashCode() values on .NET and Mono, but that
might have been some language issue on the String.GetHashCode().


It's important that GetHashCode varies on the same fields/properties (than
MS implementation). However having the same value is not needed - in fact
very few (and simple) Mono types will have identical results with MS.

I'll give you guys time to review all this and after getting some comments I
will start working on the ECDiffieHellman* and ECDsa* classes that will most
likely take a bit more time to finish.


I'll check them soon.

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


Re: [Mono-dev] About System.Core.dll System.Security.Cryptography and Cng

2011-02-17 Thread Juho Vähä-Herttua
Hi,

Sorry for spamming the list a bit, but I think this is quite big chunk 
of code so it's worth to note

16.2.2011 21:55, Juho Vähä-Herttua kirjoitti:
 I started from the most simple one and added some enumerations that are 
 required by the classes, a patch can be seen in my github tree. They should 
 go without any testing, I checked the values match values in .NET, but if 
 someone else wants to check I wouldn't mind.

 https://github.com/juhovh/mono/commit/4b0866fb10774644e2976a439c27889f720de12a

 Next I should move to the Serializable classes CngKeyBlobFormat and 
 CngProvider that are very similar to CngAlgorithm and CngAlgorithmGroup. I 
 can probably also get the needed unit tests from there.

 CngKeyCreationParameters, CngProperty, CngPropertyCollection and CngUIPolicy 
 are also very simple classes but need their own unit tests.

These classes are now also in GitHub in my repository.
https://github.com/juhovh/mono/commit/f148a7641aae2c7a1d3ea66ebf5aff82ef17adc0

The corresponding unit tests can be found in another commit.
https://github.com/juhovh/mono/commit/400f52aba8e0daae23d5e04175fc98ed8f3070e2

Only thing worth to mention was the CngProperty.GetHashCode() method, it 
should be similar to the .NET method and I figured it out by creating a 
lot of CngProperty objects and changing the constructor parameters a bit 
one at the time. I got different GetHashCode() values on .NET and Mono, 
but that might have been some language issue on the String.GetHashCode().

I'll give you guys time to review all this and after getting some 
comments I will start working on the ECDiffieHellman* and ECDsa* classes 
that will most likely take a bit more time to finish.


Juho

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


[Mono-dev] Porting to a other architecture

2011-02-17 Thread benjamin maes
Hello, my name is benjamin maes,

As thesis assignment I need to port mono too a blackfin DSP processer (on
embedded linux (uclinux)). Although this thesis is just interested in how it
is done in principe by writing a sort of tutorial.
In this thesis I will only try to let work a hello world example. I am
interested to people who have expierence in porting mono to a other
architecture, what the best step plan is.
(I know their are documents on mono-project, although sometimes it's a bit
vague)

When you know that I only need a hello world program too work, what would
be the best way to find out what I would need to port of the existing code.

I thought on looking at the IL of a hello world, and looking at the
ecma-notes, would that be a correct way?

I thank you for every response I would get from you,

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


Re: [Mono-dev] WCF and TransportCredentialOnly

2011-02-17 Thread Atsushi Eno
Hello,

I don't think you really read my message.

Atsushi Eno

(2011/02/17 0:36), rjhdakota wrote:
 I am having what I believe is the same problem. You say basic authentication
 is working, any examples? Our project needs the ability to authorize a
 connection, and currently we cannot. Here is the code that works on Windows
 but allows anyone to connect on MONO:

 Public Sub WCFStartService()
  ' http service, one-way

  Dim binding = New
 BasicHttpBinding(System.ServiceModel.BasicHttpSecurityMode.TransportCredentialOnly)
  binding.Security.Transport.ClientCredentialType =
 HttpClientCredentialType.Basic

  Dim address = New Uri(http://192.168.1.129:8080;)
  ServiceHost = New ServiceHost(GetType(HelloService))


 ServiceHost.Credentials.UserNameAuthentication.UserNamePasswordValidationMode
 = Security.UserNamePasswordValidationMode.Custom

 ServiceHost.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator
 = New CustomUserNameValidator

  ServiceHost.AddServiceEndpoint(GetType(IHelloService), binding,
 address)
  ServiceHost.Open()
  End Sub

 Public Class CustomUserNameValidator
  Inherits IdentityModel.Selectors.UserNamePasswordValidator

  Public Overrides Sub Validate(ByVal userName As String, ByVal
 password As String)
  If Nothing = userName OrElse Nothing = password Then
  Throw New ArgumentNullException()
  End If

  If Not (userName = user AndAlso password = pass) Then
  ' This throws an informative fault to the client.
  Throw New FaultException(Unknown Username or Incorrect
 Password)
  ' When you do not want to throw an infomative fault to the
 client,
  ' throw the following exception.
  ' Throw New SecurityTokenException(Unknown Username or
 Incorrect Password)
  End If

  End Sub


  End Class

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


Re: [Mono-dev] About System.Core.dll System.Security.Cryptography and Cng

2011-02-17 Thread Juho Vähä-Herttua
Hi,

Thanks for your comments, they clarified a lot.

On 16.2.2011, at 18.12, Sebastien Pouliot wrote:
 Anyway let's do baby-steps and start with what you already have (and
 unit tests) then we can look at what's missing :-)

I started from the most simple one and added some enumerations that are 
required by the classes, a patch can be seen in my github tree. They should go 
without any testing, I checked the values match values in .NET, but if someone 
else wants to check I wouldn't mind.

https://github.com/juhovh/mono/commit/4b0866fb10774644e2976a439c27889f720de12a 

Next I should move to the Serializable classes CngKeyBlobFormat and CngProvider 
that are very similar to CngAlgorithm and CngAlgorithmGroup. I can probably 
also get the needed unit tests from there.

CngKeyCreationParameters, CngProperty, CngPropertyCollection and CngUIPolicy 
are also very simple classes but need their own unit tests. Then 
ECDiffieHellman, ECDiffieHellmanPublicKey and ECDsa classes are just abstract 
wrappers for the actual Cng classes.

Finally CngKey, ECDiffieHellmanCng, ECDiffieHellmanCngPublicKey and ECDsaCng 
all might need to depend on the actual elliptic curve implementation and are 
quite much trickier. I'll probably get back to it later, but if the first patch 
seems ok I'll continue forward. Of course any comments or suggestions are 
welcome.


Juho



smime.p7s
Description: S/MIME cryptographic signature
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono 2.8.2 GC

2011-02-17 Thread huseyin cakir
I run my mono applications by using mono --gc=sgen app.exe is this correct
usage for sgen GC?
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] About System.Core.dll System.Security.Cryptography and Cng

2011-02-17 Thread Sebastien Pouliot
On Wed, 2011-02-16 at 17:52 +0200, Juho Vähä-Herttua wrote:
 16.2.2011 15:39, Sebastien Pouliot kirjoitti:
  Hello Juho,
 
  On Wed, 2011-02-16 at 12:19 +0200, Juho Vähä-Herttua wrote:
  Hi,
 
  I have implemented elliptic curve cryptography (ECC) algorithms on .NET
  by using the BigInteger struct from .NET 4.0. On Fp curves they seem to
  be considerably faster (about twice the speed) than the BouncyCastle
  library http://www.bouncycastle.org/csharp/ I used for comparison. This
  is probably mostly because of the speed of the BigInteger
  implementation, because I don't see much difference in the actual
  arithmetics.
 
  I have also implemented most of the Cng related enumerations in
  System.Security.Cryptography
  iirc we already part them (or part of them in our git repository)
 
 I saw CngAlgorithm and CngAlgorithmGroup, those are only 2 of the 23 
 classes I would need (if I counted them right).

yep, looks right
https://github.com/mono/mono/tree/master/mcs/class/System.Core/System.Security.Cryptography

  and reverse engineered some
  ECDiffieHellmanCng class functionality where the documentation is not
  clear.
  reverse engineered means a lot of things to different people. Can you
  elaborate on this and ensure it's in compliance with:
 
  http://www.mono-project.com/Contributing#Important_Rules
 
 In this context I meant trial-and-error and Microsoft documentation, the 
 ECDiffieHellmanCng class should just be a wrapper to the native Cng API 
 anyway, so I doubt decompilation would help anything. 

True, and I'm glad you did not have to decompile anything to find that
out ;-)

 I'll review those 
 rules and my code and try to make sure it complies with all the 
 requirements.

Thanks :)

  I could send these upstream to Mono, but since there are a lot of
  files to be added, I'd like to know how should I proceed.
  That would be great :) and a patch will be fine (for review). But first
  please read both:
  http://www.mono-project.com/Contributing
  and
  http://www.mono-project.com/Coding_Guidelines
 
 Thank you for the links, I've tried to follow the code style I have seen 
 in other Mono classes, but I'll go through the guidelines while 
 reviewing the code myself.

Great

  should I write some tests before they
  can be accepted?
  Yes, definitively! Unit tests (nunit) are required to ensure it works
  correctly (on both MS and Mono runtimes) and ensure no future
  regressions.
 
 Ok, I'll have to look into this after I've finished the required 
 functionality in the code.
 
  Does Novell have some copyright policy I should
  consider? Releasing them with the MIT license shouldn't be a problem.
  Our class libraries are MIT.X11 licensed, so as long as you can release
  this code with that license there should not be any problem.
 
 Ok.
 
 I also have some questions I might need advice with. The Cng classes 
 have functions and properties like 
 http://msdn.microsoft.com/en-us/library/bb298399.aspx that return a 
 SafeNCryptSecretHandle. This should be a handle to the native 
 cryptography API, but it's completely useless in Mono. Since 
 SafeNCryptSecretHandle is not implemented, I just dropped those methods 
 completely. How should I proceed in this kind of case?

The best way* would be to stub the missing SafeNCryptSecretHandle and
throw NotSupportedException inside the Cng* properties that access it.

* this would avoid runtime exception for code compiled against
MS.NET (e.g. a call could be present without being required to
execute properly).

 Another thing I had to do is that I am throwing exceptions in case 
 someone tries persistent key storage, all the keys in my implementation 
 are ephemeral. (but can be serialized into a file and made persistent 
 that way) Since Mono is not using the real key storage of .NET I suppose 
 this should be ok?

While we're not using the same key storage as .NET we do support keypair
persistence. Right now this is publicly* exposed thru CspParameters
which do not match well with CngKey.

Anyway let's do baby-steps and start with what you already have (and
unit tests) then we can look at what's missing :-)

* while Mono.Security expose this more directly internally

Thanks!
Sebastien

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


[Mono-dev] F# in Mono 2.10

2011-02-17 Thread Laurent Le Brun
Hi,

In 2.10 release notes, I can read: For F# we ship the fsc command
line compiler and the fsi interactive shell.

When I made the F# packages for Linux a few months ago, there was a
decision (with the F# team) to name the commands fsharpc and
fsharpi. The main reason for this was a conflict with Scala
packages. They already have command fsc, wich means Fast Scala
Compiler.

What do you think about it?

I haven't tried Mono 2.10 yet, but it looks really great. Thanks for
the good work!

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


[Mono-dev] Assertion failures when using Moq on Linux/ARM

2011-02-17 Thread Weeble
(Sorry if this goes through twice. I sent it yesterday and it didn't
seem to appear on the list.)

On Mon, Feb 7, 2011 at 12:09 PM, Weeble clockworksa...@gmail.com wrote:
 I'm currently running Mono 2.6.7 on an ARM box (a Sheevaplug) running
 Linux. When I try to run unit tests that work on Windows-x86 with
 Microsoft's CLR and on Linux-x86 with Mono, they fail often (but not
 always) with an assertion:

 thunk failed for 0x40368c80 from 0x4f2a20d8
 ERROR:mini-arm.c:2579:handle_thunk: assertion failed: (pdata.found == 1)

I have been unable so far to extricate the native library to produce a
simple test case that reproduces this. However, I have now built Mono
2.8.2 from source for the ARM device and edited in some extra
diagnostic output in mini-arm.c. It would appear that the when the
failure happens, handle_thunk uses search_thunk_slot to search for an
appropriate thunk slot, but every thunk table it considers is too far
away from the address it wants to branch from. Every invocation of
search_thunk_slot thus takes an early return and cannot create a thunk
entry in any of them.

Is there someone I can talk to who is familiar with this code, and
could advise me on how to address the problem? I imagine I could pore
over mini-arm.c for long enough to understand how and when thunk
tables are allocated and then maybe I could figure out how to make
sure that when memory is allocated for emitting code into that if
there's no thunk table in range a new one is created, or something
like that. However, I think I'd fare a lot better under advice from
someone familiar with it. Is it rude just to directly email the
authors (Paolo Molaro, Dietmar Maurer) who are recorded in the file?

Regards,

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


Re: [Mono-dev] Assertion failures when using Moq on Linux/ARM

2011-02-17 Thread Weeble
On Mon, Feb 7, 2011 at 12:09 PM, Weeble clockworksa...@gmail.com wrote:
 I'm currently running Mono 2.6.7 on an ARM box (a Sheevaplug) running
 Linux. When I try to run unit tests that work on Windows-x86 with
 Microsoft's CLR and on Linux-x86 with Mono, they fail often (but not
 always) with an assertion:

 thunk failed for 0x40368c80 from 0x4f2a20d8
 ERROR:mini-arm.c:2579:handle_thunk: assertion failed: (pdata.found == 1)

I have been unable so far to extricate the native library to produce a
simple test case that reproduces this. However, I have now built Mono
2.8.2 from source for the ARM device and edited in some extra
diagnostic output in mini-arm.c. It would appear that the when the
failure happens, handle_thunk uses search_thunk_slot to search for an
appropriate thunk slot, but every thunk table it considers is too far
away from the address it wants to branch from. Every invocation of
search_thunk_slot thus takes an early return and cannot create a thunk
entry in any of them.

Is there someone I can talk to who is familiar with this code, and
could advise me on how to address the problem? I imagine I could pore
over mini-arm.c for long enough to understand how and when thunk
tables are allocated and then maybe I could figure out how to make
sure that when memory is allocated for emitting code into that if
there's no thunk table in range a new one is created, or something
like that. However, I think I'd fare a lot better under advice from
someone familiar with it. Is it rude just to directly email the
authors (Paolo Molaro, Dietmar Maurer) who are recorded in the file?

Regards,

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


[Mono-dev] porting too blackfin

2011-02-17 Thread benjamin maes
hello, my name is benjamin maes, and I am trying to port the mono-compiler
too the blackfin architecture..
Today I begun to the mono/arch folder. I tried to find some clues how to
find al details on my datasheet of blackfin en to coded them in. When I look
too two diffrent mono/arch types, I rather don't see semalarities between
them, too build my own, in paralel to these ones. The documentation, doent
really goes in detail about what ( minimal) parts their has to be in it, to
get the job done. Can somebody give me guidance how it is coded up?

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


Re: [Mono-dev] WCF and TransportCredentialOnly

2011-02-17 Thread augustwest

I'm also experiencing a similar issue. My 
http://mono.1490590.n4.nabble.com/WCF-ServiceSecurityContext-td3307343.html
post  is in the general forum.

-- 
View this message in context: 
http://mono.1490590.n4.nabble.com/WCF-and-TransportCredentialOnly-tp3307532p3309153.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] Porting to a other architecture

2011-02-17 Thread Zoltan Varga
Hi,

  A somewhat out-of-date document is here:

http://www.mono-project.com/Mono:Runtime:Documentation:MiniPorting

http://www.mono-project.com/Mono:Runtime:Documentation:MiniPorting
Zoltan

On Wed, Feb 16, 2011 at 8:13 PM, benjamin maes benjaminm...@gmail.comwrote:

 Hello, my name is benjamin maes,

 As thesis assignment I need to port mono too a blackfin DSP processer (on
 embedded linux (uclinux)). Although this thesis is just interested in how it
 is done in principe by writing a sort of tutorial.
 In this thesis I will only try to let work a hello world example. I am
 interested to people who have expierence in porting mono to a other
 architecture, what the best step plan is.
 (I know their are documents on mono-project, although sometimes it's a bit
 vague)

 When you know that I only need a hello world program too work, what would
 be the best way to find out what I would need to port of the existing code.

 I thought on looking at the IL of a hello world, and looking at the
 ecma-notes, would that be a correct way?

 I thank you for every response I would get from you,

 Regards, benjamin




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


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


Re: [Mono-dev] Mono 2.8.2 GC

2011-02-17 Thread Rodrigo Kumpera
Yes, it is.
What were you expecting to see?



On Wed, Feb 16, 2011 at 8:02 PM, huseyin cakir huseyin.caki...@gmail.comwrote:

 I run my mono applications by using mono --gc=sgen app.exe is this
 correct usage for sgen GC?
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list


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


Re: [Mono-dev] porting too blackfin

2011-02-17 Thread Rodrigo Kumpera
mono/arch only have codegen macros.

You want to look into mono/mini. I suggest looking into x86, amd64 or arm
ports as those are the best maintained ones.



On Thu, Feb 17, 2011 at 7:22 PM, benjamin maes benjaminm...@gmail.comwrote:

 hello, my name is benjamin maes, and I am trying to port the mono-compiler
 too the blackfin architecture..
 Today I begun to the mono/arch folder. I tried to find some clues how to
 find al details on my datasheet of blackfin en to coded them in. When I look
 too two diffrent mono/arch types, I rather don't see semalarities between
 them, too build my own, in paralel to these ones. The documentation, doent
 really goes in detail about what ( minimal) parts their has to be in it, to
 get the job done. Can somebody give me guidance how it is coded up?

 --
 mvg,
 benjamin

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


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


Re: [Mono-dev] sgen garbage collector/unmanaged resources/multi-thread issue

2011-02-17 Thread Rodrigo Kumpera
Hi Matteo,

I suppose you release memory on finalizers. Sgen has a longer cycle
to finalize objects than boehm. On why extra retention is happening on
linux is strange and could be a bug. Can you provide a test case that
shows this behavior?


On Fri, Feb 11, 2011 at 6:08 PM, matteo tesser matteo.tes...@gmail.comwrote:

 Hi Rodrigo,
 OK, taking or not taking into consideration memory pressure is a
 runtime's implementation choice: if you consider memory pressure, the
 runtime will be more reactive to memory usage, in the latter case no,
 but unreferenced objects should be freed sooner or later.

 I did an additional test: I counted the live object instances of the
 object type which references the unmanaged resources over time: while
 in windows and os x the live instances oscillate  between 10K and 60K,
  in  linux the live instances arrived to 20 milions. it seems that the
 GC does not realize that so many objects  have been allocated. Are 20
 milions objects  still a number that should not trigger the GC ?

 Probably the problem is not related to unmanaged memory but the
 particular structure of my problem highlights a defect.

 Matteo



 On Fri, Feb 11, 2011 at 3:34 PM, Rodrigo Kumpera kump...@gmail.com
 wrote:
  Mono doesn't take memory pressure into account. This is probably
  what's happening.
  On Fri, Feb 11, 2011 at 3:54 PM, matteo tesser matteo.tes...@gmail.com
  wrote:
 
  Hello,
 
  I have a concurrent programming test  which during 5-10 minutes
  creates and releases a  lot of objects which use unmanaged memory.
  Every managed object,  respectively  allocates/deallocates the
  unmanaged memory using  Marshal.AllocHGlobal and Marshall.FreeHGlobal
  methods  and uses GC.AddMemoryPressure/GC.RemoveMemoryPressure to tell
  to  the garbage collector the presence of the additional memory.
 
  I experienced some memory problems on linux,  so I did several tests:
 
 
  1)  In linux machine with openSuse 11.3 64bit dual core with  mono
  2.8.2,  the program launched with mono --gc=sgen eats 4GB of RAM in
  about two minutes (see attached screenshot).
  If I launch the test by specifying the use of  boehm gc,  the memory
  is still consumed but at smaller rate.
  I tried the test also with mono 2.10p3 and the behavior is the same
  (also using MONO_GC_PARAMS=stack-mark=precise)
 
 
  2) In Windows/.NET the memory footprint  of the program is constant on
  time:  80MB,
  3) in a dual core mac os x ( with mono 2.10p2) the behavior is the
  same as windows.
 
  4) In a Virtual Machine with  linux openSuse 11.3 32bit  and 1
  processor  , mono 2.10p3 the test works fine: the memory footprint  is
  constant at 50MB
 
  My conclusion is that the problem is restricted to the linux /
  multi-thread case.
  Are you aware of such issues on sgen?
 
  I tried to build-up a simple code reproducing the problem but I did
  not managed to do it with a simple test case, in case are you
  interested in a binary test case?
 
  Thanks,
  Matteo
 
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 
 

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


[Mono-dev] Third Party dll error, member function returns null, but works in .NET

2011-02-17 Thread and...@cogmation.com

Hi,

I have been fighting this issue for a couple weeks now.  I have a small test
program which works in .net, but when running in mono, i get a
System.NullReferenceException.  I have attached my test program, including
the necessary third party files.  Any suggestions would be greatly
appreciated, as i am at a loss as to what else to try.

Proper expected output
http://mono.1490590.n4.nabble.com/file/n3311549/ProperOutput.png 

What i am getting when running in mono
http://mono.1490590.n4.nabble.com/file/n3311549/MonoOutput.png 

Here is my source
http://mono.1490590.n4.nabble.com/file/n3311549/DocMgrTest.zip
DocMgrTest.zip 

Thanks
Andrew
-- 
View this message in context: 
http://mono.1490590.n4.nabble.com/Third-Party-dll-error-member-function-returns-null-but-works-in-NET-tp3311549p3311549.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


[Mono-dev] Mono GC 2.8.2: embedding

2011-02-17 Thread Duane Wandless
I am trying to embed the sgen libraries (on Snow Leopard) but receiving this
error at runtime:

   *dyld: Symbol not found: _MONO_DEBUGGER__debugger_info*

*  Referenced from:
/Library/Frameworks/Mono.framework/Versions/2.8.2/lib/libmonosgen-2.0.0.dylib
*

*  Expected in: dynamic lookup*

Linker flags:
-pthread -L/Library/Frameworks/Mono.framework/Versions/Current/lib
-lmonosgen-2.0 -lpthread -rpath@loader_path
/../Libraries

# otool -L InitMono.dylib
InitMono.dylib:
@loader_path/../Libraries/InitMono.dylib (compatibility version 1.0.0,
current version 1.0.0)
/Library/Frameworks/Mono.framework/Versions/2.8.2/lib/libmonosgen-2.0.0.dylib
(compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
111.1.4)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility
version 1.0.0, current version 12.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version
1.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version
227.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
(compatibility version 150.0.0, current version 476.19.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
(compatibility version 300.0.0, current version 677.26.0)


Of course changing the -lmonosgen-2.0 to -lmono-2.0 and everything works as
expected.

Any suggestions on how to fix the symbol not found for embedding the sgen
library are greatly appreciated.  Or if there is a different means to embed
please let me know.


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


Re: [Mono-list] WCF - ServiceSecurityContext

2011-02-17 Thread Atsushi Eno
All what I know is that it worked for monotouch.
https://bugzilla.novell.com/show_bug.cgi?id=605795

Atsushi Eno

(2011/02/17 0:54), augustwest wrote:
 Thank you Atsushi.  I can't seem to find any good samples or information that
 demonstrates what is required in mono to make the basic authentication work
 utilizing the BasicHttpBinding (most likely using the custom validators). Do
 you, or anyone out there, have any good samples?

 Currently, I'm trying something along these lines and can't seem to get them
 to fire when the client invoke a service call.

 selfHost.Credentials.UserNameAuthentication.UserNamePasswordValidationMode =
 System.ServiceModel.Security.UserNamePasswordValidationMode.Custom;

 selfHost.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator
 = new CustomValidator();

 selfHost.Description.Endpoints[0].Contract.ProtectionLevel =
 System.Net.Security.ProtectionLevel.None;

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


Re: [Mono-list] WCF - ServiceSecurityContext

2011-02-17 Thread rjhdakota

I am having what I believe is the same problem. You say basic authentication
is working, any examples? Our project needs the ability to authorize a
connection, and currently we cannot. Here is the code that works on Windows
but allows anyone to connect on MONO: 

Public Sub WCFStartService() 
' http service, one-way 

Dim binding = New
BasicHttpBinding(System.ServiceModel.BasicHttpSecurityMode.TransportCredentialOnly)
 
binding.Security.Transport.ClientCredentialType =
HttpClientCredentialType.Basic 

Dim address = New Uri(http://192.168.1.129:8080;) 
ServiceHost = New ServiceHost(GetType(HelloService)) 

   
ServiceHost.Credentials.UserNameAuthentication.UserNamePasswordValidationMode
= Security.UserNamePasswordValidationMode.Custom 
   
ServiceHost.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator
= New CustomUserNameValidator 

ServiceHost.AddServiceEndpoint(GetType(IHelloService), binding,
address) 
ServiceHost.Open() 
End Sub 

Public Class CustomUserNameValidator 
Inherits IdentityModel.Selectors.UserNamePasswordValidator 

Public Overrides Sub Validate(ByVal userName As String, ByVal
password As String) 
If Nothing = userName OrElse Nothing = password Then 
Throw New ArgumentNullException() 
End If 

If Not (userName = user AndAlso password = pass) Then 
' This throws an informative fault to the client. 
Throw New FaultException(Unknown Username or Incorrect
Password) 
' When you do not want to throw an infomative fault to the
client, 
' throw the following exception. 
' Throw New SecurityTokenException(Unknown Username or
Incorrect Password) 
End If 

End Sub 


End Class
-- 
View this message in context: 
http://mono.1490590.n4.nabble.com/WCF-ServiceSecurityContext-tp3307343p3309204.html
Sent from the Mono - General mailing list archive at Nabble.com.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Can't build NUnit testing project

2011-02-17 Thread Michael Hutchinson
On Fri, Feb 4, 2011 at 1:56 PM, Alexander M. Batishchev
abatishc...@godfather.net.ru wrote:
 Hi, everybody.

 I have a complex solution (developed under Windows, deployed under
 GNU\Linux) with a number of unit-testing projects, using NUnit 2.9.3.

 Here's a reference from project:

 Reference Include=nunit.framework, Version=2.9.3.0, Culture=neutral,
 PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL
   SpecificVersionFalse/SpecificVersion
   HintPath..\..\..\..\..\Program Files\NUnit
 2.9.3\bin\net-4.0\nunit.framework.dll/HintPath
 /Reference

 I downloaded and built NUnit 2.9.3 from source:

 $ xbuild solutions/MonoDevelop/NUnit.Framework.sln /p:Configuration=Release

 and installed into GAC:

 $ gacutil /i solutions/MonoDevelop/bin/Release/nunit.framework.dll
 $ gacutil /l nunit.framework

 The following assemblies are installed into the GAC:
 nunit.framework, Version=2.9.3.0, Culture=neutral,
 PublicKeyToken=96d09a1eb7f44a77
 Number of items = 1

 and deleted local mono nunit installation:

 $ rm /usr/lib/mono/2.0/nunit*
 $ rm /usr/lib/mono/4.0/nunit*

 but when I try to build my solution:

 $ xbuild MySolution.sln | grep error
 : error CS0006: Metadata file `/usr/lib/mono/2.0/nunit.framework.dll' could
 not be found

 What do I wrong?

The GAC is for resolving assemblies at run-time, not compile time.
This is true on .NET too.

http://monodevelop.com/FAQ#I_added_an_assembly_to_the_GAC.2c_why_doesn't_it_appear_in_the_assemblies_list_when_I_try_to_add_a_reference_in_a_MonoDevelop_project.3f

The reason you get the specific error you do is because you removed
the compile-time version of the assemblies pointed to by the pkconfig
file but did not update or remove the pkgconfig file.

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


Re: [Mono-list] WCF - ServiceSecurityContext

2011-02-17 Thread Atsushi Eno
I noticed that monotouch stuff is not about service stuff and the 
service stack
got not working behind the huge HTTP channel listener refactoring last year.
Now it is working in git master and 2.10 branch.
Note that ServiceSecurityContext still never worked (and it still 
doesn't). The
entire ServiceAuthorizationManager stuff is out of scope of our 
implementation.

Atsushi Eno

(2011/02/17 12:33), Atsushi Eno wrote:
 All what I know is that it worked for monotouch.
 https://bugzilla.novell.com/show_bug.cgi?id=605795

 Atsushi Eno

 (2011/02/17 0:54), augustwest wrote:
 Thank you Atsushi.  I can't seem to find any good samples or 
 information that
 demonstrates what is required in mono to make the basic 
 authentication work
 utilizing the BasicHttpBinding (most likely using the custom 
 validators). Do
 you, or anyone out there, have any good samples?

 Currently, I'm trying something along these lines and can't seem to 
 get them
 to fire when the client invoke a service call.

 selfHost.Credentials.UserNameAuthentication.UserNamePasswordValidationMode 
 =
 System.ServiceModel.Security.UserNamePasswordValidationMode.Custom;

 selfHost.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator 

 = new CustomValidator();

 selfHost.Description.Endpoints[0].Contract.ProtectionLevel =
 System.Net.Security.ProtectionLevel.None;


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