Bug 59956 - [llvm][bitcode] [FAIL] UniqueIdTest.Ctor_Id (System.Runtime.Serialization tests)
Summary: [llvm][bitcode] [FAIL] UniqueIdTest.Ctor_Id (System.Runtime.Serialization tests)
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler (show other bugs)
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: 15.5
Assignee: Zoltan Varga
Depends on:
Reported: 2017-10-04 14:02 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2017-10-20 08:40 UTC (History)
1 user (show)

See Also:
Is this bug a regression?: Yes
Last known good build: d15-4

minimal testcase (842 bytes, text/plain)
2017-10-13 20:18 UTC, Zoltan Varga
XI test project (90.12 KB, application/zip)
2017-10-20 08:39 UTC, Rolf Bjarne Kvinge [MSFT]

Description Rolf Bjarne Kvinge [MSFT] 2017-10-04 14:02:42 UTC

* Run "make run-watchos-dev-System.Runtime.Serialization CONFIG=Release" in xamarin-macios/tests


> [FAIL] UniqueIdTest.Ctor_Id : System.NullReferenceException : Object reference not set to an instance of an object.

Complete test log: https://gist.github.com/rolfbjarne/e92d1cf89f7d3985e1cfa481dfb53a59
Complete build log: https://gist.github.com/rolfbjarne/dd0401611192e97e60ca44c7e91aa32c

This does not happen with d15-4 nor d15-3, so it's a regression.

It only happens with watchOS on device in Release mode.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2017-10-10 16:36:04 UTC
This test code fails:

> new int [1].Concat (new int [2]).ToArray ();

while this works:

> new object [1].Concat (new object [2]).ToArray ();

it fails somewhere inside .ToArray:

> System.NullReferenceException: Object reference not set to an instance of an object.
>   at System.Collections.Generic.ArrayBuilder`1[T].First () <0x39550d + 0x00064> in <160d2620587c4d0eb0956e998349bb70>:0 
>   at System.Linq.Enumerable+Concat2Iterator`1[TSource].ToArray () <0x38cfa1 + 0x00442> in <160d2620587c4d0eb0956e998349bb70>:0 
>   at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] ) <0xa9d37 + 0x001a0> in <160d2620587c4d0eb0956e998349bb70>:0
Comment 3 Zoltan Varga 2017-10-13 20:18:16 UTC
Created attachment 25305 [details]
minimal testcase
Comment 4 Zoltan Varga 2017-10-13 22:44:46 UTC

Note that the fix has only been tested on desktop, not on watchos.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2017-10-18 16:48:05 UTC
I've tested the fix locally on watchOS, and it works.
Comment 6 Rolf Bjarne Kvinge [MSFT] 2017-10-20 08:39:54 UTC
Created attachment 25378 [details]
XI test project

Attaching XI test project for QA.

To repro:

* Open project
* Select the monotouch-test-watchos-app project as the startup project
* Select Release|watchDevice as the configuration
* Run

It will print "FAILURE!" to the application output when failing, and "SUCCESS!" if successful.

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