Bug 1622 - --aot -O=all crash: Assertion at mini-x86.c:3061, condition `ins->dreg == MONO_ARCH_GOT_REG' not met
Summary: --aot -O=all crash: Assertion at mini-x86.c:3061, condition `ins->dreg == MON...
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-10-21 01:33 UTC by Kari Takanen
Modified: 2015-04-06 15:49 UTC (History)
4 users (show)

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


Attachments
Stacktrace (8.91 KB, text/plain)
2011-10-21 01:33 UTC, Kari Takanen
Details
the dll (592.00 KB, application/octet-stream)
2011-10-21 01:33 UTC, Kari Takanen
Details


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 Kari Takanen 2011-10-21 01:33:27 UTC
Created attachment 742 [details]
Stacktrace

When trying to "mono --aot -O=all MJ12commonLibMono.dll" it crashes with "Assertion at mini-x86.c:3061, condition `ins->dreg == MONO_ARCH_GOT_REG' not met".

I'll attach both the dll and a stacktrace.


Mono version used: 2.11 (master/63de171 Thu Oct 20 16:59:08 EEST 2011)

OS: Ubuntu 11.10 64-bit
Comment 1 Kari Takanen 2011-10-21 01:33:56 UTC
Created attachment 743 [details]
the dll
Comment 2 Zoltan Varga 2011-10-21 04:48:48 UTC
Seems to be caused by this method, which ends up calling itself in an infinite recursion:

    // method line 632
    .method public static hidebysig
           default int32 CompareOrdinalInUTF8_AsTwoStrings_New (unsigned int8[] bStr1, int32 iOffset1, int32 iLength1, unsigned int8[] bStr2, int32 iOffset2, int32 iLength2)  cil managed
    {
        // Method begins at RVA 0x15e45
        // Code size 14 (0xe)
        .maxstack 8
        IL_0000:  ldarg.0
        IL_0001:  ldarg.1
        IL_0002:  ldarg.2
        IL_0003:  ldarg.3
        IL_0004:  ldarg.s 4
        IL_0006:  ldarg.s 5
        IL_0008:  call int32 class Majestic12.Strings::CompareOrdinalInUTF8_AsTwoStrings_New(unsigned int8[], int32, int32, unsigned int8[], int32, int32)
        IL_000d:  ret
    } // end of method Strings::CompareOrdinalInUTF8_AsTwoStrings_New
Comment 3 Rodrigo Kumpera 2013-09-09 12:08:18 UTC
Hey Zoltan,

I fixed the loader leak in the AOT compiler, but we're back to the above assert:
* Assertion at mini-x86.c:3048, condition `ins->dreg == MONO_ARCH_GOT_REG' not met
Comment 4 Alexander Kyte 2015-04-02 18:54:44 UTC
Is this bug still active or should it be closed? It's been two years since the last comment and the provided test works for me(albeit on osx):

$ mono --aot -O=all MJ12commonLibMono.dll

WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319
Mono Ahead of Time compiler - compiling assembly /Users/akyte/Downloads/MJ12commonLibMono.dll
Could not load signature of Majestic12.InMemoryCompression:GetGzipInputStream due to: Could not load file or assembly or one of its dependencies. assembly:ICSharpCode.SharpZipLib, Version=0.85.4.369, Culture=neutral, PublicKeyToken=1b03e6acf1164f73 type:<unknown type> member:<none>
Code: 1189152(89%) Info: 25029(1%) Ex Info: 35281(2%) Unwind Info: 7025(0%) Class Info: 11173(0%) PLT: 15800(1%) GOT Info: 31585(2%) Offsets: 17003(1%) GOT: 35224
Compiled: 3311/3319 (99%), No GOT slots: 1900 (57%), Direct calls: 2972 (73%)
Executing the native assembler: "clang"  -c -x assembler -o /var/folders/9n/mdh_qr_11ql3r03sxtd91yz80000gn/T/mono_aot_rKod8b.o /var/folders/9n/mdh_qr_11ql3r03sxtd91yz80000gn/T/mono_aot_rKod8b
Executing the native linker: clang --shared -o /Users/akyte/Downloads/MJ12commonLibMono.dll.dylib.tmp  /var/folders/9n/mdh_qr_11ql3r03sxtd91yz80000gn/T/mono_aot_rKod8b.o
Executing dsymutil: dsymutil /Users/akyte/Downloads/MJ12commonLibMono.dll.dylib
JIT time: 1272 ms, Generation time: 494 ms, Assembly+Link time: 3847 ms.
Comment 5 Rodrigo Kumpera 2015-04-06 15:49:58 UTC
Fixing as per the above comment. Please reopen if you experience it again.