[Mono-dev] Unable to use System.Console from embedded

2016-01-12 Thread Chase
Recently integrated Mono into my own C++ application, following the embedded blog post as well as many tips from people on the forum. I'm able to load and execute assemblies just fine, but the whole program throws an Abort when I attempt to use System.Console.Write from inside C#. Is there a init

Re: [Mono-dev] Problems Embedding Mono in C application

2016-01-12 Thread Gutemberg Ribeiro
Hello Andi, Those are the samples with the same behavior: https://github.com/mono/mono/blob/master/samples/embed/teste.c and http://www.mono-project.com/docs/advanced/embedding/ The error happens on 3.12.1 and 4.2.1 the same way… Appreciate any help ☺ Gutemberg From: Andi McClure [mailto:and

Re: [Mono-dev] Problems Embedding Mono in C application

2016-01-12 Thread Andi McClure
Hi— this sounds like something is wrong inside the VM. Can you be more specific, what is the "Mono Embedding sample" you're referring to, and *exactly* which version of Mono are you running (`mono --version` if you don't know)? On Tue, Jan 12, 2016 at 10:48 AM, Gutemberg Ribeiro wrote: > Hello G

[Mono-dev] Problems Embedding Mono in C application

2016-01-12 Thread Gutemberg Ribeiro
Hello Guys! Following the basic Mono Embedding sample we got the following error: * Assertion at class.c:5905, condition `class->field.count == 0' not met Native stacktrace: ./lib/libmonoboehm-2.0.so.1(+0x14d738) [0x40381738] ./lib/libmonoboehm-2.0.so.1(+0x1adeb8) [0x403e1eb8]

Re: [Mono-dev] Profile with optimizations

2016-01-12 Thread Alex Rønne Petersen
What *might* work is calling mono_jit_parse_options () from your mono_profiler_startup () callback. Something like: mono_jit_parse_options (1, (char*[]) { "-O=-all" }); Replace `-all` with whatever you need. I think your callback should be called late enough that this'll override user flags (

Re: [Mono-dev] Profile with optimizations

2016-01-12 Thread Greg Young
but can I disable this behaviour from inside of a profiler? On Tue, Jan 12, 2016 at 12:04 PM, Alex Rønne Petersen wrote: > Well, here's a simple test: > https://gist.github.com/alexrp/9d4ee5b488f9ee57c297 > > If you run this with `MONO_VERBOSE_METHOD=Main mono --profile=log`, > you'll see: https

Re: [Mono-dev] Profile with optimizations

2016-01-12 Thread Alex Rønne Petersen
Well, here's a simple test: https://gist.github.com/alexrp/9d4ee5b488f9ee57c297 If you run this with `MONO_VERBOSE_METHOD=Main mono --profile=log`, you'll see: https://gist.github.com/alexrp/d90e73bfdd0469f5f6c0 Looking at the DUMP BLOCK output, you can see that Add was inlined and constant folde