[Mono-list] mono_runtime_invoke crash

tbrooks tom at taitale.com
Sun Sep 14 18:38:40 UTC 2014

Robert Jordan wrote
> You did not show us how you're initializing the runtime.

Much of this code was wrapped in a facade mechanism, here is the
initialization code (directories are the build path + "\\lib" and "\\etc")

mono_config_parse( NULL ); // Use the standard configuration...
mono_set_dirs( GetLibDirectory().c_str(), GetConfigDirectory().c_str() ); //
Setup the default directories for mono use here for now the directories of
your Mono installation
m_Domain = mono_jit_init_version( m_AppName.c_str(), "v4.0.30319" ); // Init
the JIT Engine
m_Assembly = mono_domain_assembly_open( m_Domain,
m_DomainAssemblyName.c_str() ); // Open the Assembly with your scripts
m_Image = mono_assembly_get_image( m_Assembly ); // Get the Image

Robert Jordan wrote
> Under Windows you could also end up with compiling your app
> for the Windows subsystem which doesn't have a console.

There is an active console, in this case I can sometimes see output. Even
without recompiling, sometimes it crashes and sometimes it doesn't. It seems
to changed based on the execution, regardless of how many times it's called
in that process instance.

I did some more testing and now I think it's tied to the ToString()
function. If I remove the Console.Writeline and add:

string test = ID.ToString();

I get the same random crashing behavior.

View this message in context: http://mono.1490590.n4.nabble.com/mono-runtime-invoke-crash-tp4663860p4663866.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list