Bug 50789 - JITting large method fails (condition lvregs_len < 1024 not met)
Summary: JITting large method fails (condition lvregs_len < 1024 not met)
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-12-25 19:18 UTC by domi1819
Modified: 2017-01-16 00:59 UTC (History)
3 users (show)

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

Source code that triggers the bug (44.95 KB, text/plain)
2016-12-25 19:18 UTC, domi1819

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 domi1819 2016-12-25 19:18:32 UTC
Created attachment 18990 [details]
Source code that triggers the bug

I've got a Blake2 hash implementation where the compression method is unrolled. That method spans about 1300 lines.
Running this on a freshly-installed Debian 8 with Mono crashes, presumably when Mono tries to JIT the compression method. A class that compiles with mcs and triggers that bug is attached.

This issue was already reported as https://bugzilla.xamarin.com/show_bug.cgi?id=22150 but wrongly categorized and then abandoned.

upserver@debian:~$ mono Blake2.exe
* Assertion at method-to-ir.c:14949, condition `lvregs_len < 1024' not met


  at <unknown> <0xffffffff>
  at domi1819.UpCore.Crypto.Blake2.Hash (byte[],byte,byte[]) <0x0029b>
  at domi1819.UpCore.Crypto.Blake2.Main () <0x0002b>
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0x000ba>

Native stacktrace:

        mono() [0x4accca]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0xf8d0) [0x7f12a71478d0]
        /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f12a6ba5067]
        /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f12a6ba6448]
        mono() [0x65aae9]
        mono() [0x65acf7]
        mono() [0x65ae46]
        mono() [0x47155a]
        mono() [0x50f63f]
        mono() [0x510253]
        mono() [0x425efc]
        mono() [0x4af809]
        mono() [0x4b0230]

Debug info from gdb:

Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.

Comment 1 Zoltan Varga 2017-01-16 00:59:09 UTC
Fixed by mono master bf1862930b890472e6f93df4ad7e08f1d7620191.