[Mono-devel-list] Segmentation fault in mono_class_from_name

Kamil Skalski nazgul at nemerle.org
Wed Jun 23 16:28:36 EDT 2004

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

> > (With a little effort you can reproduce this bug installing Nemerle
> > compiler, where it is always reproducable)
> Well, if you provided details on how to reproduce we could try...

1. Get http://www.nemerle.org/download/snapshots/nemerle-
2. ./configure 
3. cd macros
4. make
5. cd ../snippets
6. make sql

The exception is catched, but it's data is printed (you can disable catching 
in macros/dataNpgsql.n by commenting out #NODEBUG)

Kamil Skalski

More information about the Mono-devel-list mailing list