[Mono-dev] Crash in call to internalGetHome()

Jonathan Pryor jonpryor at vt.edu
Sun Dec 25 10:38:19 EST 2011


On Dec 22, 2011, at 9:30 AM, Kamal Aboul-Hosn wrote:
> I see that internalGetHome is defined as an extern internalCall function. Is there perhaps something I am missing with regard to all the elements I need to install to make it work?

It's an environment issue. Environment.internalGetHome() is mapped in mono/mono/metadata/icall.c to ves_icall_System_Environment_InternalGetHome(), which does:

	return mono_string_new (mono_domain_get (), g_get_home_dir ());

g_get_home_dir() is defined in mono/eglib/src/gmisc-unix.c.

mono_string_new() is defined in mono/mono/metadata/object.c, and does:

	MonoString*
	mono_string_new (MonoDomain *domain, const char *text)
	{
		...
		l = strlen (text); 

Note: strlen(NULL) aborts.

Deduction: g_get_home_dir() is returning NULL, which aborts in the strlen() call. You'll need to figure out why g_get_home_dir() is returning NULL, and/or how to work around it.

 - Jon



More information about the Mono-devel-list mailing list