[Mono-dev] _wapi_sparc_lock

David S. Miller davem at davemloft.net
Tue Apr 4 17:13:43 EDT 2006


From: "Zoltan Varga" <vargaz at gmail.com>
Date: Tue, 4 Apr 2006 22:18:50 +0200

> I already checked in that patch :). It should be in mono 1.1.14.

Great, thanks.  Will there be a mono-1-1-14 branch or will that
simply come from the trunk?

The only major issue I have now is a crash in f-spot when trying
to start an import.  The test case boils down to:

   port_info_list = new PortInfoList ();
   port_info_list.Load ();

in the constructor for the GPhotoCamera() class in f-spot.

The implementation of these two methods is pretty simple,
from libgphoto2-sharp/PortInfoList.cs:

		[DllImport ("libgphoto2.so")]
		internal static extern ErrorCode gp_port_info_list_new (out IntPtr handle);
		
		public PortInfoList()
		{
			IntPtr native;

			Error.CheckError (gp_port_info_list_new (out native));

			this.handle = new HandleRef (this, native);
		}
 ...
		[DllImport ("libgphoto2.so")]
		internal static extern ErrorCode gp_port_info_list_load (HandleRef handle);

		public void Load ()
		{
			ErrorCode result = gp_port_info_list_load (this.Handle);

			if (Error.IsError (result))
				throw Error.ErrorException (result);
		}

The pointer passed into gp_port_info_list_load() is bogus.  I added
some debugging to libgphoto2-port and mini-sparc.c and this is the
log that I capture:

("cc" means "calling_convention" and "sp" is "sentinelpos")

mono_arch_call_opcode(): name[gp_port_info_list_new] pcount[1] hasthis[0] cc[0] sp[-1]
mono_arch_call_opcode(): arg[0] storage[0] reg[0] off[0]
mono_arch_call_opcode(): PARAMS[0] ISSTRUCT(0)
ARG[0]: type[24]
gp_port_info_list_new: list[0xff17bf8c] *list[(nil)]
gp_port_info_list_new: *list is now 0x67c390

Ok, that was the call to gp_port_info_list_new().

mono_arch_call_opcode(): name[gp_port_info_list_load] pcount[1] hasthis[0] cc[0] sp[-1]
mono_arch_call_opcode(): arg[0] storage[0] reg[0] off[0]
mono_arch_call_opcode(): PARAMS[0] ISSTRUCT(1)
ARG[0]: type[17]
class_value_size: size[8] align[4]
gp_port_info_list_load: list[0xff17bee4]

And that's the call to gp_port_info_list_load().  The argument should
have been 0x67c390 but somehow we end up with a pass-by-reference of
an object that gets placed onto the stack.  That's very weird.

I'm surprised something so simple like this fails, the whole UI can
get drawn and that calls into many GTK# dll imports which pass
pointers etc. :-)

Any ideas?



More information about the Mono-devel-list mailing list