[Mono-devel-list] Segmentation fault in mono_class_from_name

Kamil Skalski nazgul at nemerle.org
Wed Jun 23 17:36:19 EDT 2004


Wednesday 23 June 2004 22:28, Kamil Skalski wrote:
> Wednesday 23 June 2004 21:48, Paolo Molaro wrote:
> > Are you sure that image is non-NULL? What is image->ref_count if it's
> > not NULL?
>
> You are right, image pointer is null... But why for the following code
>
> 	g_message(G_GNUC_PRETTY_FUNCTION ": monoclasstep 3: %d", enter);
> 	nspace_table = g_hash_table_lookup (image->name_cache, name_space);
> 	g_message(G_GNUC_PRETTY_FUNCTION ": monoclasstep 4: %d", enter);
>
> ** Message: : monoclasstep 3: 22788
> occurs, but
> ** Message: : monoclasstep 4: 22788
> doesn't before crash (is g_hash_table_lookup a macro inlining return or
> this segfault is really occuring inside lookup?)
>
> Anyway, crash occurs inside mono_class_from_name, because
> 	g_message(G_GNUC_PRETTY_FUNCTION ": famstep 1");
> 	socket_class = mono_class_from_name (system_assembly,
> 					     "System.Net.Sockets", "Socket");
> 	g_message(G_GNUC_PRETTY_FUNCTION ": famstep 2");
>
> it never get to famstep 2

Ergh, of course if image is NULL, image -> name_case is causing segfault... 
So how is it possible that system_assembly is NULL here? I assume this is not 
a valid state, so I need to debug why it is not properly initialized...

Kamil Skalski



More information about the Mono-devel-list mailing list