Bug 9531 - Segfault in fieldref_encode_signature
Summary: Segfault in fieldref_encode_signature
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-01-14 03:48 UTC by Ben Bader
Modified: 2013-01-14 16:16 UTC (History)
3 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:

A complete reproduction. (1.90 KB, application/octet-stream)
2013-01-14 03:48 UTC, Ben Bader

Description Ben Bader 2013-01-14 03:48:06 UTC
Description of Problem:

Segfault when
a) emitting a dynamic type in an assembly defined with AssemblyBuilderAccess.RunAndSave AND
b) the type's base class has a generic parameter AND
c) the base class is given to the method defining the dynamic type as a generic parameter
d) emitting ldfld in a constructor

Steps to reproduce the problem:
1. mcs Main.cs && mono Main.exe

Actual Results:
Abnormal termination with SIGSEGV

Expected Results:
The program completes successfully

How often does this happen? 

Additional Information:
This is 100% reliable for my configuration (Mac OSX 10.7, Mono 2.10.9).  The example code works as expected in CLR v4.0.
Comment 1 Ben Bader 2013-01-14 03:48:56 UTC
Created attachment 3207 [details]
A complete reproduction.

This is, as far as I can tell, a minimal reproduction.
Comment 2 Zoltan Varga 2013-01-14 16:16:07 UTC
Fixed in master. As a workaround, try using @base = typeof(Example<int>>)

Note You need to log in before you can comment on or make changes to this bug.