Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 for Bug 58600 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 24042 [details]
~6MB Single file program.cs compressed in a zip file
Mono C# compiler hangs on a generated program.cs ~6MB while microsoft C# compiler compiles it in 1 second or so.
It happens on older versions of the compiler too, but worked on even older versions (the one that comes from ubuntu 12.04 seems to work fine).
I have attached the program.cs file.
How to reproduce on windows:
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc" /unsafe+ program.cs # compiles in 1 second
"c:\Program Files\Mono\lib\mono\4.5\mcs" /unsafe+ program.cs # hangs forever. Probably an infinite loop somewhere.
In linux happens too (reproduced on travis on ubuntu 14.04):
https://travis-ci.org/jtransc/jtransc/builds/261263534#L9099 # Ubuntu 14.04 - hangs
https://travis-ci.org/jtransc/jtransc/builds/257048300#L5361 # Ubuntu 12.04 - works
Context (probably not necessary):
The file is generated from this Java/Kotlin code:
Into C# sourcecode. Works like IKVM but generates sourcecode and strips unused dependencies (tree shaking) generating a single cs that later is converted into a single exe. So the 6MB program.cs contains everywhing necessary to compile that program. Since it uses pointers to improve performance in specific places it requires /unsafe+ flag.
And I'm trying to upadte travis to trusty: https://github.com/jtransc/jtransc/pull/226 but hangs
I have tried to figure out why it hangs (probably an specific syntax or something), but probably you will find it faster if you can debug the compiler and pause on the infinite loop.
This looks like flowanalysis issue caused by few recursive goto(s)
Great that it is confirmed
Since I'm generating code from bytecode, those gotos probably are generating irreductible CFGs in some cases