Bug 5638 - UITableViewSource::SectionIndexTitles trampoline call results in _sigtramp signalled.
Summary: UITableViewSource::SectionIndexTitles trampoline call results in _sigtramp si...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 5.3.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2012-06-13 14:44 UTC by Matthew Tebbs
Modified: 2012-07-26 12:19 UTC (History)
2 users (show)

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


Attachments
Stack trace with native_to_managed_trampoline_MuddyTummy_UI_iOS_TableView_GroupedListSource_1_SectionIndexTitles. (7.76 KB, text/plain)
2012-06-13 14:44 UTC, Matthew Tebbs
Details
Reduced test case. (8.70 KB, application/zip)
2012-06-20 17:22 UTC, Matthew Tebbs
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 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:
Status:
RESOLVED FIXED

Description Matthew Tebbs 2012-06-13 14:44:48 UTC
Created attachment 2049 [details]
Stack trace with native_to_managed_trampoline_MuddyTummy_UI_iOS_TableView_GroupedListSource_1_SectionIndexTitles.

As an aside this issue is showing in a similar section of code to the last one I entered (https://bugzilla.novell.com/show_bug.cgi?id=684281 imported as http://bugzilla.xamarin.com/show_bug.cgi?id=54).

Description of Issue:
~~~~~~~~~~~~~~~~~~~~~

When executed on device (debug or release) _sigtramp is signalled in context of UITableViewSource::SectionIndexTitles() call. Attached files shows stack trace.

Disabling the new trampolines by adding --noregistrar to mtouch arguments does not reproduce the issue.

If you note in the stack trace GroupedListSource is the context. The base class of this is a generic,

public abstract class Source<T> : UITableViewSource /* UITableViewDataSource and UITableViewDelegate combined */ where T : class
{
    ... foo ...
}

And GroupedListSource is derived from this thus,

public abstract class GroupedListSource<T> : Source<T> where T : class
{
    public override string[] SectionIndexTitles(UITableView tableview)
    {
        ... foo ...
    }
}		

Environment:
~~~~~~~~~~~~

MonoDevelop 3.0.3.1
Mono 2.10.9
MonoTouch 5.3.4
Mac OS X 10.7.4
iOS 5.1.1

I expect that I can provide reduced code that reproduces the issue if required.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-06-20 08:32:07 UTC
I tried the sample project here: https://bugzilla.novell.com/show_bug.cgi?id=684281#c7, but it works correctly, so I'd appreciate it if you could upload a new test case.

It doesn't have to be a reduced test case, registrar bugs are usually quite easy to find even with big test cases.
Comment 2 Matthew Tebbs 2012-06-20 17:22:08 UTC
Created attachment 2094 [details]
Reduced test case.

Oddly there are two variants, at bottom of tableview main file, such that one will reproduce the __sigtramp and the other will not. The difference is an enum value passed as an argument.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2012-06-21 06:17:53 UTC
Fixed (monotouch master: 2072b1a518044a346f5d9cb0f7ae09cb0b9dda7a).

The fix will be included in 5.3.5.

The crash happens when SectionIndexTitles returns null, so for a workaround you can just return an zero-length array instead in SectionIndexTitles until the next version is released.
Comment 4 Matthew Tebbs 2012-06-21 12:37:47 UTC
Verified the workaround fixed the issue with 5.3.4. I'll wait on 5.3.5 to revert the change and re-verify. Thanks Rolf.
Comment 5 Matthew Tebbs 2012-07-26 12:19:41 UTC
Verified fix in 5.3.5 Beta with my local code sans workaround. Thanks.