Bug 33845 - Calls to Microsoft.Cci.PeReader.LoadUnitFrom fail with EntryPointNotFoundException: CreateFileMapping
Summary: Calls to Microsoft.Cci.PeReader.LoadUnitFrom fail with EntryPointNotFoundExce...
Status: RESOLVED ANSWERED
Alias: None
Product: Class Libraries
Classification: Mono
Component: Cecil ()
Version: 4.0.0
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-09-10 10:23 UTC by jeremy
Modified: 2017-05-30 18:26 UTC (History)
2 users (show)

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

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 ANSWERED

Description jeremy 2015-09-10 10:23:01 UTC
Stacktrace for the broken call path:   

at (wrapper managed-to-native) Microsoft.Cci.MemoryMappedFile:CreateFileMapping (intptr,intptr,Microsoft.Cci.MemoryMappedFile/PageAccess,uint,uint,string)
  at Microsoft.Cci.MemoryMappedFile.OpenFileMemoryMap (System.String filename, System.Byte*& buffer, System.UInt32& length) [0x00000] in <filename unknown>:0 
  at Microsoft.Cci.MemoryMappedFile.CreateMemoryMappedFile (System.String localFileName, IBinaryDocument binaryDocument) [0x00000] in <filename unknown>:0 
  at Microsoft.Cci.MetadataReaderHost.OpenBinaryDocument (IBinaryDocument sourceDocument) [0x00000] in <filename unknown>:0 
  at Microsoft.Cci.PeReader.OpenModule (IBinaryDocument binaryDocument, Microsoft.Cci.ModuleIdentity& moduleIdentity) [0x00000] in <filename unknown>:0 
  at Microsoft.Cci.PeReader.OpenModule (IBinaryDocument binaryDocument) [0x00000] in <filename unknown>:0 
  at Microsoft.Cci.PeReader+DefaultHost.LoadUnitFrom (System.String location) [0x00000] in <filename unknown>:0 
  at VAE.Common.Network.Tests.Device.Commands.Vendors.cmdHandleMoresTest.HandleMoresTest () [0x00181] in /Users/jwall/vae/itpie/common/Core/VAE.Common.Network.Tests/Device/Commands/Vendors/All Vendors Tests/cmdHandleMoresTest.cs:53 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/corlib/System.Reflection/MonoMethod.cs:230

I could understand a NotImplementedException if Mono didn't support this API but it appears that it's just a piece of the implementation that was missed.
Comment 1 Alexander Köplinger [MSFT] 2017-05-30 18:26:09 UTC
This seems to be an issue in CCI since it's calling into Windows API here: https://github.com/Microsoft/cci/blob/126992bbf155dc8c6ba30cb0e9a12acc507c2579/CoreObjectModel/MetadataHelper/UnmanagedFileIO.cs#L124-L125

That can't work on Mono on Linux/Mac, I'd suggest you file a bug with them.