debugging - Finding the cause of SIGSEGV in Xamarin.iOS app -
i'm working on first real app using xamarin.ios. of times app works great, few times day crashes following stacktrace:
mono-rt: stacktrace: mono-rt: @ <unknown> <0xffffffff> mono-rt: @ (wrapper managed-to-native) monotouch.foundation.nsobject.monotouch_release_managed_ref (intptr) <il 0x00023, 0xffffffff> mono-rt: @ monotouch.foundation.nsobject.releasemanagedref () [0x00000] in /developer/monotouch/source/monotouch/src/foundation/nsobject.cs:98 mono-rt: @ monotouch.foundation.nsobject/nsobject_disposer.drain (monotouch.foundation.nsobject) [0x00062] in /developer/monotouch/source/monotouch/src/shared/foundation/nsobject2.cs:545 mono-rt: @ (wrapper runtime-invoke) <module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <il 0x00050, 0xffffffff> mono-rt: @ <unknown> <0xffffffff> mono-rt: @ (wrapper managed-to-native) monotouch.uikit.uiapplication.uiapplicationmain (int,string[],intptr,intptr) <il 0x0009f, 0xffffffff> mono-rt: @ monotouch.uikit.uiapplication.main (string[],string,string) [0x0004c] in /developer/monotouch/source/monotouch/src/uikit/uiapplication.cs:38 mono-rt: @ diet52app.application.main (string[]) [0x00008] in /users/danielnordmark/projects/diet52app/diet52app/main.cs:16 mono-rt: @ (wrapper runtime-invoke) <module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <il 0x00050, 0xffffffff> mono-rt: native stacktrace: mono-rt: ================================================================= got sigsegv while executing native code. indicates fatal error in mono runtime or 1 of native libraries used application. =================================================================
my guess object gets garbage collected before i'm trying use it. feel bit lost how find out when , in code happends.
how can found out problem is? appreciated!
the problem seemed related uitableviewcontroller, had base class , 2 different instances. conflict between these 2 resulted in sigsegv error.
i managed track problem answer https://stackoverflow.com/a/6769885/248905
the modification had make wrap code invokeonmainthread this,
update: updated solution after had contact rolf @ xamarin, correct fix put code in viewdiddissapear instead of dispose.
public override void viewdiddisappear (bool animated) { searchcontroller.searchresultssource = null; searchcontroller.delegate = null; base.viewdiddisappear (animated); }
Comments
Post a Comment