Bug 38076 - Memory Mapped File on Embedded environment
Summary: Memory Mapped File on Embedded environment
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Core ()
Version: 4.2.0 (C6)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-01-26 22:05 UTC by nicholas.rudh
Modified: 2016-01-27 13:49 UTC (History)
1 user (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 FIXED

Description nicholas.rudh 2016-01-26 22:05:41 UTC
Overview: I am trying to use /dev/mem on an embedded environment as a memory mapped file; however when I try to perform the function MemoryMappedFile.CreateOrOpen I get an error which states, "System.IO.IOException: Could not map file" the error code returned is "9" and I have tracked it down to failing in file "/mono/metadata/file-mmap-posix.c" function "open_memory_map." https://github.com/mono/mono/blob/mono-4.2.0-branch/mono/metadata/file-mmap-posix.c (line 349) is the place where the error is thrown.

346 
 
347 		fd = mkstemp (file_name); 
348 		if (fd == -1) { 
349 			*error = COULD_NOT_MAP_MEMORY; 
350 			goto done; 
351 		} 


I have run this exact same code on my Ubuntu machine and it works perfect, is there any known problems/fixes to this?

Steps to Reproduce: build mono for Xilinx board running embedded Linux, try to open a memorymappedfile /dev/mem

Actual Results: exits with error

Expected Results: allow writing to memorymappedfile

Build Date & Hardware: 4.2.0, built on Ubuntu desktop for Xilinx running embedded Linux. 

Additional Builds and Platforms: does not break on Ubuntu machine built for itself
Comment 1 nicholas.rudh 2016-01-26 23:00:26 UTC
Problem solved the /tmp directory was corrupted on my embedded Linux image.