[Mono-dev] Possible regression from revision 141535 (metadata/class.c - Use inheritance-aware interface offsets)?

Sylvain Dupont duposyl at gmail.com
Sat Oct 10 22:12:18 EDT 2009


I have trouble running my application under mono on Windows (using the head
of trunk). The following assert triggers at startup:

    * Assertion at ..\mono\metadata\cominterop.c:356, condition `ic' not met

This happens because the slot for the TestMethod method (method->slot==7)
passed in argument to the cominterop_get_method_interface function is not
available in the packed interface table:

Packed interface table for class TestClass has size 2
  [000][UUID 089][SLOT 006][SIZE  001] interface COMExampleLib.ITest
  [001][UUID 090][SLOT 007][SIZE  000] interface COMExampleLib.Test
[LEVEL 0] Implemented interfaces by class TestClass:
  [UIID 89] interface ITest
  [000][UUID 089][SLOT 006][SIZE  001] interface COMExampleLib.ITest
  [UIID 90] interface Test
  [001][UUID 090][SLOT 007][SIZE  000] interface COMExampleLib.Test
  [UIID 89] interface ITest
  [002][UUID 089][SLOT 006][SIZE  001] interface COMExampleLib.ITest

I also attach the relevant section of the trace obtained by turning on
DEBUG_INTERFACE_VTABLE_CODE/TRACE_INTERFACE_VTABLE_CODE/VERIFY_INTERFACE_VTABLE_CODE
in class.c

Now if I comment out the two lines added in revision 141535:

--- class.c     (revision 143891)
+++ class.c     (working copy)
-               if ((cm->flags & METHOD_ATTRIBUTE_NEW_SLOT) && !(cm->flags &
METHOD_ATTRIBUTE_FINAL) && cm->slot >= 0)
-                       cm->slot = -1;
+               //if ((cm->flags & METHOD_ATTRIBUTE_NEW_SLOT) && !(cm->flags
& METHOD_ATTRIBUTE_FINAL) && cm->slot >= 0)
+               //      cm->slot = -1;

the slot for the TestMethod method becomes 6 and the
cominterop_get_method_interface function works fine without asseting. My
application also works with no issue.

Any idea?

Thanks!

Sylvain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20091010/33982b7d/attachment-0001.html 
-------------- next part --------------
...
*** Vtable for class 'COMExampleLib.TestClass' at "AFTER INHERITING PARENT VTABLE" (size 7)
Packed interface table for class TestClass has size 2
  [000][UUID 090][SLOT 006][SIZE  001] interface COMExampleLib.ITest
  [001][UUID 091][SLOT 007][SIZE  000] interface COMExampleLib.Test
Interface flags: (0,F)(1,F)(2,F)(3,F)(4,F)(5,F)(6,F)(7,F)(8,F)(9,F)(10,F)(11,F)(12,F)(13,F)(14,F)(15,F)(16,F)(17,F)(18,F)(19,F)(20,F)(21,F)(22,F)(23,F)(24,F)(25,F)(26,F)(27,F)(28,F)(29,F)(30,F)(31,F)(32,F)(33,F)(34,F)(35,F)(36,F)(37,F)(38,F)(39,F)(40,F)(41,F)(42,F)(43,F)(44,F)(45,F)(46,F)(47,F)(48,F)(49,F)(50,F)(51,F)(52,F)(53,F)(54,F)(55,F)(56,F)(57,F)(58,F)(59,F)(60,F)(61,F)(62,F)(63,F)(64,F)(65,F)(66,F)(67,F)(68,F)(69,F)(70,F)(71,F)(72,F)(73,F)(74,F)(75,F)(76,F)(77,F)(78,F)(79,F)(80,F)(81,F)(82,F)(83,F)(84,F)(85,F)(86,F)(87,F)(88,F)(89,F)(90,T)(91,T)
Dump interface flags: 00 00 00 00 00 00 00 00 00 00 00 0C
[LEVEL 0] Implemented interfaces by class TestClass:
  [UIID 90] interface ITest
  [000][UUID 090][SLOT 006][SIZE  001] interface COMExampleLib.ITest
  [UIID 91] interface Test
  [001][UUID 091][SLOT 007][SIZE  000] interface COMExampleLib.Test
  [UIID 90] interface ITest
  [002][UUID 090][SLOT 006][SIZE  001] interface COMExampleLib.ITest
[LEVEL 1] Implemented interfaces by class __ComObject:
[LEVEL 2] Implemented interfaces by class MarshalByRefObject:
[LEVEL 3] Implemented interfaces by class Object:
* Interfaces for class 'COMExampleLib.TestClass' done.
Starting vtable (size 7):
  [O][000][INDEX 000] System.__ComObject:Equals (object)
  [O][001][INDEX 001] System.__ComObject:Finalize ()
  [O][002][INDEX 002] System.__ComObject:GetHashCode ()
  [O][003][INDEX 003] object:ToString ()
  [O][004][INDEX 004] System.MarshalByRefObject:CreateObjRef (System.Type)
  [O][005][INDEX 005] System.MarshalByRefObject:InitializeLifetimeService ()
Override map "AFTER OVERRIDING INTERFACE METHODS" START:
  Method 'COMExampleLib.ITest:TestMethod' has override 'COMExampleLib.TestClass:TestMethod'
Override map "AFTER OVERRIDING INTERFACE METHODS" END.
*** Vtable for class 'COMExampleLib.TestClass' at "AFTER OVERRIDING INTERFACE METHODS" (size 7)
  [O][000][INDEX 000] System.__ComObject:Equals (object)
  [O][001][INDEX 001] System.__ComObject:Finalize ()
  [O][002][INDEX 002] System.__ComObject:GetHashCode ()
  [O][003][INDEX 003] object:ToString ()
  [O][004][INDEX 004] System.MarshalByRefObject:CreateObjRef (System.Type)
  [O][005][INDEX 005] System.MarshalByRefObject:InitializeLifetimeService ()
  [I][006][INDEX 006] COMExampleLib.TestClass:TestMethod ()
      [class is not abstract, checking slot 6 for interface 'COMExampleLib'.'ITest', method TestMethod, slot check is 0]
*** Vtable for class 'COMExampleLib.TestClass' at "AFTER SETTING UP INTERFACE METHODS" (size 7)
  [O][000][INDEX 000] System.__ComObject:Equals (object)
  [O][001][INDEX 001] System.__ComObject:Finalize ()
  [O][002][INDEX 002] System.__ComObject:GetHashCode ()
  [O][003][INDEX 003] object:ToString ()
  [O][004][INDEX 004] System.MarshalByRefObject:CreateObjRef (System.Type)
  [O][005][INDEX 005] System.MarshalByRefObject:InitializeLifetimeService ()
  [I][006][INDEX 006] COMExampleLib.TestClass:TestMethod ()
*** Vtable for class 'COMExampleLib.TestClass' at "FINALLY" (size 8)
  [O][000][INDEX 000] System.__ComObject:Equals (object)
  [O][001][INDEX 001] System.__ComObject:Finalize ()
  [O][002][INDEX 002] System.__ComObject:GetHashCode ()
  [O][003][INDEX 003] object:ToString ()
  [O][004][INDEX 004] System.MarshalByRefObject:CreateObjRef (System.Type)
  [O][005][INDEX 005] System.MarshalByRefObject:InitializeLifetimeService ()
  [I][006][INDEX 007] COMExampleLib.TestClass:TestMethod ()
  [N][007][INDEX 007] COMExampleLib.TestClass:TestMethod ()
*** Verifying VTable of class 'COMExampleLib.TestClass' 

...

Packed interface table for class TestClass has size 2
  [000][UUID 090][SLOT 006][SIZE  001] interface COMExampleLib.ITest
  [001][UUID 091][SLOT 007][SIZE  000] interface COMExampleLib.Test
Interface flags: (0,F)(1,F)(2,F)(3,F)(4,F)(5,F)(6,F)(7,F)(8,F)(9,F)(10,F)(11,F)(12,F)(13,F)(14,F)(15,F)(16,F)(17,F)(18,F)(19,F)(20,F)(21,F)(22,F)(23,F)(24,F)(25,F)(26,F)(27,F)(28,F)(29,F)(30,F)(31,F)(32,F)(33,F)(34,F)(35,F)(36,F)(37,F)(38,F)(39,F)(40,F)(41,F)(42,F)(43,F)(44,F)(45,F)(46,F)(47,F)(48,F)(49,F)(50,F)(51,F)(52,F)(53,F)(54,F)(55,F)(56,F)(57,F)(58,F)(59,F)(60,F)(61,F)(62,F)(63,F)(64,F)(65,F)(66,F)(67,F)(68,F)(69,F)(70,F)(71,F)(72,F)(73,F)(74,F)(75,F)(76,F)(77,F)(78,F)(79,F)(80,F)(81,F)(82,F)(83,F)(84,F)(85,F)(86,F)(87,F)(88,F)(89,F)(90,T)(91,T)
Dump interface flags: 00 00 00 00 00 00 00 00 00 00 00 0C
[LEVEL 0] Implemented interfaces by class TestClass:
  [UIID 90] interface ITest
  [000][UUID 090][SLOT 006][SIZE  001] interface COMExampleLib.ITest
  [UIID 91] interface Test
  [001][UUID 091][SLOT 007][SIZE  000] interface COMExampleLib.Test
  [UIID 90] interface ITest
  [002][UUID 090][SLOT 006][SIZE  001] interface COMExampleLib.ITest
[LEVEL 1] Implemented interfaces by class __ComObject:
[LEVEL 2] Implemented interfaces by class MarshalByRefObject:
[LEVEL 3] Implemented interfaces by class Object:
* Assertion at ..\mono\metadata\cominterop.c:356, condition `ic' not met


More information about the Mono-devel-list mailing list