Bug 51430 - ServiceHost constructor infinitely recurses with certain interface inheritance
Summary: ServiceHost constructor infinitely recurses with certain interface inheritance
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies (show other bugs)
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-01-11 22:23 UTC by Jason Roberts
Modified: 2017-09-06 16:55 UTC (History)
1 user (show)

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


Attachments
A sample project illustrating the issue. (2.29 KB, application/x-7z-compressed)
2017-01-11 22:23 UTC, Jason Roberts
Details

Description Jason Roberts 2017-01-11 22:23:55 UTC
Created attachment 19238 [details]
A sample project illustrating the issue.

Inside ContractDescriptionGenerator the method GetContractInternal calls into GetContractAssignableToInterfaces with the first parameter being of the given type that is being checked.

GetContractAssignableToInterfaces however doesn't actually look at the given type. So if you have a class that uses ServiceContractAttribute who implements another interface that does *not* use ServiceContractAttribute, the ContractDescriptionGenerator will iterate to the non-service interface, call GetContractAssignableToInterfaces with that type and then recurse forever.

This behavior only occurs in the mono library. We have verified that it does not occur in MS .NET implementation.  Have attached a sample project where the bug occurs.

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