Bug 23936 - Xamarin.Android 4.99 gets unexpected "SIGSEGV 'while executing native code'" when interacting with a RecyclerView
Summary: Xamarin.Android 4.99 gets unexpected "SIGSEGV 'while executing native code'" ...
Status: VERIFIED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 4.18.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2014-10-20 11:13 UTC by Horácio J. C. Filho
Modified: 2015-01-19 14:09 UTC (History)
2 users (show)

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


Attachments
Application for testing the error (2.93 MB, application/octet-stream)
2014-10-20 11:13 UTC, Horácio J. C. Filho
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:
VERIFIED FIXED

Description Horácio J. C. Filho 2014-10-20 11:13:05 UTC
Created attachment 8453 [details]
Application for testing the error

Hello guys, 

I'm writing a library that use the RecyclerView class, it was working very well until I update Xamarin.Android from 4.18 (beta) to 4.99 (alpha) and get an unexpected SIGSEGV while scrolling the RecyclerView and/or touching some items. 

10-20 11:43:10.659 F/        (28646): Object can't be tagged
10-20 11:43:10.659 E/mono-rt (28646): Stacktrace:
10-20 11:43:10.659 E/mono-rt (28646): 
10-20 11:43:10.659 E/mono-rt (28646):   at <unknown> <0xffffffff>
10-20 11:43:10.659 E/mono-rt (28646):   at (wrapper managed-to-native) string.InternalAllocateStr (int) <IL 0x00021, 0xffffffff>
10-20 11:43:10.669 E/mono-rt (28646):   at (wrapper dynamic-method) object.7466441f-36b2-49aa-94af-083faf8ec116 (intptr,intptr,intptr,int) <IL 0x0001d, 0x0005310-20 11:43:10.659 E/mono-rt (28646):   at System.Text.StringBuilder.InternalEnsureCapacity (int) [0x000b1] in /Users/builder/data/lanes/558/af4cb1e9/source/mono/mcs/class/corlib/System.Text/StringBuilder.cs:716
10-20 11:43:10.659 E/mono-rt (28646):   at System.Text.StringBuilder.Append (string) [0x00082] in /Users/builder/data/lanes/558/af4cb1e9/source/mono/mcs/class/corlib/System.Text/StringBuilder.cs:373
10-20 11:43:10.659 E/mono-rt (28646):   at string.FormatHelper (System.Text.StringBuilder,System.IFormatProvider,string,object[]) [0x001dd] in /Users/builder/data/lanes/558/af4cb1e9/source/mono/mcs/class/corlib/System/String.cs:2066
10-20 11:43:10.659 E/mono-rt (28646):   at System.Text.StringBuilder.AppendFormat (System.IFormatProvider,string,object[]) [0x00000] in /Users/builder/data/lanes/558/af4cb1e9/source/mono/mcs/class/corlib/System.Text/StringBuilder.cs:537
10-20 11:43:10.659 E/mono-rt (28646):   at System.Text.StringBuilder.AppendFormat (string,object,object) [0x00000] in /Users/builder/data/lanes/558/af4cb1e9/source/mono/mcs/class/corlib/System.Text/StringBuilder.cs:550
10-20 11:43:10.659 E/mono-rt (28646):   at System.Diagnostics.StackTrace.ToString () [0x00089] in /Users/builder/data/lanes/558/af4cb1e9/source/mono/mcs/class/corlib/System.Diagnostics/StackTrace.cs:200
10-20 11:43:10.659 E/mono-rt (28646):   at Android.Runtime.JNIEnv.NewGlobalRef (intptr) [0x00074] in /Users/builder/data/lanes/558/af4cb1e9/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:532
10-20 11:43:10.659 E/mono-rt (28646):   at Java.Lang.Object.RegisterInstance (Android.Runtime.IJavaObject,intptr,Android.Runtime.JniHandleOwnership,intptr&) [0x00038] in /Users/builder/data/lanes/558/af4cb1e9/source/monodroid/src/Mono.Android/src/Java.Lang/Object.cs:182
10-20 11:43:10.669 E/mono-rt (28646):   at Java.Lang.Object.SetHandle (intptr,Android.Runtime.JniHandleOwnership) [0x00000] in /Users/builder/data/lanes/558/af4cb1e9/source/monodroid/src/Mono.Android/src/Java.Lang/Object.cs:166
10-20 11:43:10.669 E/mono-rt (28646):   at Android.Support.V7.Widget.RecyclerView/ViewHolder..ctor (Android.Views.View) <IL 0x00066, 0x00267>
10-20 11:43:10.669 E/mono-rt (28646):   at HoracioFilho.Galilei.Demo.Activities.Demos.WindowsVersionsStarredViewHolder..ctor (Android.Views.View) [0x00000] in c:\Users\HoracioFilho\Documents\Galilei\Galilei\Demos\Activities\Demos\DynamicListViewActivity.cs:65
10-20 11:43:10.669 E/mono-rt (28646):   at HoracioFilho.Galilei.Demo.Activities.Demos.WindowsVersionsAdapter.OnCreateViewHolder (Android.Views.ViewGroup,int) [0x00046] in c:\Users\HoracioFilho\Documents\Galilei\Galilei\Demos\Activities\Demos\DynamicListViewActivity.cs:119
10-20 11:43:10.669 E/mono-rt (28646):   at Android.Support.V7.Widget.RecyclerView/Adapter.n_OnCreateViewHolder_Landroid_view_ViewGroup_I (intptr,intptr,intptr,int) <IL 0x00014, 0x000ff>
10-20 11:43:10.669 E/mono-rt (28646):   at (wrapper dynamic-method) object.7466441f-36b2-49aa-94af-083faf8ec116 (intptr,intptr,intptr,int) <IL 0x0001d, 0x00053>
10-20 11:43:10.669 E/mono-rt (28646):   at (wrapper native-to-managed) object.7466441f-36b2-49aa-94af-083faf8ec116 (intptr,intptr,intptr,int) <IL 0x00026, 0xffffffff>
10-20 11:43:10.669 E/mono-rt (28646): 
10-20 11:43:10.669 E/mono-rt (28646): =================================================================
10-20 11:43:10.669 E/mono-rt (28646): Got a SIGSEGV while executing native code. This usually indicates
10-20 11:43:10.669 E/mono-rt (28646): a fatal error in the mono runtime or one of the native libraries 
10-20 11:43:10.669 E/mono-rt (28646): used by your application.
10-20 11:43:10.669 E/mono-rt (28646): =================================================================
10-20 11:43:10.669 E/mono-rt (28646): 
10-20 11:43:10.669 F/libc    (28646): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 28646 (ho.galilei.demo)

Plese run attached Galilei's tests application and you will run on that error. A strange fact is that there is no error using Xamarin.Android 4.18, I'm able to scroll and touch items without problems, after updating the problem occurred.

Device info:
Model number Samsung Galaxy S3 Dual chip GT-I8262B
Android version 4.1.2
Build number JZO54K.I8262BVJANB1

System info:
Visual Studio 2013 Update 3
Xamarin.Android 4.99
Android SDK Tools 23.0.2
Android SDK Platform-tools 21
Android SDK Build-tools 21.0.1
Comment 1 Horácio J. C. Filho 2014-10-20 11:15:26 UTC
** System info:
Java JDK 6u39 64-bits
Comment 2 Rajneesh Kumar 2014-10-21 09:51:00 UTC
I have checked this issue an able to reproduce reported behavior. To reproduce this issue I have followed the instruction provided in bug description.

Steps I followed:

1. Open attached sample application in VS
2. Build and run the application on emulator 
3. You will see two items "DynamicListView's demo" & "tabePageIndicator's demo"
4. Click on "DynamicListView's demo" you will see a list view
5. Click some item or scroll the RecyclerView, app stop working with following output in application output.

Application output: https://gist.github.com/sunil360/d46529231c145b634ab2


Please let me know the is this the same behavior/issue you are experiencing,
shown in the screencast ? If no then could you please let me know that what steps should I follow to reproduce this issue. That will be helpful to reproduce this issue at our end.

Please let me know If I am missing anything?

Screencast: http://www.screencast.com/t/kymJlaSsmdC

Environment Info: 


Microsoft Visual Studio Professional 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0444002-02032
Microsoft LightSwitch for Visual Studio 2013

Microsoft Office Developer Tools for Visual Studio 2013 ENU   06177-004-0444002-02032
Microsoft Office Developer Tools for Visual Studio 2013 ENU

Team Explorer for Visual Studio 2013   06177-004-0444002-02032
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0444002-02032
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0444002-02032
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0444002-02032
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0444002-02032
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0444002-02032
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06177-004-0444002-02032
Windows Phone SDK 8.0 - ENU

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.0.11001.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.0
Provides common services for use by Azure Mobile Services and Windows Azure Tools.

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

Microsoft Web Developer Tools 2013   2.0.40926.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

NuGet Package Manager   2.7.40911.287
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.30919.1
Microsoft SQL Server Data Tools

Windows Azure Mobile Services Tools   1.0
Windows Azure Mobile Services Tools

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   4.0.381.0 (cda47a4f438cef077d8f5c0eb79fb5df835c6b99)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.99.0.144 (af4cb1e950dcbc00c3d2c365b24efc1b9fb93671)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.2.0.0 (13fec5ef6bd1d2992ae58cc5147d0e3f988792ca)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 3 Jonathan Pryor 2014-10-24 17:20:21 UTC
@Rajneesh Kumar: Please provide more `adb logcat` output. After the F/libc message there should be debuggerd messages (within ~10 lines) which will provide the native stack trace of the crash, along with registers and other associated information.
Comment 4 Rajneesh Kumar 2014-10-28 07:05:55 UTC
@Jonathan Pryor: These are the 'adb logcat' for the same.

https://gist.github.com/sunil360/9790a5f63829c623a689
Comment 5 Jonathan Pryor 2014-10-28 10:31:53 UTC
@Rajneesh: The output in Comment #4 doesn't include the *beginning* of the debuggerd output. Please provide the complete output.
Comment 6 Rajneesh Kumar 2015-01-19 14:09:15 UTC
I have checked this issue with the following builds:

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.50938
Xamarin   3.9.236.0 (d6a2cae)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android   4.20.0.34 (49a04b966feb40dfdba49d57ba16249b66d606a6)
Visual Studio plugin to enable development for Xamarin.Android.
Xamarin.iOS   8.6.0.0 (eb24bdcf5cba2c12b673a07e0a8cce368b9563b3)
Visual Studio extension to enable development for Xamarin.iOS.
Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

I observed that this issue is not exist any more. Now the aplication is working fine, without any crash/Exception. Here is the screencast for the same:http://www.screencast.com/t/fsaSh0UZ

Hence closing this issue.

Please feel free to reopen it again if anyone faces this issue.