Bug 30466 - [Xunit] Running the Xamarin Profiler Xunit tests we get a NRE around TaskAwaiter
Summary: [Xunit] Running the Xamarin Profiler Xunit tests we get a NRE around TaskAwaiter
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-05-26 15:48 UTC by Stephen Shaw
Modified: 2015-11-10 15:02 UTC (History)
4 users (show)

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


Attachments
Stack trace running on Mono 4.2 (cc1cf60) (11.41 KB, text/plain)
2015-11-10 14:59 UTC, Matt Z
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 Stephen Shaw 2015-05-26 15:48:07 UTC
Steps to reproduce:

1. Clone Xamarin Profiler from github.com/xamarin
2. run make
3. cd bin/Debug
4. mono ../../packages/xunit.runner.console.2.0.0/tools/xunit.console.exe XamarinProfiler.Tests.dll

Here is the stacktrace:

DEBUG [2015-05-26 13:41:07Z]:   XamarinProfiler.Tests.Core.given_a_ProfileListener.when_running_then_can_pause_and_resume [FAIL]
 thread Finalizer at -1682481152 loaded
      System.NullReferenceException : Object reference not set to an instance of an object
      Stack Trace:
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x11228f990 + 0x00038> in <filename unknown>:0
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x11228eb20 + 0x00118> in <filename unknown>:0
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x11228e4e0 + 0x000b3> in <filename unknown>:0
           at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x1110d80f0 + 0x00042> in <filename unknown>:0
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult () <0x1110d80c0 + 0x0001a> in <filename unknown>:0
         --- End of stack trace from previous location where exception was thrown ---
           at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x11228f990 + 0x00038> in <filename unknown>:0
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x11228eb20 + 0x00118> in <filename unknown>:0
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x11228e4e0 + 0x000b3> in <filename unknown>:0
           at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x1110d80f0 + 0x00042> in <filename unknown>:0
           at System.Runtime.CompilerServices.TaskAwaiter.GetResult () <0x1110d80c0 + 0x0001a> in <filename unknown>:0
Comment 1 Marek Safar 2015-05-27 11:52:29 UTC
The only real issue I found was with incomplete stack trace for NRE which is now fixed in master as well.
Comment 2 Matt Z 2015-11-10 14:40:53 UTC
We also see this exact problem about 20% of the time we execute our own tests on Mono 4.2.1.91, but never on Windows

Marek, are you suggesting that the bug is in xunit itself then? Can you then identify which commit in Master contained the stacktrace fix so I can attempt to backport it to Mono 4.2?
Comment 3 Marek Safar 2015-11-10 14:43:52 UTC
Mono 4.2 has all fixes we made in this area. If you can still reproduce it with Mono 4.2 we need steps how to reproduce it locally.
Comment 4 Matt Z 2015-11-10 14:59:00 UTC
Created attachment 13767 [details]
Stack trace running on Mono 4.2 (cc1cf60)
Comment 5 Matt Z 2015-11-10 15:02:53 UTC
We see it regularly using Mono 4.2 that was build from commit:
https://github.com/mono/mono/commit/cc1cf601d6439b454efb38a0e28f607b54868abd

I had misspoke about it being 4.2.1.91, but it is not many revs different.

See attached stacktrace.

Making a minimal reproducible case will be difficult, as this occurs while running hundreds of xunit tests.