Bug 45048 - Console.WriteLine() crashes the app
Summary: Console.WriteLine() crashes the app
Status: RESOLVED DUPLICATE of bug 45046
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 10.0 (iOS10)
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2016-10-05 12:03 UTC by Alexey Bogdanov
Modified: 2016-10-05 16:27 UTC (History)
2 users (show)

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

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 Developer Community or GitHub 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:

Description Alexey Bogdanov 2016-10-05 12:03:31 UTC
Calling Console.WriteLine() with some parameters crashes the app or gives strange output.

For example:

In the empty (single view app) application gives this output:
"7            UTF8Stringrc23A2"

In our existing app it gives:
"7           autoreleaserc23A2"

In some cases similar input strings crash the app with this call stack:

critical: Stacktrace:
critical:   at <unknown> <0xffffffff>
critical:   at (wrapper managed-to-native) System.Console/NSLogWriter.xamarin_log (string) <IL 0x00011, 0x0010f>
critical:   at System.Console/NSLogWriter.Flush () [0x0000c] in /Users/builder/data/lanes/3818/ad1cd42d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/Console.iOS.cs:51
critical:   at System.Console/NSLogWriter.Write (char[],int,int) [0x0002f] in /Users/builder/data/lanes/3818/ad1cd42d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/Console.iOS.cs:89
critical:   at System.IO.TextWriter.WriteLine (string) [0x00083] in /Users/builder/data/lanes/3818/ad1cd42d/source/xamarin-macios/
critical:   at System.Console.WriteLine (string) [0x00000] in /Users/builder/data/lanes/3818/ad1cd42d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/Console.cs:429

It's critical bug, cause it can crash the app under some random circumstances.

Comment 1 Timothy Risi 2016-10-05 16:27:56 UTC

*** This bug has been marked as a duplicate of bug 45046 ***