Bug 322722 (MONO80024) - [ARM] file inssel.c: line 3522 (mono_burg_emit): should not be reached
Summary: [ARM] file inssel.c: line 3522 (mono_burg_emit): should not be reached
Status: RESOLVED FIXED
Alias: MONO80024
Product: Mono: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 1.2
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Rodrigo Kumpera
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-23 23:58 UTC by Alp Toker
Modified: 2007-11-12 20:15 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:17:06 UTC


---- Reported by alp@atoker.com 2006-11-23 16:58:59 MST ----

Using managed D-Bus 0.2 (http://www.ndesk.org/DBusSharp) on the Nokia 770
running Maemo 2.1:

This problem is triggered by dbus-sharp/examples/test-server-native.exe

The bug can be reproduced without any dependencies other than 2.0 support
and Mono.Posix.

Nokia770-45:~# mono test-server-native.exe server
mono[2010]: GLIB ERROR ** default - file inssel.c: line 3522
(mono_burg_emit): should not be reached
aborting...
Stacktrace:


Native stacktrace:

        ./mono [0x1046f4]

The code generates proxy classes for interfaces using SRE.

(Paolo: This is a different bug to the one I mentioned on IRC)



---- Additional Comments From lupus@ximian.com 2006-11-28 16:41:33 MST ----

Fixed in svn.



---- Additional Comments From thomas.strecker@dai-labor.de 2006-12-29 08:50:05 MST ----

I've tried to run mono-latest on my Nokia 770, after successfully
compiling, merging etc. under scratchbox. Since our application is
written against the mono version which was available for the old Nokia
OS (1.1.13-1.1.15), I disabled the 2.0 "preview" (to reduce size, but
I tried the full thing once, too).
When running our application I receive the following fatal message:

mono[1740]: GLIB ERROR ** default - file inssel.c: line 3523
(mono_burg_emit): should not be reached
aborting...
Stacktrace:

  at
System.Xml.Serialization.XmlSerializationReaderInterpreter.GetValueFromXmlString
(string,System.Xml.Serialization.TypeData,System.Xml.Serialization.XmlTypeMapping)
<0xffffffff>
  at
System.Xml.Serialization.XmlSerializationReaderInterpreter.GetValueFromXmlString
(string,System.Xml.Serialization.TypeData,System.Xml.Serialization.XmlTypeMapping)
<0x000cc>

Native stacktrace:

	mono [0xf3938]

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Since this looks very much like the error message from the original
bug report, I would like to re-open the issue.



---- Additional Comments From alp@atoker.com 2007-04-22 20:56:21 MST ----

I think I am seeing this again with the dbus-sharp 0.5.2 release,

Nokia-N800-10:~/mno# ./mono --config config --debug
test-export-interface.exe 
mono[16109]: GLIB WARNING ** default - Symbol file
/root/mno/NDesk.DBus.dll.mdb doesn't match image /root/mno/NDesk.DBus.dll
type: NDesk.DBus.EndianFlag
dtype: Byte
mono[16109]: GLIB ERROR ** default - file inssel.c: line 3507
(mono_burg_emit): should not be reached
aborting...
Stacktrace:

  at NDesk.DBus.MessageReader.ReadValue (System.Type) <0xffffffff>
  at NDesk.DBus.MessageReader.ReadValue (System.Type) <0x003d0>

Native stacktrace:

        ./mono [0x108970]
        /usr/lib/libglib-2.0.so.0(g_logv+0x268) [0x4115b42d]

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Aborted




---- Additional Comments From alp@atoker.com 2007-04-22 21:10:21 MST ----

I should mention, this is with SVN head. Have not been able to check
against older versions or isolate the issue yet, but the same code
does work on Mono x86 and MS.



---- Additional Comments From alp@atoker.com 2007-05-10 14:15:33 MST ----

I isolated the issue a little (but don't have a standalone test case yet).

(Here, DType is a byte-backed enum)

object ReadType (Type type) {
  object val;
  DType dtype = Signature.TypeToDType (type);

  //SIGABRT happens here, after ReadValue(DType) is called but before
it is entered

  val = ReadValue (dtype);
  return val;
}


		public object ReadValue (DType dtype)
		{
			//this point is not reached in failure cases

			switch (dtype)
			{
				case DType.Byte:
					return ReadByte ();

				case DType.Boolean:
					return ReadBoolean ();

				case DType.Int16:
					return ReadInt16 ();

				case DType.UInt16:
					return ReadUInt16 ();

				case DType.Int32:
					return ReadInt32 ();

				case DType.UInt32:
					return ReadUInt32 ();

				case DType.Int64:
					return ReadInt64 ();

				case DType.UInt64:
					return ReadUInt64 ();

#if !DISABLE_SINGLE
				case DType.Single:
					return ReadSingle ();
#endif

				case DType.Double:
					return ReadDouble ();

				case DType.String:
					return ReadString ();

				case DType.ObjectPath:
					return ReadObjectPath ();

				case DType.Signature:
					return ReadSignature ();

				case DType.Variant:
					return ReadVariant ();

				default:
					return null;
				//	throw new Exception ("Unhandled D-Bus type: " + dtype);
			}
		}



This workaround (replacing the above two methods) works:

object ReadType (Type type) {
  object val;
  DType dtype = Signature.TypeToDType (type);

  //SIGABRT happens here, after ReadValue(DType) is called but before
it is entered

				if (dtype == DType.Byte)
					val = ReadByte ();
				else if (dtype == DType.UInt32)
					val = ReadUInt32 ();
				else if (dtype == DType.Boolean)
					val = ReadBoolean ();
				else
					throw new Exception ("This case is not important");

  return val;
}




---- Additional Comments From alp@atoker.com 2007-05-10 14:18:26 MST ----

To clarify, the last (ie. workaround) code block should be:

object ReadType (Type type) {
	object val;
	DType dtype = Signature.TypeToDType (type);

	if (dtype == DType.Byte)
		val = ReadByte ();
	else if (dtype == DType.UInt32)
		val = ReadUInt32 ();
	else if (dtype == DType.Boolean)
		val = ReadBoolean ();
	else
		throw new Exception ("This case is not important");

	return val;
}


Unknown operating system unknown. Setting to default OS "Other".

Comment 1 Riku Voipio 2007-09-16 11:05:36 UTC
This bug happens on debian/armel as well, atleast when compiling gtk-sharp2 and ikvm.

gtk-sharp2:
http://experimental.debian.net/fetch.php?&pkg=gtk-sharp2&ver=2.10.1-3&arch=armel&stamp=1187424041&file=log&as=raw

-snip-
make[3]: Entering directory `/build/buildd/gtk-sharp2-2.10.1/generator'
/usr/bin/mcs /out:gapi_codegen.exe  ./AliasGen.cs ./BoxedGen.cs ./ByRefGen.cs ./CallbackGen.cs ./ChildProperty.cs ./ClassBase.cs ./ClassGen.cs ./CodeGenerator.cs ./ConstFilenameGen.cs ./ConstStringGen.cs ./Ctor.cs ./EnumGen.cs ./FieldBase.cs ./GenBase.cs ./GenerationInfo.cs ./HandleBase.cs ./IAccessor.cs ./IGeneratable.cs ./IManualMarshaler.cs ./ImportSignature.cs ./InterfaceGen.cs ./LPGen.cs ./LPUGen.cs ./ManagedCallString.cs ./ManualGen.cs ./MarshalGen.cs ./MethodBase.cs ./MethodBody.cs ./Method.cs ./NativeCallbackSignature.cs ./ObjectField.cs ./ObjectBase.cs ./ObjectGen.cs ./OpaqueGen.cs ./Parameters.cs ./Parser.cs ./Property.cs ./PropertyBase.cs ./ReturnValue.cs ./Signal.cs ./Signature.cs ./SimpleBase.cs ./SimpleGen.cs ./Statistics.cs ./StructBase.cs ./StructField.cs ./StructGen.cs ./SymbolTable.cs ./VirtualMethod.cs ./VMSignature.cs

** ERROR **: file inssel.c: line 3507 (mono_burg_emit): should not be reached
aborting...
Stacktrace:

  at Mono.CSharp.Constant.ConvertImplicitly (System.Type) <0xffffffff>
  at Mono.CSharp.Constant.ConvertImplicitly (System.Type) <0x00084>

Native stacktrace:

	/lib/ld-linux.so.3 [0x40013cb4]

-snip-

ikvm:
http://experimental.debian.net/fetch.php?&pkg=ikvm&ver=0.34.0.4-1&arch=armel&stamp=1189938823&file=log&as=raw

-snip-
nant -v clean

** ERROR **: file inssel.c: line 3645 (mono_burg_emit): should not be reached
aborting...
Stacktrace:

  at System.Resources.ResourceReader.ResourceValue (int) <0xffffffff>
  at System.Resources.ResourceReader.ResourceValue (int) <0x00210>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (object,object[]) <0xffffffff>
  at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x000f8>
  at System.Reflection.MethodBase.Invoke (object,object[]) <0x0004b>
  at HelperArguments.CallConsoleRunner () <0x00443>
  at (wrapper delegate-invoke) System.MulticastDelegate.invoke_void () <0xffffffff>
  at System.AppDomain.DoCallBack (System.CrossAppDomainDelegate) <0x00033>
  at (wrapper remoting-invoke-with-check) System.AppDomain.DoCallBack (System.CrossAppDomainDelegate) <0xffffffff>
  at NAnt.Console.ConsoleStub.Main (string[]) <0x00da7>
  at (wrapper runtime-invoke) NAnt.Console.ConsoleStub.runtime_invoke_int_string[] (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	/usr/bin/cli [0x1bdb00]
	/usr/bin/cli [0x1976e4]
	/lib/libc.so.6(__default_rt_sa_restorer_v2+0) [0x40217210]
-snip-


I think It might be related to the -fpu=NONE option, as it seems to work on N800 where fpu=VFP. Notice that the comments in sourcecode about softfloat, vfp and fpa, and how the relate to arm eabi are incorrect. See http://bugs.debian.org/430582 for details.

Comment 2 Rodrigo Kumpera 2007-11-12 20:15:36 UTC
Fixed in svn head.

To make dbus work two fixes have been commited, in r89485 and r89486.