mono user | 20 Aug 03:05 2014
Picon

PSeq.reduce does not seem to work under Mono

The following tiny bit of F# does not seem to work under Mono 3.6.0. It's fine under .net. PSeq is a thin wrapper implemented using parallel Linq (see the stacktrace). I am afraid I don't know if it's meant to work yet.

let res = Microsoft.FSharp.Collections.PSeq.reduce (+) [0..100]
printf "Result is %d" res

Any suggestions? Many thanks.

mono reduce.exe

Unhandled Exception:
System.ArgumentNullException: Argument cannot be null.
Parameter name: seedFactory
  at System.Linq.ParallelEnumerable.Aggregate[Int32,Int32,Int32] (System.Linq.ParallelQuery`1 source, System.Func`1 seedFactory, System.Func`3 updateAccumulatorFunc, System.Func`3 combineAccumulatorsFunc, System.Func`2 resultSelector) [0x00000] in <filename unknown>:0
  at System.Linq.ParallelEnumerable.Aggregate[Int32] (System.Linq.ParallelQuery`1 source, System.Func`3 func) [0x00000] in <filename unknown>:0
  at Microsoft.FSharp.Collections.PSeqModule.reduce[Int32] (Microsoft.FSharp.Core.FSharpFunc`2 reduction, IEnumerable`1 source) [0x00000] in <filename unknown>:0
  at <StartupCode$reduce>.$Reduce.main <at> () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Argument cannot be null.
Parameter name: seedFactory
  at System.Linq.ParallelEnumerable.Aggregate[Int32,Int32,Int32] (System.Linq.ParallelQuery`1 source, System.Func`1 seedFactory, System.Func`3 updateAccumulatorFunc, System.Func`3 combineAccumulatorsFunc, System.Func`2 resultSelector) [0x00000] in <filename unknown>:0
  at System.Linq.ParallelEnumerable.Aggregate[Int32] (System.Linq.ParallelQuery`1 source, System.Func`3 func) [0x00000] in <filename unknown>:0
  at Microsoft.FSharp.Collections.PSeqModule.reduce[Int32] (Microsoft.FSharp.Core.FSharpFunc`2 reduction, IEnumerable`1 source) [0x00000] in <filename unknown>:0
  at <StartupCode$reduce>.$Reduce.main <at> () [0x00000] in <filename unknown>:0

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Keithen | 19 Aug 23:04 2014
Picon

Linux ComImport

Hi,

I'm trying to make a Windows.Net(c#) application run on Linux(Raspbian).
The application is trying to use some COM-stuff, causing the App to crash.
Since I dont need the content of the COM-Object, I wanted to rewrite just
the libraries/parts necessary for not crashing the App.
I have written an ole32.dll exporting CoCreateIntance. So far, my
CoCreateInstance gots callen and receives parameters correctly. But after
CoCreateInstance is called, the application crashes with

Stacktrace:
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native)
object.__icall_wrapper_mono_object_new_specific (intptr) <0xffffffff>
  at linuxcom.linuxcom.Main (string[]) <0x00033>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object
(object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>

The c#-code belonging to the application:

Object obj = Activator.CreateInstance(Type.GetTypeFromCLSID(new
Guid("AE1E00AA-3FD5-403C-8A27-2BBDC30CD0E1")));

I attached c++ code belonging to ole32.dll (I haven't written c++ for some
time): 
ole32.c <http://mono.1490590.n4.nabble.com/file/n4663589/ole32.c>  

Is there an easier way to do this?
Why doesn't it work?

Greetings,
Keithen

--
View this message in context: http://mono.1490590.n4.nabble.com/Linux-ComImport-tp4663589.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
Neale Ferguson | 19 Aug 21:47 2014
Picon
Picon

thread6 test

What should the output of thread6 test look like (apart from "caught" instead of "cought")? Here's what I'm
getting at the moment - 

Thread 1 started
Count: 0
cought exception level 3
cought exception level 2 STATETEST
System.Threading.ThreadAbortException: Thread was being aborted
  at Tests.ThreadStart1 () [0x00087] in /home/neale/mono/mono/tests/thread6.cs:51
cought exception level 1
System.Threading.ThreadAbortException: Thread was being aborted
  at Tests.ThreadStart1 () [0x00087] in /home/neale/mono/mono/tests/thread6.cs:51
end
Timotheus Pokorra | 19 Aug 16:53 2014

Re: libapache2-mod-mono available from mono-project.com ?

> Why not build from source code?
I personally try not to build on production servers.
And it is so much faster to just install it from somewhere instead of
building yourself.
Obviously you need to trust the source...
But by using the OBS platform, all changes are visible, and no hidden
code could be injected during the build.

Timotheus
Neale Ferguson | 18 Aug 21:59 2014
Picon
Picon

RPM build

I copied env.sh from monodevelop and adapted for openSUSE and the build went cleanly. However, why does the
RPM believe it has these "Requires":

rpm -q --requires -p ../RPMS/x86_64/mono-opt-3.6.0-1.1.x86_64.rpm
:
mono() = 0.0.736.133
mono() = 0.0.738.133
mono() = 0.0.741.133
mono() = 0.0.743.133
:
Neale Ferguson | 18 Aug 20:54 2014
Picon
Picon

RPM Build Error

Using the source RPM for openSUSE 12.3 I get the following error:

usr/src/packages/BUILD/mono-3.6.0
+ cp ../../SOURCES/env.sh /usr/src/packages/BUILDROOT/mono-opt-3.6.0-1.1.x86_64//opt/mono
cp: cannot stat `../../SOURCES/env.sh': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.abBMdB (%install)

Apparently, the env.sh didn't get put in the source RPM.

Neale
Jeff Kilpatrick | 13 Aug 02:09 2014

Building Roslyn on OS X

Hey folks,

I’m relatively new to Mono and attempting to build Roslyn on OS X (10.9), but haven’t made much
progress. I’m hoping I’m missing something obvious. So here’s what I’ve done:

(1) Noting that a recent build from master is required, build mono from source (from https://github.com/mono/mono):
   a. Install MDK (I’ve also tried wiping the MDK and using make get-monolite-latest; both ways
successfully build mono and fail in the same way building Roslyn)
   b. git clone https://github.com/mono/mono.git
   c. ./configure --prefix-/usr/local/mono.git --enable-nls=no
   d. make && make install
   e. add /usr/local/mono.git/bin to front of $PATH

(2) Build Roslyn (from https://github.com/mono/roslyn):
  a. git clone https://github.com/mono/roslyn.git
  c. xbuild Src/Compilers/CSharp/csc/csc.csproj
  d. Get error about missing PCL reference assembiles
  e. Copy assemblies from a Windows box to /usr/local/mono.git/lib/mono/xbuild-frameworks/.NETPortable
  f. xbuild Src/Compilers/CSharp/csc/csc.csproj
  g. Get errors relating to csc2.exe
  h. Apply “Manual changes needed” from README.md Microsoft.Net.ToolsetCompilers.props, which
must have been fetched during the last xbuild.
  i. xbuild Src/Compilers/CSharp/csc/csc.csproj
  j. 30 Warning, 5896 Errors

The build log is 2.8M, so I’ll omit it here unless requested, but here are some samples:

(when building CodeAnalysis.Desktop.csproj):
CommandLine/CommonCommandLineArguments.cs(246,168): error CS0122:
`Microsoft.CodeAnalysis.DiagnosticInfo' is inaccessible due to its protection level
				/Users/jkilpatrick/sharedLogic/roslyn/Binaries/Debug//Microsoft.CodeAnalysis.dll
(Location of the symbol related to previous error)
CommandLine/CommonCommandLineArguments.cs(246,200): error CS0122:
`Microsoft.CodeAnalysis.CommonMessageProvider' is inaccessible due to its protection level
…

(when building CSharpCodeAnalysis.csproj):
SymbolDisplay/ObjectDisplay.cs(7,52): error CS0122:
`Microsoft.CodeAnalysis.Collections.PooledStringBuilder' is inaccessible due to its protection level
SymbolDisplay/ObjectDisplay.cs(8,35): error CS0122: `Roslyn.Utilities.ExceptionUtilities' is
inaccessible due to its protection level
Symbols/Source/SourceAssemblySymbol.cs(16,56): error CS0122:
`Microsoft.CodeAnalysis.CommonAssemblyWellKnownAttributeData<TNamedTypeSymbol>' is
inaccessible due to its protection level
…

When I dig into these errors, I see that the inaccessible classes are internal and in different assemblies
than the ones being built. I’m clearly missing something here. Any ideas?

TIA,
Jeff
Bruno Lauze | 8 Aug 19:29 2014
Picon

mono_fntptr_to_delegate

Hi,

 

I am sure someone can help me out. At one point this code did work. I changed something and/or I just reinstalled latest trunk and it broke…

I am trying to pass C delegate to C#. Everything is working C# is calling back the method but the parameters seems to be invalid pointers.

The C delegate was returning the delegate object, and the parameters.

 

I did put mono_ftnptr_to_delegate to external removing MONO_INTERNAL and placing it under MONO_API.

One could use Marshal.GetDelegateFromPointer with mono_runtime_invoke (Adding that way too at the bottom…)

 

 

Consider the following code:

 

 

DelegateHelper.dll: MyClass.cs:

 

using System;

 

namespace DelegateHelper

{

        public delegate bool TestDelegate(string arg1);

 

        public class MyClass

        {

                public static bool Test(TestDelegate predicate)

                {

                        return predicate("TEST");

                }

        }

}

 

 

main.c:

 

 

#include <stdio.h>

#include <glib.h>

#include <mono/jit/jit.h>

#include <mono/metadata/object.h>

#include <mono/metadata/reflection.h>

#include <mono/metadata/assembly.h>

#include <mono/metadata/threads.h>

#include <mono/metadata/mono-config.h>

 

MONO_API MonoDelegate*

mono_ftnptr_to_delegate (MonoClass *klass, gpointer ftn);

 

MonoBoolean testMethod(MonoObject *arg1, MonoObject *arg2)

{

        printf("Calling delegate!");

        MonoString *str = mono_object_to_string(arg2, NULL); //crash

        return TRUE;

}

 

int main (int argc, char *argv[])

{

        printf ("Delegate Test!\n");

 

        MonoDomain *domain = mono_jit_init_version("DelegateTest", "v4.0.30319");

        mono_config_parse(NULL);

        void *__parameters__[1];

        MonoAssembly *ass = mono_assembly_open("DelegateHelper.dll", NULL);

        MonoImage *image = mono_assembly_get_image(ass);

        MonoClass *delegateClass = mono_class_from_name(image, "DelegateHelper", "TestDelegate");

        mono_class_init(delegateClass);

        MonoClass *testClass = mono_class_from_name(image, "DelegateHelper", "MyClass");

        mono_class_init(testClass);

        gpointer ptr = (gpointer)testMethod;

        MonoDelegate *delegateObj = mono_ftnptr_to_delegate(delegateClass, ptr); //Short way to call Marshal.GetDelegateFromFunctionPointer()

        MonoMethod *testMethod = mono_class_get_method_from_name(testClass, "Test", 1);

        __parameters__[0] = delegateObj;

        MonoObject *result = mono_runtime_invoke(testMethod, NULL, __parameters__, NULL);

        return 0;

}

 

 

Result:

 

Delegate Test!

Calling delegate!

Stacktrace:

 

  at <unknown> <0xffffffff>

  at (wrapper managed-to-native) object.wrapper_native_0x40ea40 () <0xffffffff>

  at DelegateHelper.MyClass.Test (System.Func`2<string, bool>) <0x00018>

  at (wrapper runtime-invoke) <Module>.runtime_invoke_bool_object (object,intptr,intptr,intptr) <0xffffffff>

 

=================================================================

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.

=================================================================

 

Abort

 

 

This code could be used instead of mono_ftnptr_to_delegate which is normally internal

 

        /*

        MonoImage *mscorlib = mono_assembly_get_image(mono_domain_assembly_open(domain, "mscorlib"));

        MonoClass *marshal = mono_class_from_name(mscorlib, "System.Runtime.InteropServices", "Marshal");

        MonoMethod *getDelegate = mono_class_get_method_from_name(marshal, "GetDelegateForFunctionPointer", 2);

        void *marshal_params[2];

        marshal_params[0] = ptr;

        marshal_params[1] = mono_type_get_object(domain, mono_class_get_type(delegateClass));

        MonoObject *delegateObj = mono_runtime_invoke(getDelegate, NULL, marshal_params, NULL);

        */

 

 

Please help!!

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Zoltán Tóth | 7 Aug 20:10 2014
Picon

GC precision

Hi, I am new here and to Mono. I am considering adopting Mono as my main platform of programming. I am interested in the precision of the Mono garbage collector. 

A few months ago I already wrote to the mono-gc list, but have not got answer, looks like that list is inactive.

Mono seems to have an exceptionally good description [1] of its GC. From that I could learn that even the "precise" GC "still scans some parts of the stack conservatively, these include the native frames below the last managed frame, the last managed frame, frames belonging to managed->native transitions, and all native frames above the first managed frame."

I suspect that that description is several years old. As being [admittedly] paranoid of imprecise garbage collection, I hope that Mono may have got a totally precise GC already and it is just not documented, advertised. Is this the case? Or the documentation is still correct and the GC is still imprecise? 


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Michael Frank | 5 Aug 12:41 2014
Picon

Issue compiling mono 3.4.0 on raspberry pidora (Fedora 18)

Hello,
 
I have an issue compiling mono 3.4.0 on Pidora (Fedora18). I was not able to compile the tarballs so I decided to install the available mono 2 runtime and use autogen.sh.
autogen runs w/o problems but make throw the following errors:
 
 
ecore.cs(6386,19): error CS0246: The type or namespace name `SLE' could not be found. Are you missing an assembly reference?
.
.
/root/mono/mcs/class/lib/net_2_0/mscorlib.dll (Location of the symbol related to previous error)
eval.cs(1224,8): error CS0305: Using the generic type `System.Action<T>'
requires `1' type argument(s)
.
.
expression.cs(37,12): error CS0305: Using the generic type `System.Func<T1,T2,T3,TResult>' requires `4' type argument(s) /root/mono/mcs/class/lib/net_2_0/mscorlib.dll (Location of the symbol related to previous error)
.
.
expression.cs(91,19): error CS0246: The type or namespace name `SLE'
could not be found. Are you missing an assembly reference?
.
.
.
expression.cs(5022,76): error CS0305: Using the generic type `System.Func<T1,T2,T3,TResult>' requires `4' type argument(s) /root/mono/mcs/class/lib/net_2_0/mscorlib.dll (Location of the symbol related to previous error)
.
.
.
generic.cs(1218,89): error CS0305: Using the generic type `System.Func<T1,T2,T3,TResult>' requires `4' type argument(s) /root/mono/mcs/class/lib/net_2_0/mscorlib.dll (Location of the symbol related to previous error)
literal.cs(80,19): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System'. Are you missing `System.Core'
assembly reference?
nullable.cs(248,19): error CS0246: The type or namespace name `SLE'
could not be found. Are you missing an assembly reference?
nullable.cs(1044,19): error CS0246: The type or namespace name `SLE'
could not be found. Are you missing an assembly reference?
report.cs(62,10): error CS0246: The type or namespace name `HashSet'
could not be found. Are you missing an assembly reference?
report.cs(553,13): error CS0246: The type or namespace name `HashSet'
could not be found. Are you missing an assembly reference?
report.cs(914,12): error CS0246: The type or namespace name `Stopwatch'
could not be found. Are you missing an assembly reference?
report.cs(915,3): error CS0246: The type or namespace name `Stopwatch'
could not be found. Are you missing an assembly reference?
settings.cs(171,3): error CS0246: The type or namespace name `HashSet'
could not be found. Are you missing an assembly reference?
settings.cs(314,16): error CS0305: Using the generic type `System.Func<T1,T2,T3,TResult>' requires `4' type argument(s) /root/mono/mcs/class/lib/net_2_0/mscorlib.dll (Location of the symbol related to previous error)
typemanager.cs(885,12): error CS0305: Using the generic type `System.Func<T1,T2,T3,TResult>' requires `4' type argument(s) /root/mono/mcs/class/lib/net_2_0/mscorlib.dll (Location of the symbol related to previous error)
typemanager.cs(923,103): error CS0305: Using the generic type `System.Func<T1,T2,T3,TResult>' requires `4' type argument(s) /root/mono/mcs/class/lib/net_2_0/mscorlib.dll (Location of the symbol related to previous error)
../class/Mono.CompilerServices.SymbolWriter/SourceMethodBuilder.cs(40,3): error
CS0246: The type or namespace name `Stack' could not be found. Are you missing an assembly reference?
../tools/monop/outline.cs(46,2): error CS0246: The type or namespace name `IndentedTextWriter' could not be found. Are you missing an assembly reference?
../../external/ikvm/reflect/Emit/ILGenerator.cs(115,20): error CS0246:
The type or namespace name `Stack' could not be found. Are you missing an assembly reference?
Compilation failed: 93 error(s), 0 warnings
make[7]: *** [../class/lib/basic/basic.exe] Error 1
make[6]: *** [do-all] Error 2
make[5]: *** [all-recursive] Error 1
make[4]: *** [profile-do--basic--all] Error 2
make[3]: *** [profiles-do--all] Error 2
make[2]: *** [all-local] Error 2
make[2]: Leaving directory `/root/mono/runtime'
Any help is much appreciated.
 
 
regards

Michael Frank

http://www.mikefrank.de
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Bruno Lauze | 4 Aug 16:18 2014
Picon

Mono C++/CLI lib

Hi,

I've written a start to produce C++ api for mono assemblies.

You  can have a look at the code at https://github.com/brunolauze/MonoNative

Here's an example:

using namespace mscorlib::System; 
using namespace mscorlib::System::Collections::Generic;

var *list = new List<String>();
list->Add(String("TEST"));
int count = list->Count;
if (count == 0) 
{ 
	Console::WriteLine("Added TEST String"); 
}
list->Clear(); 
count = list->Count;
if (count == 0) { 
	Console::WriteLine("Clear done"); 
}

Of course there's probably a lot of issues right now. But I see improving
the Generator have a seemless .NET framework in C++.

Please let me know your opinions on this, 

Thanks,

Gmane