Bug 58829 - Application Output Window being flooded with "[Mono] worker parking, [Mono] worker unparking" messages when debugging agasint Android Emulator.
Summary: Application Output Window being flooded with "[Mono] worker parking, [Mono] w...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 15.4
Assignee: Marek Safar
URL:
: 58967 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-08-16 22:33 UTC by Ammar Mheir
Modified: 2017-09-06 10:51 UTC (History)
14 users (show)

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


Attachments

Description Ammar Mheir 2017-08-16 22:33:01 UTC
##Overview

When debugging to Android Emulator from Visual Studio 2017 for Mac version 7.1 (Build 1297), the "Application Output" window will begin displaying these messages at a very high frequency:
 
>[Mono] [0xb83ea200] worker unparking, timeout? no interrupted? no
>[Mono] [0xb83ea200] worker parking
>[Mono] [0xb83e75c0] worker unparking, timeout? no interrupted? no
>[Mono] [0xb83e75c0] worker parking
>[Mono] [0xb83e71f0] worker unparking, timeout? no interrupted? no
>[Mono] [0xb83ea200] worker unparking, timeout? no interrupted? no
>[Mono] [0xb83ea200] worker parking
>[Mono] [0xb83e71f0] worker parking
>[Mono] [0xb83e75c0] worker unparking, timeout? no interrupted? no
>[Mono] [0xb83e75c0] worker parking
>[Mono] [0xb83ea200] worker unparking, timeout? no interrupted? no
>[Mono] [0xb83ea200] worker parking
>[Mono] [0xb83e71f0] worker unparking, timeout? no interrupted? no
>[Mono] [0xb83e75c0] worker unparking, timeout? no interrupted? no
>[Mono] [0xb83e75c0] worker parking
>[Mono] [0xb83e71f0] worker parking
This occurs regardless if a Xamarin.Android or Xamarin.Forms application was created from template. A few users have also noted that this is observed when debugging against the iOS Simulator as well: https://stackoverflow.com/questions/45689986/strange-debug-output-in-app-since-upgrade-to-visual-studio-2017-15-3-0 

Theses messages are being flooded into the Application Output window making is difficult to read any other custom logs outputted for debugging. This occurs regardless if the Android Emulator is being interacted with or not. 


##Steps to replicate

1- Create new single page Xamarin.Android application in VS for Mac on latest stable release
2- Build -> Debug against a Google Android Emulator
3- Observe Application Output window displaying the [Mono] messages making it difficult to read any other custom logs outputted to the output window.


##Version Information 

=== Visual Studio Enterprise 2017 for Mac ===

Version 7.1 (build 1297)
Installation UUID: 1621b137-c1b7-473d-9609-23de9d4cac12
Runtime:
	Mono 5.2.0.215 (d15-3/da80840) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000215

=== NuGet ===

Version: 4.3.0.2418

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 7.4.0.19 (Visual Studio Enterprise)
Android SDK: /Users/amamac/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.4 (API level 19)
		6.0 (API level 23)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.6
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.iOS ===

Version: 10.12.0.18 (Visual Studio Enterprise)
Hash: 4a279c9a
Branch: d15-3
Build date: 2017-08-02 12:38:11-0400

=== Xamarin.Mac ===

Version: 3.6.0.17 (Visual Studio Enterprise)

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 701001297
Git revision: 9c5299666538b2f8baf501418a5c064d784d64da
Build date: 2017-08-07 11:29:35-04
Xamarin addins: 3bb0c32a14f1b7e368bf5ac53a84c3581c019391
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.3
Darwin 16.4.0 Darwin Kernel Version 16.4.0
    Thu Dec 22 22:53:21 PST 2016
    root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64
Comment 1 softlion 2017-08-17 09:29:14 UTC
+1
Comment 2 Silviu Lupu 2017-08-17 13:56:50 UTC
+1

This happens to me in Debug and Release configuration, on Xamarin.Android
Comment 3 Ammar Mheir 2017-08-17 15:02:50 UTC
Setting this to CONFIRMED as we have multiple users replicating issue.
Comment 4 David Karlaš 2017-08-18 06:25:01 UTC
It's my understanding this was caused by lowered logging level in XA, from discussion on slack it probably should be raised to MONO_LOG_LEVEL=message.

More about this was discussed at https://xamarinhq.slack.com/archives/C03CEGRUW/p1496775075662467

Also setting to 15.4 to raise awareness since it has many reports, maybe it can be moved to 15.5.
Comment 5 Uwe Schaller 2017-08-18 07:42:06 UTC
Is there a walkaround to change the MONO_LOG_LEVEL?
This bug is really disturbing!

I cannot see your slack discussion, because I have no account.
Comment 6 David Karlaš 2017-08-18 10:55:00 UTC
Workaround is to set environment variable MONO_LOG_LEVEL=message, you can do this either by `adb shell setprop debug.mono.env "MONO_LOG_LEVEL=info"` or by adding file to your project with `MONO_LOG_LEVEL=info` as content and setting "AndroidEnviorment" as build action.

More on how to set environment variables in Xamarin.Android you can read at https://developer.xamarin.com/guides/android/advanced_topics/environment/.
Comment 7 Ammar Mheir 2017-08-18 16:59:15 UTC
Similar workaround mentioned here as well:
https://stackoverflow.com/a/45751107/5957162
Comment 8 Jonathan Pryor 2017-08-21 14:24:10 UTC
@Ludovic: Could you please change the log level for the "worker parking" messages to DEBUG instead of INFO?
Comment 9 Marek Safar 2017-08-22 16:38:24 UTC
PR pending https://github.com/mono/mono/pull/5422
Comment 10 Marek Safar 2017-08-23 08:40:22 UTC
Fixed in master,2017-08,2017-06,2017-04
Comment 11 Jon Douglas [MSFT] 2017-08-23 17:16:49 UTC
*** Bug 58967 has been marked as a duplicate of this bug. ***
Comment 12 Neeraj Deshmukh 2017-08-28 11:28:15 UTC
Verified on Visual Studio Enterprise 2017 for Mac.

Build Taken from:
XA- https://wrench.internalx.com/Wrench/ViewLane.aspx?lane_id=4986&host_id=163&revision_id=909876 
Mono- https://wrench.internalx.com/Wrench/ViewLane.aspx?lane_id=5195&host_id=148&revision_id=909633

Build Info: https://gist.github.com/neerajdeshmukh/05a96d30782c3386038856dd63e14a2e

Screencast: https://www.screencast.com/t/MtKHBvIyxEM

Steps Performed:
1- Create new single page Xamarin.Android application in VS for Mac
2- Build -> Debug against a Google Android Emulator
3- Observe Application Output window.

Observation:
Application Output Window is not  flooded with Mono-worker parking or Mono-worker unparking messages when debugging against Android Emulator.
IDE Logs attached. [Ide.2017-08-28__15-25-43.log](https://trello-attachments.s3.amazonaws.com/599adaf62ddf4e24ef9d0d94/599adaf62ddf4e24ef9d0dbc/1a9eaa036276a7c55bfcc74f22217a5c/Ide.2017-08-28__15-25-43.log) 

Kindly let us know if anything else is required as validation process.
Comment 13 softlion 2017-08-31 12:44:52 UTC
Intermediary solution: filter adb by tag:

./adb logcat Mono:I

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