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

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


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


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

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? 
Consistently.

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>>)