Bug 318292 (MONO75296) - [GMCS] context from type instead of method is used when parsing generic method invocation
Summary: [GMCS] context from type instead of method is used when parsing generic metho...
Status: RESOLVED FIXED
Alias: MONO75296
Product: Mono: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 1.0
Hardware: Other Other
: P3 - Medium : Blocker
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-17 20:28 UTC by Kamil Skalski
Modified: 2007-09-15 21:24 UTC (History)
0 users

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


Attachments
a workaround for incorrect context passed to method_from_methodspec (651 bytes, patch)
2005-06-20 18:46 UTC, Thomas Wiest
Details | Diff

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


---- Reported by nazgul@omega.pl 2005-06-17 13:28:34 MST ----

Please fill in this template when reporting a bug, unless you know what you
are doing.
Description of Problem:
Runtime fails on generic method invocation.

Steps to reproduce the problem:
1. Compile gmcs t.cs

class C <A> {
  public static void foo<B> (C<B> x)
  {
    D.append (x);
  }
}

class D {
  public static void append<A> (C<A> x)
  {
  }

  public static void Main ()
  {
    C<object>.foo<int> (null);
  }
}

2. run  mono t.exe

Actual Results:

** ERROR **: file metadata.c: line 1812
(mono_metadata_parse_generic_param): assertion failed: (generic_container
&& (generic_container->is_method || generic_container->is_signature))
aborting...
Aborted

Expected Results:
clear run

How often does this happen? 
Always

Additional Information:
This is the current nemerle bootstrap blocker...



---- Additional Comments From malekith@pld-linux.org 2005-06-17 13:36:41 MST ----

It's a blocker.

It is caused by
http://galactus.ximian.com/pipermail/mono-patches/2005-June/060134.html
that I guess fixed something else :-)



---- Additional Comments From nazgul@omega.pl 2005-06-20 11:43:54 MST ----

I did some debugging and it seem that in
loader.c:504 the 'context' contains:

(gdb) p *context
$2 = {container = 0x8274d68, gclass = 0x82770f0, gmethod = 0x8277700}

Which probably isn't valid. Even if it is valid, the contex should
actually point to context -> gmethod -> container, which is a correct
context at this place.

I attach a little hack, which allowed me to go forward and workaround
the bug in some sense.



---- Additional Comments From nazgul@omega.pl 2005-06-20 11:46:21 MST ----

Created an attachment (id=168143)
a workaround for incorrect context passed to method_from_methodspec




---- Additional Comments From martin@ximian.com 2005-06-20 12:32:10 MST ----

Thanks a lot for you patch; committed it to SVN :-)

Imported an attachment (id=168143)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>mono svn from 17.06.2005</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".