Bug 59436 - MT3001 error
Summary: MT3001 error
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler (show other bugs)
Version: XI 10.12 (d15-3)
Hardware: PC Mac OS
: --- normal
Target Milestone: 15.5
Assignee: Zoltan Varga
URL:
: 59245 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-09-13 07:22 UTC by Jacek Wicherek
Modified: 2017-10-19 08:42 UTC (History)
6 users (show)

See Also:
Tags:
Is this bug a regression?: Yes
Last known good build: XI 10.10.0.36 (d15-2: d2270eec)


Attachments
Xamarin info + build log (3.38 MB, text/plain)
2017-09-13 07:22 UTC, Jacek Wicherek
Details
Build folder (6.47 MB, application/zip)
2017-09-13 08:09 UTC, Jacek Wicherek
Details
XI test project (4.55 KB, application/zip)
2017-10-10 11:11 UTC, Rolf Bjarne Kvinge [MSFT]
Details

Description Jacek Wicherek 2017-09-13 07:22:01 UTC
Created attachment 24708 [details]
Xamarin info + build log

Hello
After upgrading Xamarin Studio on my Mac Mini I received similar error: could not AOT the assembly (MT3001). 
Before upgrading everything was ok.

I attached detailed log from my build and information about Xamarin Version.
Tell me after reading my log if you need the solution that we have to recreate the error.
Comment 1 Zoltan Varga 2017-09-13 07:34:05 UTC
Could you upload the contents of the '/Users/jacekwicherek/Projects/nommono/Nom3AT/Nom3Max/Nom3Max.iOs/obj/iPhone/AppStore_BOS/mtouch-cache/64/Build' directory ?

As a workaround, disable the usage of LLVM in project options.
Comment 2 Jacek Wicherek 2017-09-13 08:09:16 UTC
Created attachment 24712 [details]
Build folder
Comment 3 Alex Soto [MSFT] 2017-09-13 08:41:21 UTC
Confirming this per comment #1
Comment 4 Zoltan Varga 2017-09-13 10:23:27 UTC
I can reproduce the problem.
Comment 5 Zoltan Varga 2017-09-13 17:45:05 UTC
Could you paste the source of the TransferDispositionController::ValidateAmount () method ?
Comment 6 Jacek Wicherek 2017-09-14 06:12:51 UTC
Function's body:

        bool ValidateAmount(bool canAmountBeZero)
        {
            var valid = _ammount < 9999999.0;

            if(valid)
            {
                valid &= canAmountBeZero ? 0.0 <= _ammount :  0.0 < _ammount;
            }            

            if(valid && _freeFunds.HasValue)
            {
                Decimal ammount = new Decimal(_ammount);
                Decimal avaliable = new Decimal(_freeFunds.Value);

                valid = ammount <= avaliable;
            }

            AmountInvalid.Value = !valid;

            return valid;
        }
Comment 7 Zoltan Varga 2017-09-14 06:25:50 UTC
Thanks.

Minimal testcase:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
using System;
using System.Runtime.InteropServices;
using System.IO;
using System.Collections.Generic;
using System.Threading;

class Driver {
	public bool check () {
		bool valid = false;

		double d1 = 1.0;
		double d2 = 2.0;

		Decimal ammount = new Decimal(d1);
		Decimal avaliable = new Decimal(d2);

		valid = ammount <= avaliable;
		return valid;
	}

    static void Main () {
	}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Compile with:
csc /optimize+ bug.cs
mono --aot --llvm bug.exe
Comment 8 Zoltan Varga 2017-09-14 07:12:24 UTC
https://github.com/mono/mono/pull/5572
Comment 9 Zoltan Varga 2017-09-24 08:40:46 UTC
Fixed in mono master 7348e275ffe2683f1b6e5b738e4d21f0fe561835.
Comment 10 Zoltan Varga 2017-09-24 08:42:07 UTC
*** Bug 59245 has been marked as a duplicate of this bug. ***
Comment 11 Rolf Bjarne Kvinge [MSFT] 2017-10-06 07:22:32 UTC
@Zoltan, was this backported to any other branches? It sounds like this is a regression, so we should get it in at least d15-5, if not earlier (xcode9.1 for instance)
Comment 12 Zoltan Varga 2017-10-10 10:10:05 UTC
2017-06: https://github.com/mono/mono/pull/5755
Comment 13 Rolf Bjarne Kvinge [MSFT] 2017-10-10 11:11:35 UTC
Created attachment 25241 [details]
XI test project

Attaching Xamarin.iOS test project (build for Release|iDevice to reproduce the MT3001 error)
Comment 14 Rolf Bjarne Kvinge [MSFT] 2017-10-10 11:16:05 UTC
I can reproduce the regression with d15-3 (and master), but not d15-2.

Note You need to log in before you can comment on or make changes to this bug.