ShinobiGrid 2.6.0 for Xamarin crashes


#1

Hello,

we tried to use the latest grids but we ran into some crashes and reverted to 2.5.1. 

The log is below. We also have the problem (in the old versions too) that sometimes the background color of the header dissapears (from blue becomes white) and sometimes the labels of the columns in the header are not horizontally aligned.

Are these known issues, is there a fix?

Many thanks,

Calin

Apr  9 10:04:41 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: Stacktrace:

Apr  9 10:04:41 Boris-Gebauers-iPad kernel[0] <Debug>: void IMGSGXParameterBuffer::checkUsageForGrow() - WARNING - PB unable to grow, as max size reached (0)->(0)

Apr  9 10:04:41 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>:   at <unknown> <0xffffffff>

Apr  9 10:04:41 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>:   at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>

Apr  9 10:04:41 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>:   at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/.pmcs-compat.UIApplication.cs:38

Apr  9 10:04:41 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>:   at TimeLineCRM.Application.Main (string[]) [0x00008] in /Users/borisgebauer/SVN/Jubilaeum/trunk/TimeLineCRM/TimeLineCRM/Main.cs:18

Apr  9 10:04:41 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>

Apr  9 10:04:41 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 

Native stacktrace:

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 0   TimeLineCRMStacked                  0x011cb3f1 mono_handle_native_sigsegv + 260

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 1   TimeLineCRMStacked                  0x011d6299 mono_sigsegv_signal_handler + 176

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 2   libsystem_platform.dylib            0x3955df93 _sigtramp + 42

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 3   UIKit                               0x30afe7b9 <redacted> + 36

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 4   UIKit                               0x30afe74d <redacted> + 24

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 5   UIKit                               0x30affdb5 <redacted> + 72

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 6   TimeLineCRMStacked                  0x00219753 -[SEssentialsPullToActionDefaultStatusView dealloc] + 314

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 7   TimeLineCRMStacked                  0x0023af03 -[SEssentialsPullToAction dealloc] + 574

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 8   TimeLineCRMStacked                  0x0021cb8b -[ShinobiDataGrid dealloc] + 334

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 9   CoreFoundation                      0x2e1bd97d CFRelease + 556

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 10  CoreFoundation                      0x2e1c8e59 <redacted> + 156

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 11  libobjc.A.dylib                     0x38f45b6b <redacted> + 174

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 12  libobjc.A.dylib                     0x38f460d7 <redacted> + 358

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 13  CoreFoundation                      0x2e1c0ca9 _CFAutoreleasePoolPop + 16

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 14  CoreFoundation                      0x2e2561cb <redacted> + 1306

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 15  CoreFoundation                      0x2e1c0f4f CFRunLoopRunSpecific + 522

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 16  CoreFoundation                      0x2e1c0d33 CFRunLoopRunInMode + 106

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 17  GraphicsServices                    0x330f3663 GSEventRunModal + 138

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 18  UIKit                               0x30b0c16d UIApplicationMain + 1136

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 19  TimeLineCRMStacked                  0x00b90dd4 wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 272

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 20  TimeLineCRMStacked                  0x00b4a870 MonoTouch_UIKit_UIApplication_Main_string___string_string + 300

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 21  TimeLineCRMStacked                  0x00244438 TimeLineCRM_Application_Main_string__ + 172

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 22  TimeLineCRMStacked                  0x005ab734 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 23  TimeLineCRMStacked                  0x011d83b5 mono_jit_runtime_invoke + 1196

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 24  TimeLineCRMStacked                  0x01221b19 mono_runtime_invoke + 88

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 25  TimeLineCRMStacked                  0x012258fb mono_runtime_exec_main + 282

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 26  TimeLineCRMStacked                  0x0122573b mono_runtime_run_main + 474

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 27  TimeLineCRMStacked                  0x011c1fb5 mono_jit_exec + 48

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 28  TimeLineCRMStacked                  0x0128319c main + 2464

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 29  libdyld.dylib                       0x39443ab7 <redacted> + 2

Apr  9 10:04:42 Boris-Gebauers-iPad TimeLineCRMStacked[2926] <Error>: 

=================================================================

Got a SIGSEGV while executing native code. This usually indicates

a fatal error in the mono runtime or one of the native libraries 

used by your application.

=================================================================

Apr  9 10:04:42 Boris-Gebauers-iPad ReportCrash[2927] <Notice>: ReportCrash acting against PID 2926

Apr  9 10:04:42 Boris-Gebauers-iPad ReportCrash[2927] <Notice>: Formulating crash report for process TimeLineCRMStacked[2926]

Apr  9 10:04:42 Boris-Gebauers-iPad com.apple.launchd[1] (UIKitApplication:timeline.mobile.crm.12.prototype[0xe6da][2926]) <Warning>: (UIKitApplication:timeline.mobile.crm.12.prototype[0xe6da]) Job appears to have crashed: Abort trap: 6

Apr  9 10:04:42 Boris-Gebauers-iPad backboardd[29] <Warning>: Application ‘UIKitApplication:timeline.mobile.crm.12.prototype[0xe6da]’ exited abnormally with signal 6: Abort trap: 6

Apr  9 10:04:42 Boris-Gebauers-iPad ReportCrash[2927] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/TimeLineCRMStacked_2014-04-09-100442_Boris-Gebauers-iPad.ips using uid: 0 gid: 0, synthetic_euid: 501 egid: 0


#2

Hi Calin,

This isn’t an issue we’ve seen at our end so far. Would you be able to send us a copy of your project so we can replicate the issue at this end? That should allow us to determine what is going wrong.

Many thanks,

Dan


#3

Hello Dan,

I have sent an email with a testcase at info@shinobicontrols.com

Many thanks,
Calin


#4

Hi Calin,

Thank you for sending over that sample project. We have now replicated the problem at this end, and we shall get back to you once we have made progress on the issue.

Many thanks,

Dan


#5

Hi Calin,

I think we’ve found the cause of the crash. The new version of ShinobiGrids contains a Pull to Action control (taken from Essentials - similar to the refresh control which is used in the Twitter app). This contains a UIActivityIndicatorView. Although the view is hidden and not animating when you attempt to dispose of it, the crash appears to be caused by trying to dispose of the indicator view when the view disappears. In the RemoveAndDisposeRecursively method within the app you sent over, I updated the code to the following:

public static void RemoveAndDisposeRecursively(UIView view)
        {
            if (view == null)
            {
                return;
            }

            if (view.Subviews != null)
            {
                foreach (var subview in view.Subviews)
                {
					if (subview is UIActivityIndicatorView) {
						subview.RemoveFromSuperview ();
					} else {
						RemoveAndDisposeRecursively (subview);
					}
                }
            }
				
			view.RemoveFromSuperview ();
			view.Dispose();
        }
    }

Just removing the indicator view from its subview, rather than disposing of it as well, seems to stop the crash happening. I’ve run Instruments against the sample app with this code, and the UIActivityIndicatorView seems to be getting cleaned up correctly.

The fact that you’re having to manually dispose of your views in your ViewWillDisappear method suggests that you have strong reference cycles within your app. Would another approach be to identify and then eliminate these strong cycles? Then you wouldn’t need to dispose of the views yourself, you would be able to leave that to the garbage collector. Is this something you’ve already looked into?

Many thanks,

Dan


#6

Hello Dan,

many thanks for the solution, it works for us. We’ve also looked into those dispose issues and it seems that our problems and the way we implemented dispose stems from MonoTouch.Dialog - there are some memory leaks.

Best regards,

Calin