Bug 35812 - Save failed. Too many open files (Too many open files)
Summary: Save failed. Too many open files (Too many open files)
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 4.2.0 (C6)
Hardware: PC Mac OS
: --- normal
Target Milestone: C6SR2
Assignee: Ludovic Henry
Depends on:
Reported: 2015-11-12 11:13 UTC by Aaron Bockover [MSFT]
Modified: 2016-01-25 16:12 UTC (History)
4 users (show)

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

Screenshot (84.16 KB, image/png)
2015-11-12 11:13 UTC, Aaron Bockover [MSFT]
Open files list from Activity Monitor (58.08 KB, text/plain)
2015-11-12 11:16 UTC, Aaron Bockover [MSFT]
lsof (181.92 KB, text/plain)
2015-11-12 11:54 UTC, Aaron Bockover [MSFT]
Limit hit when trying to open a file this time (107.38 KB, image/png)
2015-11-12 11:56 UTC, Aaron Bockover [MSFT]

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:

Description Aaron Bockover [MSFT] 2015-11-12 11:13:58 UTC
Created attachment 13788 [details]

I've been losing bits of work here and there, a few times a day lately with everything installed and up to date on the Alpha channel.

This is more likely a Mono runtime issue, but it manifests frequently in data loss in Xamarin Studio.

Attached is a screenshot of the dialog that appears when trying to save when too many files are open, and a list of open files for the XS process when the error happens (taken from Activity Monitor). There are a lot of suspicious "(none)" entries and what appears to be _way_ too many assemblies and .mdb files open.

I accidentally killed XS before remembering to poke at it with lsof and such, so I'll update this bug with more info when I it happens again.


aaron@bacon ~ 👉 sysctl kern.maxfilesperproc
kern.maxfilesperproc: 10240
aaron@bacon ~ 👉 sysctl kern.maxfiles
kern.maxfiles: 12288


Xamarin Studio
Version 5.10 (build 860)
Installation UUID: 2701a58e-0630-4e42-b81d-229161066215
	Mono 4.2.1 (explicit/8862921)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010091

Not Installed

Apple Developer Tools
Xcode 7.1 (9079)
Build 7B91b

Version: (Business Edition)
Hash: 9ce9e8b
Branch: master
Build date: 2015-10-28 19:11:03-0400

Version: (Business Edition)
Android SDK: /Users/aaron/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.4 (API level 19)
		5.0 (API level 21)
		5.1 (API level 22)

SDK Tools Version: 24.2
SDK Platform Tools Version: 22
SDK Build Tools Version: 22.0.1

Java SDK: /usr
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

Xamarin Android Player
Version: 0.3.7
Location: /Applications/Xamarin Android Player.app

Version: (Business Edition)

Build Information
Release ID: 510000860
Git revision: 7c46a0b709d51ad5d5a5ed90a4671cc7b6928e62
Build date: 2015-10-29 17:17:52-04
Xamarin addins: b9337905aca5dc276190d78819728a59cda33a43
Build lane: monodevelop-lion-cycle6

Operating System
Mac OS X 10.11.2
Darwin bacon.local 15.0.0 Darwin Kernel Version 15.0.0
    Fri Oct 23 15:26:00 PDT 2015
    root:xnu-3248.20.38~15/RELEASE_X86_64 x86_64
Comment 1 Aaron Bockover [MSFT] 2015-11-12 11:16:22 UTC
Created attachment 13789 [details]
Open files list from Activity Monitor
Comment 2 Aaron Bockover [MSFT] 2015-11-12 11:54:57 UTC
Created attachment 13790 [details]

This is the output from lsof, on another run of XS, on a completely separate machine (with the same builds of everything from Alpha).
Comment 3 Aaron Bockover [MSFT] 2015-11-12 11:56:53 UTC
Created attachment 13791 [details]
Limit hit when trying to open a file this time
Comment 5 Ludovic Henry 2015-11-13 16:36:56 UTC
Aaron, did you had a chance to run with the build available at https://wrench.internalx.com/Wrench/ViewLane.aspx?lane_id=2460&host_id=148&revision_id=650545 ?
Comment 9 Peter Collins 2015-12-16 19:05:20 UTC
@Kyle @Ludovic, should we consider this card resolved | fixed on the release branch for C6SR1?

Looks like this has already been added to the release branch judging by the state of the card linked above:
Comment 10 Kyle White 2015-12-16 19:15:16 UTC
@Peter, no I do not think so. As @Alan mentioned in comment 6 it might not be related to that card at all. They were believed to be related at one point (the threadpool issue caused this one to happen), but after reviewing the history here and on the Trello card, I do not think @Ludovic is expecting that issue to fix this. So I'd leave it open. Also moving it to C6SR2 milestone.
Comment 11 Ludovic Henry 2016-01-25 16:12:00 UTC
The issue didn't seem to have arised since then. We also run into the same kind of issue with https://trello.com/c/DbLazGXt/221-mono-xvs-bug-37085-unable-to-see-simulator-in-device-dropdown-list which have since been fixed.