Bug 55364 - OutOfMemoryException on startup
Summary: OutOfMemoryException on startup
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Vlad Brezae
URL:
Depends on:
Blocks:
 
Reported: 2017-04-19 11:24 UTC by Dean Herbert
Modified: 2017-05-11 00:44 UTC (History)
3 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 FIXED

Description Dean Herbert 2017-04-19 11:24:28 UTC
When trying to start my .NET app on windows with mono, it crashes with OutOfMemory.

Tested on 4.6, 4.8, 5.0.0

https://gist.github.com/peppy/91411e242b91e47b6c97302f30974fd1

It runs fine on linux and MacOS using 4.8 and 5.0.

Project is open source at https://github.com/ppy/osu (compiled version https://github.com/ppy/osu/releases/download/v2017.415.0/osulazer-2017.415.0-full.nupkg) if you would like to reproduce.
Comment 1 Rodrigo Kumpera 2017-04-21 22:03:48 UTC
Hey Vlad,

Can you take a look at what's going on?
Comment 2 Vlad Brezae 2017-04-22 01:26:18 UTC
There is no out of memory situation here. Mono starts normally, creates some instances for some basic types (like OutOfMemoryException) and then it suddenly stops. Using a x64 mono version loads the program normally for me.

I suspect some weird metadata problems, but I have no means to debug this. Maybe somebody from the windows team can debug where exactly the program stops. I can't even escape ! in powershell, in order to trace calls from osu assembly.
Comment 3 Dean Herbert 2017-04-22 01:27:39 UTC
For what it's worth, I have narrows this down to x64 mono builds on windows (and also x86 builds prior to 5.0). I have since got the assembly to run successfully on mono 5.0 x86.

Please let me know if there's anything further I can do to help investigate this bug.
Comment 4 Dean Herbert 2017-04-22 01:29:16 UTC
Oh sorry, I missed the first part of your last message. Very interesting that we have opposite results with x86 vs x64. I'm not at the windows PC I test on for a couple of days, but will report back as I test further.
Comment 5 Vlad Brezae 2017-04-22 01:45:00 UTC
It seems I can trace all assemblies with "all". No main method is executed so somewhere between runtime initialisation and going to managed we give up.
Comment 6 Vlad Brezae 2017-04-24 10:45:14 UTC
I had actually installed different versions between x86 and x64. I encounter the issue only with 4.8 mono and not with 5.0, regardless whether is 32 or 64 bit. Could you please double check this ?
Comment 7 Dean Herbert 2017-04-28 04:58:11 UTC
On re-testing it does seem that 5.0 handles correctly in both cases. I too did have different versions installed. Sorry for the confusion!

I believe this issue can be closed. Thanks for looking into it.