Bug 2152 - No stacktrace for stack overflow
Summary: No stacktrace for stack overflow
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 1.9.2
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2011-11-22 08:58 UTC by Philippe Girolami
Modified: 2011-11-29 13:57 UTC (History)
3 users (show)

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

Releavant logcat (7.38 KB, text/plain)
2011-11-22 08:58 UTC, Philippe Girolami

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 Philippe Girolami 2011-11-22 08:58:55 UTC
Created attachment 928 [details]
Releavant logcat

When running my application, I am getting spurious crashes. Unlike in my other ticket, these happen every single time so it's something related to my code.

My ticket here is to indicate that I never got a reason for the crash. I've attached the logcat. All I notice is
 - activity takes too long to launch & android gives up
 - inputmanager mentions a "remote" exception but doesn't display it
Comment 1 Jonathan Pobst 2011-11-22 12:23:24 UTC
Can you try running without the debugger (Ctrl-F5) and if it crashes, please post that log as well.

I think the mono.android.Seppuku is unrelated, and this should confirm it.
Comment 2 Philippe Girolami 2011-11-23 04:45:15 UTC
Jonathan, I've seen crashes without the seppuku line.
Comment 3 Philippe Girolami 2011-11-23 05:20:06 UTC
It turns out that the bug was an infinite recursion on 3 levels in my app:
method A -> method B -> method A

It would be nice to get a stackoverflow or something :)
Comment 4 Jonathan Pryor 2011-11-29 13:57:35 UTC
This may be fixed in the next major release, at least for the trivial case:
	int c;
	void Foo ()
		Android.Util.Log.Info ("*jonp*", "Infinite Recursion! Foo count={0}", c++);
		Bar ();
	void Bar ()
		Android.Util.Log.Info ("*jonp*", "Infinite Recursion! Bar count={0}", c++);
		Foo ();

This generates the following output on the Application Output pad in MonoDevelop:

> I/*jonp*  (16229): Infinite Recursion! Foo count=11808
> F/        (16229): * Assertion at ../../../../mono/metadata/sgen-gc.c:5140, condition `info->stack_start >= info->stack_start_limit && info->stack_start < info->stack_end' not met
> I/mono    (16229): Stacktrace:
> I/mono    (16229): 
> I/mono    (16229):   at string.CreateString (char[],int,int) <0x0005f>
> I/mono    (16229):   at (wrapper managed-to-managed) string..ctor (char[],int,int) <0xffffffff>
> I/mono    (16229):   at System.NumberFormatter.FormatDecimal (int,System.Globalization.NumberFormatInfo) <0x00083>
> I/mono    (16229):   at System.NumberFormatter.IntegerToString (string,System.IFormatProvider) <0x000f3>
> I/mono    (16229):   at System.NumberFormatter.NumberToString (string,int,System.IFormatProvider) <0x0004f>
> I/mono    (16229):   at int.ToString (string,System.IFormatProvider) <0x00027>
> I/mono    (16229):   at string.FormatHelper (System.Text.StringBuilder,System.IFormatProvider,string,object[]) <0x0058f>
> I/mono    (16229):   at string.Format (System.IFormatProvider,string,object[]) <0x00027>
> I/mono    (16229):   at string.Format (string,object[]) <0x0001f>
> I/mono    (16229):   at Android.Util.Log.Info (string,string,object[]) <0x0001f>
> I/mono    (16229):   at Scratch.Debug.Activity1.Bar () <0x0007b>
> I/mono    (16229):   at Scratch.Debug.Activity1.Foo () <0x00083>

It's plausible that more complicated methods won't be tracked, as detecting stack overflow is difficult, but we do try...