Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nordis
I'm having problem to find the cause of random crashes in my app. The crashes only occurs when I build in release mode and run on a device like iPhone or iPad. Running in debug on simulator no crashes occurs. My guess is that the problem has something to do with these two lines in the crash log,

6   UIKit                           0x34a193d0 -[UISearchDisplayController _destroyManagedTableView] + 68
7   UIKit                           0x34a2195a -[UISearchDisplayController dealloc] + 94
I've uploaded the source code of my UITableViewController and the full crash log here, https://gist.github.com/Nordis/6128735

All help to track the cause of the crashes is much appreciated!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nic Wise
Hi Nordis

If I had to guess, I'd say this is the problem

protected override void Dispose (bool disposing)
{
// Hopefully fixes SIGSEGV error
// http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
BeginInvokeOnMainThread (() => {
searchController.Delegate = null;
searchController.SearchResultsDelegate = null;
searchController.SearchResultsSource = null;
});
base.Dispose (disposing);
}


BeginInvokeOnMainThread will call it and return immediately - so your
searchController may have been disposed of by the time the background
thread runs.

try changing it to either not use the call at all, or use
InvokeOnMainThread, which waits for the code to execute before
continuing.


"Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method waits
for the main thread to execute the method, and does not return until
the code pointed by action has completed running."




On 1 August 2013 09:16, Nordis <[hidden email]> wrote:

> I'm having problem to find the cause of random crashes in my app. The crashes
> only occurs when I build in release mode and run on a device like iPhone or
> iPad. Running in debug on simulator no crashes occurs. My guess is that the
> problem has something to do with these two lines in the crash log,
>
> 6   UIKit                           0x34a193d0 -[UISearchDisplayController
> _destroyManagedTableView] + 68
> 7   UIKit                           0x34a2195a -[UISearchDisplayController
> dealloc] + 94
> I've uploaded the source code of my UITableViewController and the full crash
> log here, https://gist.github.com/Nordis/6128735
>
> All help to track the cause of the crashes is much appreciated!
>
>
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nordis
Thanks for your quick reply,

I've tried to change BeginInvokeOnMainThread to InvokeOnMainThread, but still the same problem. The crash dump looks the same to me, https://gist.github.com/Nordis/6129637

Then I tried to remove InvokeOnMainThread and only set the properties to null,
    searchController.Delegate = null;
    searchController.SearchResultsDelegate = null;
    searchController.SearchResultsSource = null;
  

But then I got this exception,
MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency error: you are calling a UIKit method that can only be invoked from the UI thread.
  at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in <filename unknown>:0 
  at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate (MonoTouch.Foundation.NSObject value) [0x00000] in <filename unknown>:0 
  at MonoTouch.UIKit.UISearchDisplayController.set_Delegate (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in <filename unknown>:0 
  at Diet52App.FoodSearchBase.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0 
  at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in <filename unknown>:0 

I got the idea to set searchController's properties to null by reading this thread,

Best regards,

Daniel


2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
Hi Nordis

If I had to guess, I'd say this is the problem

protected override void Dispose (bool disposing)
{
// Hopefully fixes SIGSEGV error
// http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
BeginInvokeOnMainThread (() => {
searchController.Delegate = null;
searchController.SearchResultsDelegate = null;
searchController.SearchResultsSource = null;
});
base.Dispose (disposing);
}


BeginInvokeOnMainThread will call it and return immediately - so your
searchController may have been disposed of by the time the background
thread runs.

try changing it to either not use the call at all, or use
InvokeOnMainThread, which waits for the code to execute before
continuing.


"Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method waits
for the main thread to execute the method, and does not return until
the code pointed by action has completed running."




On 1 August 2013 09:16, Nordis <[hidden email]> wrote:

> I'm having problem to find the cause of random crashes in my app. The crashes
> only occurs when I build in release mode and run on a device like iPhone or
> iPad. Running in debug on simulator no crashes occurs. My guess is that the
> problem has something to do with these two lines in the crash log,
>
> 6   UIKit                           0x34a193d0 -[UISearchDisplayController
> _destroyManagedTableView] + 68
> 7   UIKit                           0x34a2195a -[UISearchDisplayController
> dealloc] + 94
> I've uploaded the source code of my UITableViewController and the full crash
> log here, https://gist.github.com/Nordis/6128735
>
> All help to track the cause of the crashes is much appreciated!
>
>
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch



--
Nic Wise
t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch



To unsubscribe from Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nic Wise
That SO question is from 2011, and the GC and other things have
changed hugely since then, esp in 6.4 (the latest one) which is Mono
3.x as well as having a new GC by default

So you may not even need to do that. What happens if you take it out completely?

Rolf is often around here, so he may be able to expand on it a bit.

On 1 August 2013 09:53, Nordis <[hidden email]> wrote:

> Thanks for your quick reply,
>
> I've tried to change BeginInvokeOnMainThread to InvokeOnMainThread, but
> still the same problem. The crash dump looks the same to me,
> https://gist.github.com/Nordis/6129637
>
> Then I tried to remove InvokeOnMainThread and only set the properties to
> null,
>     searchController.Delegate = null;
>     searchController.SearchResultsDelegate = null;
>     searchController.SearchResultsSource = null;
>
> But then I got this exception,
> MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency error: you are
> calling a UIKit method that can only be invoked from the UI thread.
>   at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in <filename
> unknown>:0
>   at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate
> (MonoTouch.Foundation.NSObject value) [0x00000] in <filename unknown>:0
>   at MonoTouch.UIKit.UISearchDisplayController.set_Delegate
> (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in <filename
> unknown>:0
>   at Diet52App.FoodSearchBase.Dispose (Boolean disposing) [0x00000] in
> <filename unknown>:0
>   at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in <filename
> unknown>:0
>
> I got the idea to set searchController's properties to null by reading this
> thread,
> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>
> Best regards,
>
> Daniel
>
>
> 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>>
>> Hi Nordis
>>
>> If I had to guess, I'd say this is the problem
>>
>> protected override void Dispose (bool disposing)
>> {
>> // Hopefully fixes SIGSEGV error
>> //
>> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> BeginInvokeOnMainThread (() => {
>> searchController.Delegate = null;
>> searchController.SearchResultsDelegate = null;
>> searchController.SearchResultsSource = null;
>> });
>> base.Dispose (disposing);
>> }
>>
>>
>> BeginInvokeOnMainThread will call it and return immediately - so your
>> searchController may have been disposed of by the time the background
>> thread runs.
>>
>> try changing it to either not use the call at all, or use
>> InvokeOnMainThread, which waits for the code to execute before
>> continuing.
>>
>>
>> "Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method waits
>> for the main thread to execute the method, and does not return until
>> the code pointed by action has completed running."
>>
>>
>>
>>
>> On 1 August 2013 09:16, Nordis <[hidden email]> wrote:
>>
>> > I'm having problem to find the cause of random crashes in my app. The
>> > crashes
>> > only occurs when I build in release mode and run on a device like iPhone
>> > or
>> > iPad. Running in debug on simulator no crashes occurs. My guess is that
>> > the
>> > problem has something to do with these two lines in the crash log,
>> >
>> > 6   UIKit                           0x34a193d0
>> > -[UISearchDisplayController
>> > _destroyManagedTableView] + 68
>> > 7   UIKit                           0x34a2195a
>> > -[UISearchDisplayController
>> > dealloc] + 94
>> > I've uploaded the source code of my UITableViewController and the full
>> > crash
>> > log here, https://gist.github.com/Nordis/6128735
>> >
>> > All help to track the cause of the crashes is much appreciated!
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> > http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
>> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> > _______________________________________________
>> > MonoTouch mailing list
>> > [hidden email]
>> > http://lists.ximian.com/mailman/listinfo/monotouch
>>
>>
>>
>> --
>> Nic Wise
>> t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806"
>> target="_blank">+44 7788 592 806 | @fastchicken
>> b. http://www.fastchicken.co.nz/
>> _______________________________________________
>> MonoTouch mailing list
>> [hidden email]
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658406.html
>> To unsubscribe from Crash related to UITableViewController /
>> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> NAML
>
>
>
> ________________________________
> View this message in context: Re: Crash related to UITableViewController /
> UISearchDisplayController in MonoTouch/Xamarin.iOS
>
> Sent from the MonoTouch mailing list archive at Nabble.com.
>
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nordis
Same problem if I remove that code,

I was able to reproduce the crash a lot quicker when I removed the code, usually the crash occurs after 1-2 minutes. But with no code att all in Dispose the crash occured after a few seconds.

Also the crash only seems to happens when I compile in release mode. 


2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
That SO question is from 2011, and the GC and other things have
changed hugely since then, esp in 6.4 (the latest one) which is Mono
3.x as well as having a new GC by default

So you may not even need to do that. What happens if you take it out completely?

Rolf is often around here, so he may be able to expand on it a bit.

On 1 August 2013 09:53, Nordis <[hidden email]> wrote:

> Thanks for your quick reply,
>
> I've tried to change BeginInvokeOnMainThread to InvokeOnMainThread, but
> still the same problem. The crash dump looks the same to me,
> https://gist.github.com/Nordis/6129637
>
> Then I tried to remove InvokeOnMainThread and only set the properties to
> null,
>     searchController.Delegate = null;
>     searchController.SearchResultsDelegate = null;
>     searchController.SearchResultsSource = null;
>
> But then I got this exception,
> MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency error: you are
> calling a UIKit method that can only be invoked from the UI thread.
>   at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in <filename
> unknown>:0
>   at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate
> (MonoTouch.Foundation.NSObject value) [0x00000] in <filename unknown>:0
>   at MonoTouch.UIKit.UISearchDisplayController.set_Delegate
> (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in <filename
> unknown>:0
>   at Diet52App.FoodSearchBase.Dispose (Boolean disposing) [0x00000] in
> <filename unknown>:0
>   at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in <filename
> unknown>:0
>
> I got the idea to set searchController's properties to null by reading this
> thread,
> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>
> Best regards,
>
> Daniel
>
>
> 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>>
>> Hi Nordis
>>
>> If I had to guess, I'd say this is the problem
>>
>> protected override void Dispose (bool disposing)
>> {
>> // Hopefully fixes SIGSEGV error
>> //
>> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> BeginInvokeOnMainThread (() => {

>> searchController.Delegate = null;
>> searchController.SearchResultsDelegate = null;
>> searchController.SearchResultsSource = null;
>> });
>> base.Dispose (disposing);
>> }
>>
>>
>> BeginInvokeOnMainThread will call it and return immediately - so your
>> searchController may have been disposed of by the time the background
>> thread runs.
>>
>> try changing it to either not use the call at all, or use
>> InvokeOnMainThread, which waits for the code to execute before
>> continuing.
>>
>>
>> "Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method waits
>> for the main thread to execute the method, and does not return until
>> the code pointed by action has completed running."
>>
>>
>>
>>
>> On 1 August 2013 09:16, Nordis <[hidden email]> wrote:
>>
>> > I'm having problem to find the cause of random crashes in my app. The
>> > crashes
>> > only occurs when I build in release mode and run on a device like iPhone
>> > or
>> > iPad. Running in debug on simulator no crashes occurs. My guess is that
>> > the
>> > problem has something to do with these two lines in the crash log,
>> >
>> > 6   UIKit                           0x34a193d0
>> > -[UISearchDisplayController
>> > _destroyManagedTableView] + 68
>> > 7   UIKit                           0x34a2195a
>> > -[UISearchDisplayController
>> > dealloc] + 94
>> > I've uploaded the source code of my UITableViewController and the full
>> > crash
>> > log here, https://gist.github.com/Nordis/6128735
>> >
>> > All help to track the cause of the crashes is much appreciated!
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> > http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
>> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> > _______________________________________________
>> > MonoTouch mailing list
>> > [hidden email]
>> > http://lists.ximian.com/mailman/listinfo/monotouch
>>
>>
>>
>> --
>> Nic Wise
>> t.  <a href="tel:%2B44%207788%20592%20806" value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> target="_blank"><a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
>> b. http://www.fastchicken.co.nz/

>> _______________________________________________
>> MonoTouch mailing list
>> [hidden email]
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658406.html
>> To unsubscribe from Crash related to UITableViewController /
>> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> NAML
>
>
>
> ________________________________
> View this message in context: Re: Crash related to UITableViewController /
> UISearchDisplayController in MonoTouch/Xamarin.iOS
>
> Sent from the MonoTouch mailing list archive at Nabble.com.
>
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch



To unsubscribe from Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nic Wise
I suggest you try to distill it down to a small sample, and put a bug
up on the Xamarin bugzilla site (bugzilla.xamarin.com).

Very odd tho. Maybe also have a look at MonoTouch.Dialog which has a
search box, but doesn't crash....

Crashing on device vrs sim isn't uncommon tho - the sim is a proper
JIT machine, same/similar as the desktop framework, and the GC isn't
overly aggressive. Once you get it on the device, it's AOT, and the GC
gets a lot more aggressive about releasing things.

I've CCed in Rolf and Sebastien as they may have[*] better ideas

[*]: "may have" -> are very likely to have.

On 1 August 2013 10:20, Nordis <[hidden email]> wrote:

> Same problem if I remove that code,
> https://gist.github.com/Nordis/6129762
>
> I was able to reproduce the crash a lot quicker when I removed the code,
> usually the crash occurs after 1-2 minutes. But with no code att all in
> Dispose the crash occured after a few seconds.
>
> Also the crash only seems to happens when I compile in release mode.
>
>
> 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>>
>> That SO question is from 2011, and the GC and other things have
>> changed hugely since then, esp in 6.4 (the latest one) which is Mono
>> 3.x as well as having a new GC by default
>>
>> So you may not even need to do that. What happens if you take it out
>> completely?
>>
>> Rolf is often around here, so he may be able to expand on it a bit.
>>
>> On 1 August 2013 09:53, Nordis <[hidden email]> wrote:
>>
>> > Thanks for your quick reply,
>> >
>> > I've tried to change BeginInvokeOnMainThread to InvokeOnMainThread, but
>> > still the same problem. The crash dump looks the same to me,
>> > https://gist.github.com/Nordis/6129637
>> >
>> > Then I tried to remove InvokeOnMainThread and only set the properties to
>> > null,
>> >     searchController.Delegate = null;
>> >     searchController.SearchResultsDelegate = null;
>> >     searchController.SearchResultsSource = null;
>> >
>> > But then I got this exception,
>> > MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency error: you
>> > are
>> > calling a UIKit method that can only be invoked from the UI thread.
>> >   at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in
>> > <filename
>> > unknown>:0
>> >   at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate
>> > (MonoTouch.Foundation.NSObject value) [0x00000] in <filename unknown>:0
>> >   at MonoTouch.UIKit.UISearchDisplayController.set_Delegate
>> > (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in <filename
>> > unknown>:0
>> >   at Diet52App.FoodSearchBase.Dispose (Boolean disposing) [0x00000] in
>> > <filename unknown>:0
>> >   at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in <filename
>> > unknown>:0
>> >
>> > I got the idea to set searchController's properties to null by reading
>> > this
>> > thread,
>> >
>> > http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >
>> > Best regards,
>> >
>> > Daniel
>> >
>> >
>> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>> >>
>> >> Hi Nordis
>> >>
>> >> If I had to guess, I'd say this is the problem
>> >>
>> >> protected override void Dispose (bool disposing)
>> >> {
>> >> // Hopefully fixes SIGSEGV error
>> >> //
>> >>
>> >> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >> BeginInvokeOnMainThread (() => {
>>
>> >> searchController.Delegate = null;
>> >> searchController.SearchResultsDelegate = null;
>> >> searchController.SearchResultsSource = null;
>> >> });
>> >> base.Dispose (disposing);
>> >> }
>> >>
>> >>
>> >> BeginInvokeOnMainThread will call it and return immediately - so your
>> >> searchController may have been disposed of by the time the background
>> >> thread runs.
>> >>
>> >> try changing it to either not use the call at all, or use
>> >> InvokeOnMainThread, which waits for the code to execute before
>> >> continuing.
>> >>
>> >>
>> >> "Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method waits
>> >> for the main thread to execute the method, and does not return until
>> >> the code pointed by action has completed running."
>> >>
>> >>
>> >>
>> >>
>> >> On 1 August 2013 09:16, Nordis <[hidden email]> wrote:
>> >>
>> >> > I'm having problem to find the cause of random crashes in my app. The
>> >> > crashes
>> >> > only occurs when I build in release mode and run on a device like
>> >> > iPhone
>> >> > or
>> >> > iPad. Running in debug on simulator no crashes occurs. My guess is
>> >> > that
>> >> > the
>> >> > problem has something to do with these two lines in the crash log,
>> >> >
>> >> > 6   UIKit                           0x34a193d0
>> >> > -[UISearchDisplayController
>> >> > _destroyManagedTableView] + 68
>> >> > 7   UIKit                           0x34a2195a
>> >> > -[UISearchDisplayController
>> >> > dealloc] + 94
>> >> > I've uploaded the source code of my UITableViewController and the
>> >> > full
>> >> > crash
>> >> > log here, https://gist.github.com/Nordis/6128735
>> >> >
>> >> > All help to track the cause of the crashes is much appreciated!
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >> >
>> >> > http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
>> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> > _______________________________________________
>> >> > MonoTouch mailing list
>> >> > [hidden email]
>> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >>
>> >>
>> >>
>> >> --
>> >> Nic Wise
>> >> t.  <a href="tel:%2B44%207788%20592%20806" value="<a
>> >> href="tel:%2B447788592806" value="+447788592806"
>> >> target="_blank">+447788592806"
>> >> target="_blank"><a href="tel:%2B44%207788%20592%20806"
>> >> value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
>> >> b. http://www.fastchicken.co.nz/
>>
>> >> _______________________________________________
>> >> MonoTouch mailing list
>> >> [hidden email]
>> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >>
>> >>
>> >> ________________________________
>> >> If you reply to this email, your message will be added to the
>> >> discussion
>> >> below:
>> >>
>> >>
>> >> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658406.html
>> >> To unsubscribe from Crash related to UITableViewController /
>> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> >> NAML
>> >
>> >
>> >
>> > ________________________________
>> > View this message in context: Re: Crash related to UITableViewController
>> > /
>> > UISearchDisplayController in MonoTouch/Xamarin.iOS
>> >
>> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >
>> > _______________________________________________
>> > MonoTouch mailing list
>> > [hidden email]
>> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >
>>
>>
>>
>> --
>> Nic Wise
>> t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806"
>> target="_blank">+44 7788 592 806 | @fastchicken
>> b. http://www.fastchicken.co.nz/
>> _______________________________________________
>> MonoTouch mailing list
>> [hidden email]
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658408.html
>> To unsubscribe from Crash related to UITableViewController /
>> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> NAML
>
>
>
> ________________________________
> View this message in context: Re: Crash related to UITableViewController /
> UISearchDisplayController in MonoTouch/Xamarin.iOS
> Sent from the MonoTouch mailing list archive at Nabble.com.
>
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nordis
I really appreciate that you've tried to help!

Just to clearify things, I can get the app to crash in the simulator too, if I compile the app in release mode. I actually looked alot at Xamarin's example add EmployerDirectory and I can't see whats differs my app from theirs when it comes to how I perform a search and how I handle my UITableViewController / UISearchDisplayController.


2013/8/1 Nic Wise <[hidden email]>
I suggest you try to distill it down to a small sample, and put a bug
up on the Xamarin bugzilla site (bugzilla.xamarin.com).

Very odd tho. Maybe also have a look at MonoTouch.Dialog which has a
search box, but doesn't crash....

Crashing on device vrs sim isn't uncommon tho - the sim is a proper
JIT machine, same/similar as the desktop framework, and the GC isn't
overly aggressive. Once you get it on the device, it's AOT, and the GC
gets a lot more aggressive about releasing things.

I've CCed in Rolf and Sebastien as they may have[*] better ideas

[*]: "may have" -> are very likely to have.

On 1 August 2013 10:20, Nordis <[hidden email]> wrote:
> Same problem if I remove that code,
> https://gist.github.com/Nordis/6129762
>
> I was able to reproduce the crash a lot quicker when I removed the code,
> usually the crash occurs after 1-2 minutes. But with no code att all in
> Dispose the crash occured after a few seconds.
>
> Also the crash only seems to happens when I compile in release mode.
>
>
> 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>>
>> That SO question is from 2011, and the GC and other things have
>> changed hugely since then, esp in 6.4 (the latest one) which is Mono
>> 3.x as well as having a new GC by default
>>
>> So you may not even need to do that. What happens if you take it out
>> completely?
>>
>> Rolf is often around here, so he may be able to expand on it a bit.
>>
>> On 1 August 2013 09:53, Nordis <[hidden email]> wrote:
>>
>> > Thanks for your quick reply,
>> >
>> > I've tried to change BeginInvokeOnMainThread to InvokeOnMainThread, but
>> > still the same problem. The crash dump looks the same to me,
>> > https://gist.github.com/Nordis/6129637
>> >
>> > Then I tried to remove InvokeOnMainThread and only set the properties to
>> > null,
>> >     searchController.Delegate = null;
>> >     searchController.SearchResultsDelegate = null;
>> >     searchController.SearchResultsSource = null;
>> >
>> > But then I got this exception,
>> > MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency error: you
>> > are
>> > calling a UIKit method that can only be invoked from the UI thread.
>> >   at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in
>> > <filename
>> > unknown>:0
>> >   at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate
>> > (MonoTouch.Foundation.NSObject value) [0x00000] in <filename unknown>:0
>> >   at MonoTouch.UIKit.UISearchDisplayController.set_Delegate
>> > (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in <filename
>> > unknown>:0
>> >   at Diet52App.FoodSearchBase.Dispose (Boolean disposing) [0x00000] in
>> > <filename unknown>:0
>> >   at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in <filename
>> > unknown>:0
>> >
>> > I got the idea to set searchController's properties to null by reading
>> > this
>> > thread,
>> >
>> > http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >
>> > Best regards,
>> >
>> > Daniel
>> >
>> >
>> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>> >>
>> >> Hi Nordis
>> >>
>> >> If I had to guess, I'd say this is the problem
>> >>
>> >> protected override void Dispose (bool disposing)
>> >> {
>> >> // Hopefully fixes SIGSEGV error
>> >> //
>> >>
>> >> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >> BeginInvokeOnMainThread (() => {
>>
>> >> searchController.Delegate = null;
>> >> searchController.SearchResultsDelegate = null;
>> >> searchController.SearchResultsSource = null;
>> >> });
>> >> base.Dispose (disposing);
>> >> }
>> >>
>> >>
>> >> BeginInvokeOnMainThread will call it and return immediately - so your
>> >> searchController may have been disposed of by the time the background
>> >> thread runs.
>> >>
>> >> try changing it to either not use the call at all, or use
>> >> InvokeOnMainThread, which waits for the code to execute before
>> >> continuing.
>> >>
>> >>
>> >> "Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method waits
>> >> for the main thread to execute the method, and does not return until
>> >> the code pointed by action has completed running."
>> >>
>> >>
>> >>
>> >>
>> >> On 1 August 2013 09:16, Nordis <[hidden email]> wrote:
>> >>
>> >> > I'm having problem to find the cause of random crashes in my app. The
>> >> > crashes
>> >> > only occurs when I build in release mode and run on a device like
>> >> > iPhone
>> >> > or
>> >> > iPad. Running in debug on simulator no crashes occurs. My guess is
>> >> > that
>> >> > the
>> >> > problem has something to do with these two lines in the crash log,
>> >> >
>> >> > 6   UIKit                           0x34a193d0
>> >> > -[UISearchDisplayController
>> >> > _destroyManagedTableView] + 68
>> >> > 7   UIKit                           0x34a2195a
>> >> > -[UISearchDisplayController
>> >> > dealloc] + 94
>> >> > I've uploaded the source code of my UITableViewController and the
>> >> > full
>> >> > crash
>> >> > log here, https://gist.github.com/Nordis/6128735
>> >> >
>> >> > All help to track the cause of the crashes is much appreciated!
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >> >
>> >> > http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
>> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> > _______________________________________________
>> >> > MonoTouch mailing list
>> >> > [hidden email]
>> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >>
>> >>
>> >>
>> >> --
>> >> Nic Wise
>> >> t.  <a href="tel:%2B44%207788%20592%20806" value="<a
>> >> href="tel:%2B447788592806" value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> >> target="_blank"><a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> >> target="_blank"><a href="tel:%2B44%207788%20592%20806"
>> >> value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806" target="_blank"><a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
>> >> b. http://www.fastchicken.co.nz/
>>
>> >> _______________________________________________
>> >> MonoTouch mailing list
>> >> [hidden email]
>> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >>
>> >>
>> >> ________________________________
>> >> If you reply to this email, your message will be added to the
>> >> discussion
>> >> below:
>> >>
>> >>
>> >> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658406.html
>> >> To unsubscribe from Crash related to UITableViewController /
>> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> >> NAML
>> >
>> >
>> >
>> > ________________________________
>> > View this message in context: Re: Crash related to UITableViewController
>> > /
>> > UISearchDisplayController in MonoTouch/Xamarin.iOS
>> >
>> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >
>> > _______________________________________________
>> > MonoTouch mailing list
>> > [hidden email]
>> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >
>>
>>
>>
>> --
>> Nic Wise
>> t.  <a href="tel:%2B44%207788%20592%20806" value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> target="_blank"><a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
>> b. http://www.fastchicken.co.nz/
>> _______________________________________________
>> MonoTouch mailing list
>> [hidden email]
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>>
>> ________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658408.html
>> To unsubscribe from Crash related to UITableViewController /
>> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> NAML
>
>
>
> ________________________________
> View this message in context: Re: Crash related to UITableViewController /
> UISearchDisplayController in MonoTouch/Xamarin.iOS
> Sent from the MonoTouch mailing list archive at Nabble.com.
>
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/


_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nic Wise
Kind of strange. The main difference usually in Release vrs Debug is
just if there are debug symbols.

Maybe turn that on for release, and see if it still dies...

I suspect you need Rolf or Sebastien tho :) If they dont reply here
(they'll both be asleep at the moment, I think, tho Rolf is based in
Spain last time I checked), you could also email support@xamarin, tho
a bug report first, and point support at that, helps a LOT.





On 1 August 2013 10:36, Daniel Nordmark <[hidden email]> wrote:

> I really appreciate that you've tried to help!
>
> Just to clearify things, I can get the app to crash in the simulator too, if
> I compile the app in release mode. I actually looked alot at Xamarin's
> example add EmployerDirectory and I can't see whats differs my app from
> theirs when it comes to how I perform a search and how I handle my
> UITableViewController / UISearchDisplayController.
>
>
> 2013/8/1 Nic Wise <[hidden email]>
>>
>> I suggest you try to distill it down to a small sample, and put a bug
>> up on the Xamarin bugzilla site (bugzilla.xamarin.com).
>>
>> Very odd tho. Maybe also have a look at MonoTouch.Dialog which has a
>> search box, but doesn't crash....
>>
>> Crashing on device vrs sim isn't uncommon tho - the sim is a proper
>> JIT machine, same/similar as the desktop framework, and the GC isn't
>> overly aggressive. Once you get it on the device, it's AOT, and the GC
>> gets a lot more aggressive about releasing things.
>>
>> I've CCed in Rolf and Sebastien as they may have[*] better ideas
>>
>> [*]: "may have" -> are very likely to have.
>>
>> On 1 August 2013 10:20, Nordis <[hidden email]> wrote:
>> > Same problem if I remove that code,
>> > https://gist.github.com/Nordis/6129762
>> >
>> > I was able to reproduce the crash a lot quicker when I removed the code,
>> > usually the crash occurs after 1-2 minutes. But with no code att all in
>> > Dispose the crash occured after a few seconds.
>> >
>> > Also the crash only seems to happens when I compile in release mode.
>> >
>> >
>> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>> >>
>> >> That SO question is from 2011, and the GC and other things have
>> >> changed hugely since then, esp in 6.4 (the latest one) which is Mono
>> >> 3.x as well as having a new GC by default
>> >>
>> >> So you may not even need to do that. What happens if you take it out
>> >> completely?
>> >>
>> >> Rolf is often around here, so he may be able to expand on it a bit.
>> >>
>> >> On 1 August 2013 09:53, Nordis <[hidden email]> wrote:
>> >>
>> >> > Thanks for your quick reply,
>> >> >
>> >> > I've tried to change BeginInvokeOnMainThread to InvokeOnMainThread,
>> >> > but
>> >> > still the same problem. The crash dump looks the same to me,
>> >> > https://gist.github.com/Nordis/6129637
>> >> >
>> >> > Then I tried to remove InvokeOnMainThread and only set the properties
>> >> > to
>> >> > null,
>> >> >     searchController.Delegate = null;
>> >> >     searchController.SearchResultsDelegate = null;
>> >> >     searchController.SearchResultsSource = null;
>> >> >
>> >> > But then I got this exception,
>> >> > MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency error:
>> >> > you
>> >> > are
>> >> > calling a UIKit method that can only be invoked from the UI thread.
>> >> >   at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in
>> >> > <filename
>> >> > unknown>:0
>> >> >   at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate
>> >> > (MonoTouch.Foundation.NSObject value) [0x00000] in <filename
>> >> > unknown>:0
>> >> >   at MonoTouch.UIKit.UISearchDisplayController.set_Delegate
>> >> > (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in
>> >> > <filename
>> >> > unknown>:0
>> >> >   at Diet52App.FoodSearchBase.Dispose (Boolean disposing) [0x00000]
>> >> > in
>> >> > <filename unknown>:0
>> >> >   at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in <filename
>> >> > unknown>:0
>> >> >
>> >> > I got the idea to set searchController's properties to null by
>> >> > reading
>> >> > this
>> >> > thread,
>> >> >
>> >> >
>> >> > http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >> >
>> >> > Best regards,
>> >> >
>> >> > Daniel
>> >> >
>> >> >
>> >> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>> >> >>
>> >> >> Hi Nordis
>> >> >>
>> >> >> If I had to guess, I'd say this is the problem
>> >> >>
>> >> >> protected override void Dispose (bool disposing)
>> >> >> {
>> >> >> // Hopefully fixes SIGSEGV error
>> >> >> //
>> >> >>
>> >> >>
>> >> >> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >> >> BeginInvokeOnMainThread (() => {
>> >>
>> >> >> searchController.Delegate = null;
>> >> >> searchController.SearchResultsDelegate = null;
>> >> >> searchController.SearchResultsSource = null;
>> >> >> });
>> >> >> base.Dispose (disposing);
>> >> >> }
>> >> >>
>> >> >>
>> >> >> BeginInvokeOnMainThread will call it and return immediately - so
>> >> >> your
>> >> >> searchController may have been disposed of by the time the
>> >> >> background
>> >> >> thread runs.
>> >> >>
>> >> >> try changing it to either not use the call at all, or use
>> >> >> InvokeOnMainThread, which waits for the code to execute before
>> >> >> continuing.
>> >> >>
>> >> >>
>> >> >> "Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method waits
>> >> >> for the main thread to execute the method, and does not return until
>> >> >> the code pointed by action has completed running."
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> On 1 August 2013 09:16, Nordis <[hidden email]> wrote:
>> >> >>
>> >> >> > I'm having problem to find the cause of random crashes in my app.
>> >> >> > The
>> >> >> > crashes
>> >> >> > only occurs when I build in release mode and run on a device like
>> >> >> > iPhone
>> >> >> > or
>> >> >> > iPad. Running in debug on simulator no crashes occurs. My guess is
>> >> >> > that
>> >> >> > the
>> >> >> > problem has something to do with these two lines in the crash log,
>> >> >> >
>> >> >> > 6   UIKit                           0x34a193d0
>> >> >> > -[UISearchDisplayController
>> >> >> > _destroyManagedTableView] + 68
>> >> >> > 7   UIKit                           0x34a2195a
>> >> >> > -[UISearchDisplayController
>> >> >> > dealloc] + 94
>> >> >> > I've uploaded the source code of my UITableViewController and the
>> >> >> > full
>> >> >> > crash
>> >> >> > log here, https://gist.github.com/Nordis/6128735
>> >> >> >
>> >> >> > All help to track the cause of the crashes is much appreciated!
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > View this message in context:
>> >> >> >
>> >> >> >
>> >> >> > http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
>> >> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> >> > _______________________________________________
>> >> >> > MonoTouch mailing list
>> >> >> > [hidden email]
>> >> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Nic Wise
>> >> >> t.  <a href="tel:%2B44%207788%20592%20806" value="<a
>> >> >> href="tel:%2B447788592806" value="+447788592806"
>> >> >> target="_blank">+447788592806"
>> >> >> target="_blank"><a href="tel:%2B44%207788%20592%20806"
>> >> >> value="+447788592806" target="_blank">+44 7788 592 806 |
>> >> >> @fastchicken
>> >> >> b. http://www.fastchicken.co.nz/
>> >>
>> >> >> _______________________________________________
>> >> >> MonoTouch mailing list
>> >> >> [hidden email]
>> >> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >>
>> >> >>
>> >> >> ________________________________
>> >> >> If you reply to this email, your message will be added to the
>> >> >> discussion
>> >> >> below:
>> >> >>
>> >> >>
>> >> >>
>> >> >> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658406.html
>> >> >> To unsubscribe from Crash related to UITableViewController /
>> >> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> >> >> NAML
>> >> >
>> >> >
>> >> >
>> >> > ________________________________
>> >> > View this message in context: Re: Crash related to
>> >> > UITableViewController
>> >> > /
>> >> > UISearchDisplayController in MonoTouch/Xamarin.iOS
>> >> >
>> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> >
>> >> > _______________________________________________
>> >> > MonoTouch mailing list
>> >> > [hidden email]
>> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Nic Wise
>> >> t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806"
>> >> target="_blank">+44 7788 592 806 | @fastchicken
>> >> b. http://www.fastchicken.co.nz/
>> >> _______________________________________________
>> >> MonoTouch mailing list
>> >> [hidden email]
>> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >>
>> >>
>> >> ________________________________
>> >> If you reply to this email, your message will be added to the
>> >> discussion
>> >> below:
>> >>
>> >>
>> >> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658408.html
>> >> To unsubscribe from Crash related to UITableViewController /
>> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> >> NAML
>> >
>> >
>> >
>> > ________________________________
>> > View this message in context: Re: Crash related to UITableViewController
>> > /
>> > UISearchDisplayController in MonoTouch/Xamarin.iOS
>> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >
>> > _______________________________________________
>> > MonoTouch mailing list
>> > [hidden email]
>> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >
>>
>>
>>
>> --
>> Nic Wise
>> t.  +44 7788 592 806 | @fastchicken
>> b. http://www.fastchicken.co.nz/
>
>



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nordis
I got a comment on a thread on StackOverflow from Rolf, so at least he's awake. ;-)

That's the fix I've already tried. I've already activated debug symbols for the release, I'm guessing that's the reason I actually can see that it has something to do with [UISearchDisplayController _destroyManagedTableView]

Once again, thanks for all you're replies!

2013/8/1 Nic Wise <[hidden email]>
Kind of strange. The main difference usually in Release vrs Debug is
just if there are debug symbols.

Maybe turn that on for release, and see if it still dies...

I suspect you need Rolf or Sebastien tho :) If they dont reply here
(they'll both be asleep at the moment, I think, tho Rolf is based in
Spain last time I checked), you could also email support@xamarin, tho
a bug report first, and point support at that, helps a LOT.





On 1 August 2013 10:36, Daniel Nordmark <[hidden email]> wrote:
> I really appreciate that you've tried to help!
>
> Just to clearify things, I can get the app to crash in the simulator too, if
> I compile the app in release mode. I actually looked alot at Xamarin's
> example add EmployerDirectory and I can't see whats differs my app from
> theirs when it comes to how I perform a search and how I handle my
> UITableViewController / UISearchDisplayController.
>
>
> 2013/8/1 Nic Wise <[hidden email]>
>>
>> I suggest you try to distill it down to a small sample, and put a bug
>> up on the Xamarin bugzilla site (bugzilla.xamarin.com).
>>
>> Very odd tho. Maybe also have a look at MonoTouch.Dialog which has a
>> search box, but doesn't crash....
>>
>> Crashing on device vrs sim isn't uncommon tho - the sim is a proper
>> JIT machine, same/similar as the desktop framework, and the GC isn't
>> overly aggressive. Once you get it on the device, it's AOT, and the GC
>> gets a lot more aggressive about releasing things.
>>
>> I've CCed in Rolf and Sebastien as they may have[*] better ideas
>>
>> [*]: "may have" -> are very likely to have.
>>
>> On 1 August 2013 10:20, Nordis <[hidden email]> wrote:
>> > Same problem if I remove that code,
>> > https://gist.github.com/Nordis/6129762
>> >
>> > I was able to reproduce the crash a lot quicker when I removed the code,
>> > usually the crash occurs after 1-2 minutes. But with no code att all in
>> > Dispose the crash occured after a few seconds.
>> >
>> > Also the crash only seems to happens when I compile in release mode.
>> >
>> >
>> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>> >>
>> >> That SO question is from 2011, and the GC and other things have
>> >> changed hugely since then, esp in 6.4 (the latest one) which is Mono
>> >> 3.x as well as having a new GC by default
>> >>
>> >> So you may not even need to do that. What happens if you take it out
>> >> completely?
>> >>
>> >> Rolf is often around here, so he may be able to expand on it a bit.
>> >>
>> >> On 1 August 2013 09:53, Nordis <[hidden email]> wrote:
>> >>
>> >> > Thanks for your quick reply,
>> >> >
>> >> > I've tried to change BeginInvokeOnMainThread to InvokeOnMainThread,
>> >> > but
>> >> > still the same problem. The crash dump looks the same to me,
>> >> > https://gist.github.com/Nordis/6129637
>> >> >
>> >> > Then I tried to remove InvokeOnMainThread and only set the properties
>> >> > to
>> >> > null,
>> >> >     searchController.Delegate = null;
>> >> >     searchController.SearchResultsDelegate = null;
>> >> >     searchController.SearchResultsSource = null;
>> >> >
>> >> > But then I got this exception,
>> >> > MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency error:
>> >> > you
>> >> > are
>> >> > calling a UIKit method that can only be invoked from the UI thread.
>> >> >   at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in
>> >> > <filename
>> >> > unknown>:0
>> >> >   at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate
>> >> > (MonoTouch.Foundation.NSObject value) [0x00000] in <filename
>> >> > unknown>:0
>> >> >   at MonoTouch.UIKit.UISearchDisplayController.set_Delegate
>> >> > (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in
>> >> > <filename
>> >> > unknown>:0
>> >> >   at Diet52App.FoodSearchBase.Dispose (Boolean disposing) [0x00000]
>> >> > in
>> >> > <filename unknown>:0
>> >> >   at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in <filename
>> >> > unknown>:0
>> >> >
>> >> > I got the idea to set searchController's properties to null by
>> >> > reading
>> >> > this
>> >> > thread,
>> >> >
>> >> >
>> >> > http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >> >
>> >> > Best regards,
>> >> >
>> >> > Daniel
>> >> >
>> >> >
>> >> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>> >> >>
>> >> >> Hi Nordis
>> >> >>
>> >> >> If I had to guess, I'd say this is the problem
>> >> >>
>> >> >> protected override void Dispose (bool disposing)
>> >> >> {
>> >> >> // Hopefully fixes SIGSEGV error
>> >> >> //
>> >> >>
>> >> >>
>> >> >> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >> >> BeginInvokeOnMainThread (() => {
>> >>
>> >> >> searchController.Delegate = null;
>> >> >> searchController.SearchResultsDelegate = null;
>> >> >> searchController.SearchResultsSource = null;
>> >> >> });
>> >> >> base.Dispose (disposing);
>> >> >> }
>> >> >>
>> >> >>
>> >> >> BeginInvokeOnMainThread will call it and return immediately - so
>> >> >> your
>> >> >> searchController may have been disposed of by the time the
>> >> >> background
>> >> >> thread runs.
>> >> >>
>> >> >> try changing it to either not use the call at all, or use
>> >> >> InvokeOnMainThread, which waits for the code to execute before
>> >> >> continuing.
>> >> >>
>> >> >>
>> >> >> "Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method waits
>> >> >> for the main thread to execute the method, and does not return until
>> >> >> the code pointed by action has completed running."
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> On 1 August 2013 09:16, Nordis <[hidden email]> wrote:
>> >> >>
>> >> >> > I'm having problem to find the cause of random crashes in my app.
>> >> >> > The
>> >> >> > crashes
>> >> >> > only occurs when I build in release mode and run on a device like
>> >> >> > iPhone
>> >> >> > or
>> >> >> > iPad. Running in debug on simulator no crashes occurs. My guess is
>> >> >> > that
>> >> >> > the
>> >> >> > problem has something to do with these two lines in the crash log,
>> >> >> >
>> >> >> > 6   UIKit                           0x34a193d0
>> >> >> > -[UISearchDisplayController
>> >> >> > _destroyManagedTableView] + 68
>> >> >> > 7   UIKit                           0x34a2195a
>> >> >> > -[UISearchDisplayController
>> >> >> > dealloc] + 94
>> >> >> > I've uploaded the source code of my UITableViewController and the
>> >> >> > full
>> >> >> > crash
>> >> >> > log here, https://gist.github.com/Nordis/6128735
>> >> >> >
>> >> >> > All help to track the cause of the crashes is much appreciated!
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > View this message in context:
>> >> >> >
>> >> >> >
>> >> >> > http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
>> >> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> >> > _______________________________________________
>> >> >> > MonoTouch mailing list
>> >> >> > [hidden email]
>> >> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Nic Wise
>> >> >> t.  <a href="tel:%2B44%207788%20592%20806" value="<a
>> >> >> href="tel:%2B447788592806" value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> >> >> target="_blank"><a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> >> >> target="_blank"><a href="tel:%2B44%207788%20592%20806"
>> >> >> value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806" target="_blank"><a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 |
>> >> >> @fastchicken
>> >> >> b. http://www.fastchicken.co.nz/
>> >>
>> >> >> _______________________________________________
>> >> >> MonoTouch mailing list
>> >> >> [hidden email]
>> >> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >>
>> >> >>
>> >> >> ________________________________
>> >> >> If you reply to this email, your message will be added to the
>> >> >> discussion
>> >> >> below:
>> >> >>
>> >> >>
>> >> >>
>> >> >> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658406.html
>> >> >> To unsubscribe from Crash related to UITableViewController /
>> >> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> >> >> NAML
>> >> >
>> >> >
>> >> >
>> >> > ________________________________
>> >> > View this message in context: Re: Crash related to
>> >> > UITableViewController
>> >> > /
>> >> > UISearchDisplayController in MonoTouch/Xamarin.iOS
>> >> >
>> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> >
>> >> > _______________________________________________
>> >> > MonoTouch mailing list
>> >> > [hidden email]
>> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Nic Wise
>> >> t.  <a href="tel:%2B44%207788%20592%20806" value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> >> target="_blank"><a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
>> >> b. http://www.fastchicken.co.nz/
>> >> _______________________________________________
>> >> MonoTouch mailing list
>> >> [hidden email]
>> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >>
>> >>
>> >> ________________________________
>> >> If you reply to this email, your message will be added to the
>> >> discussion
>> >> below:
>> >>
>> >>
>> >> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658408.html
>> >> To unsubscribe from Crash related to UITableViewController /
>> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> >> NAML
>> >
>> >
>> >
>> > ________________________________
>> > View this message in context: Re: Crash related to UITableViewController
>> > /
>> > UISearchDisplayController in MonoTouch/Xamarin.iOS
>> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >
>> > _______________________________________________
>> > MonoTouch mailing list
>> > [hidden email]
>> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >
>>
>>
>>
>> --
>> Nic Wise
>> t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
>> b. http://www.fastchicken.co.nz/
>
>



--
Nic Wise
t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nic Wise
No problem - sorry we couldn't find a solution!

On 1 August 2013 11:17, Nordis <[hidden email]> wrote:

> I got a comment on a thread on StackOverflow from Rolf, so at least he's
> awake. ;-)
> http://stackoverflow.com/questions/17986348/crash-related-to-uitableviewcontroller-uisearchdisplaycontroller-in-monotouch
> But he asked if this helped,
> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller/6769885#6769885
>
> That's the fix I've already tried. I've already activated debug symbols for
> the release, I'm guessing that's the reason I actually can see that it has
> something to do with [UISearchDisplayController _destroyManagedTableView]
>
> Once again, thanks for all you're replies!
>
> 2013/8/1 Nic Wise <[hidden email]>
>>
>> Kind of strange. The main difference usually in Release vrs Debug is
>> just if there are debug symbols.
>>
>> Maybe turn that on for release, and see if it still dies...
>>
>> I suspect you need Rolf or Sebastien tho :) If they dont reply here
>> (they'll both be asleep at the moment, I think, tho Rolf is based in
>> Spain last time I checked), you could also email support@xamarin, tho
>> a bug report first, and point support at that, helps a LOT.
>>
>>
>>
>>
>>
>> On 1 August 2013 10:36, Daniel Nordmark <[hidden email]> wrote:
>> > I really appreciate that you've tried to help!
>> >
>> > Just to clearify things, I can get the app to crash in the simulator
>> > too, if
>> > I compile the app in release mode. I actually looked alot at Xamarin's
>> > example add EmployerDirectory and I can't see whats differs my app from
>> > theirs when it comes to how I perform a search and how I handle my
>> > UITableViewController / UISearchDisplayController.
>> >
>> >
>> > 2013/8/1 Nic Wise <[hidden email]>
>>
>> >>
>> >> I suggest you try to distill it down to a small sample, and put a bug
>> >> up on the Xamarin bugzilla site (bugzilla.xamarin.com).
>> >>
>> >> Very odd tho. Maybe also have a look at MonoTouch.Dialog which has a
>> >> search box, but doesn't crash....
>> >>
>> >> Crashing on device vrs sim isn't uncommon tho - the sim is a proper
>> >> JIT machine, same/similar as the desktop framework, and the GC isn't
>> >> overly aggressive. Once you get it on the device, it's AOT, and the GC
>> >> gets a lot more aggressive about releasing things.
>> >>
>> >> I've CCed in Rolf and Sebastien as they may have[*] better ideas
>> >>
>> >> [*]: "may have" -> are very likely to have.
>> >>
>> >> On 1 August 2013 10:20, Nordis <[hidden email]> wrote:
>> >> > Same problem if I remove that code,
>> >> > https://gist.github.com/Nordis/6129762
>> >> >
>> >> > I was able to reproduce the crash a lot quicker when I removed the
>> >> > code,
>> >> > usually the crash occurs after 1-2 minutes. But with no code att all
>> >> > in
>> >> > Dispose the crash occured after a few seconds.
>> >> >
>> >> > Also the crash only seems to happens when I compile in release mode.
>> >> >
>> >> >
>> >> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>> >> >>
>> >> >> That SO question is from 2011, and the GC and other things have
>> >> >> changed hugely since then, esp in 6.4 (the latest one) which is Mono
>> >> >> 3.x as well as having a new GC by default
>> >> >>
>> >> >> So you may not even need to do that. What happens if you take it out
>> >> >> completely?
>> >> >>
>> >> >> Rolf is often around here, so he may be able to expand on it a bit.
>> >> >>
>> >> >> On 1 August 2013 09:53, Nordis <[hidden email]> wrote:
>> >> >>
>> >> >> > Thanks for your quick reply,
>> >> >> >
>> >> >> > I've tried to change BeginInvokeOnMainThread to
>> >> >> > InvokeOnMainThread,
>> >> >> > but
>> >> >> > still the same problem. The crash dump looks the same to me,
>> >> >> > https://gist.github.com/Nordis/6129637
>> >> >> >
>> >> >> > Then I tried to remove InvokeOnMainThread and only set the
>> >> >> > properties
>> >> >> > to
>> >> >> > null,
>> >> >> >     searchController.Delegate = null;
>> >> >> >     searchController.SearchResultsDelegate = null;
>> >> >> >     searchController.SearchResultsSource = null;
>> >> >> >
>> >> >> > But then I got this exception,
>> >> >> > MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency
>> >> >> > error:
>> >> >> > you
>> >> >> > are
>> >> >> > calling a UIKit method that can only be invoked from the UI
>> >> >> > thread.
>> >> >> >   at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in
>> >> >> > <filename
>> >> >> > unknown>:0
>> >> >> >   at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate
>> >> >> > (MonoTouch.Foundation.NSObject value) [0x00000] in <filename
>> >> >> > unknown>:0
>> >> >> >   at MonoTouch.UIKit.UISearchDisplayController.set_Delegate
>> >> >> > (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in
>> >> >> > <filename
>> >> >> > unknown>:0
>> >> >> >   at Diet52App.FoodSearchBase.Dispose (Boolean disposing)
>> >> >> > [0x00000]
>> >> >> > in
>> >> >> > <filename unknown>:0
>> >> >> >   at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in
>> >> >> > <filename
>> >> >> > unknown>:0
>> >> >> >
>> >> >> > I got the idea to set searchController's properties to null by
>> >> >> > reading
>> >> >> > this
>> >> >> > thread,
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >> >> >
>> >> >> > Best regards,
>> >> >> >
>> >> >> > Daniel
>> >> >> >
>> >> >> >
>> >> >> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>> >> >> >>
>> >> >> >> Hi Nordis
>> >> >> >>
>> >> >> >> If I had to guess, I'd say this is the problem
>> >> >> >>
>> >> >> >> protected override void Dispose (bool disposing)
>> >> >> >> {
>> >> >> >> // Hopefully fixes SIGSEGV error
>> >> >> >> //
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >> >> >> BeginInvokeOnMainThread (() => {
>> >> >>
>> >> >> >> searchController.Delegate = null;
>> >> >> >> searchController.SearchResultsDelegate = null;
>> >> >> >> searchController.SearchResultsSource = null;
>> >> >> >> });
>> >> >> >> base.Dispose (disposing);
>> >> >> >> }
>> >> >> >>
>> >> >> >>
>> >> >> >> BeginInvokeOnMainThread will call it and return immediately - so
>> >> >> >> your
>> >> >> >> searchController may have been disposed of by the time the
>> >> >> >> background
>> >> >> >> thread runs.
>> >> >> >>
>> >> >> >> try changing it to either not use the call at all, or use
>> >> >> >> InvokeOnMainThread, which waits for the code to execute before
>> >> >> >> continuing.
>> >> >> >>
>> >> >> >>
>> >> >> >> "Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method
>> >> >> >> waits
>> >> >> >> for the main thread to execute the method, and does not return
>> >> >> >> until
>> >> >> >> the code pointed by action has completed running."
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> On 1 August 2013 09:16, Nordis <[hidden email]> wrote:
>> >> >> >>
>> >> >> >> > I'm having problem to find the cause of random crashes in my
>> >> >> >> > app.
>> >> >> >> > The
>> >> >> >> > crashes
>> >> >> >> > only occurs when I build in release mode and run on a device
>> >> >> >> > like
>> >> >> >> > iPhone
>> >> >> >> > or
>> >> >> >> > iPad. Running in debug on simulator no crashes occurs. My guess
>> >> >> >> > is
>> >> >> >> > that
>> >> >> >> > the
>> >> >> >> > problem has something to do with these two lines in the crash
>> >> >> >> > log,
>> >> >> >> >
>> >> >> >> > 6   UIKit                           0x34a193d0
>> >> >> >> > -[UISearchDisplayController
>> >> >> >> > _destroyManagedTableView] + 68
>> >> >> >> > 7   UIKit                           0x34a2195a
>> >> >> >> > -[UISearchDisplayController
>> >> >> >> > dealloc] + 94
>> >> >> >> > I've uploaded the source code of my UITableViewController and
>> >> >> >> > the
>> >> >> >> > full
>> >> >> >> > crash
>> >> >> >> > log here, https://gist.github.com/Nordis/6128735
>> >> >> >> >
>> >> >> >> > All help to track the cause of the crashes is much appreciated!
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> > View this message in context:
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
>> >> >> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> >> >> > _______________________________________________
>> >> >> >> > MonoTouch mailing list
>> >> >> >> > [hidden email]
>> >> >> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> --
>> >> >> >> Nic Wise
>> >> >> >> t.  <a href="tel:%2B44%207788%20592%20806" value="<a
>> >> >> >> href="tel:%2B447788592806" value="<a href="tel:%2B447788592806"
>> >> >> >> value="+447788592806" target="_blank">+447788592806"
>> >> >> >> target="_blank"><a href="tel:%2B447788592806"
>> >> >> >> value="+447788592806" target="_blank">+447788592806"
>>
>> >> >> >> target="_blank"><a href="tel:%2B44%207788%20592%20806"
>> >> >> >> value="<a href="tel:%2B447788592806" value="+447788592806"
>> >> >> >> target="_blank">+447788592806" target="_blank"><a
>> >> >> >> href="tel:%2B44%207788%20592%20806" value="+447788592806"
>> >> >> >> target="_blank">+44 7788 592 806 |
>> >> >> >> @fastchicken
>> >> >> >> b. http://www.fastchicken.co.nz/
>> >> >>
>> >> >> >> _______________________________________________
>> >> >> >> MonoTouch mailing list
>> >> >> >> [hidden email]
>> >> >> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >> >>
>> >> >> >>
>> >> >> >> ________________________________
>> >> >> >> If you reply to this email, your message will be added to the
>> >> >> >> discussion
>> >> >> >> below:
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658406.html
>> >> >> >> To unsubscribe from Crash related to UITableViewController /
>> >> >> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> >> >> >> NAML
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > ________________________________
>> >> >> > View this message in context: Re: Crash related to
>> >> >> > UITableViewController
>> >> >> > /
>> >> >> > UISearchDisplayController in MonoTouch/Xamarin.iOS
>> >> >> >
>> >> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> >> >
>> >> >> > _______________________________________________
>> >> >> > MonoTouch mailing list
>> >> >> > [hidden email]
>> >> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Nic Wise
>> >> >> t.  <a href="tel:%2B44%207788%20592%20806" value="<a
>> >> >> href="tel:%2B447788592806" value="+447788592806"
>> >> >> target="_blank">+447788592806"
>> >> >> target="_blank"><a href="tel:%2B44%207788%20592%20806"
>> >> >> value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
>> >> >> b. http://www.fastchicken.co.nz/
>> >> >> _______________________________________________
>> >> >> MonoTouch mailing list
>> >> >> [hidden email]
>> >> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >>
>> >> >>
>> >> >> ________________________________
>> >> >> If you reply to this email, your message will be added to the
>> >> >> discussion
>> >> >> below:
>> >> >>
>> >> >>
>> >> >>
>> >> >> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658408.html
>> >> >> To unsubscribe from Crash related to UITableViewController /
>> >> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> >> >> NAML
>> >> >
>> >> >
>> >> >
>> >> > ________________________________
>> >> > View this message in context: Re: Crash related to
>> >> > UITableViewController
>> >> > /
>> >> > UISearchDisplayController in MonoTouch/Xamarin.iOS
>> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> >
>> >> > _______________________________________________
>> >> > MonoTouch mailing list
>> >> > [hidden email]
>> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Nic Wise
>> >> t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806"
>> >> target="_blank">+44 7788 592 806 | @fastchicken
>> >> b. http://www.fastchicken.co.nz/
>> >
>> >
>>
>>
>>
>> --
>> Nic Wise
>> t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806"
>> target="_blank">+44 7788 592 806 | @fastchicken
>> b. http://www.fastchicken.co.nz/
>
>
>
> ________________________________
> View this message in context: Re: Crash related to UITableViewController /
> UISearchDisplayController in MonoTouch/Xamarin.iOS
> Sent from the MonoTouch mailing list archive at Nabble.com.
>
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS

Nordis
Hi again,

I have now created a new bug report and attached a test case that reproduces the crashes. It's a much smaller project. I found the test case on StackOverflow and Rolf Bjarne Kvinge suggested a fix. But I still get the same crashes even after I applied the fix.


You can see the bug report here,

Best regards,

Daniel


2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
No problem - sorry we couldn't find a solution!

On 1 August 2013 11:17, Nordis <[hidden email]> wrote:

> I got a comment on a thread on StackOverflow from Rolf, so at least he's
> awake. ;-)
> http://stackoverflow.com/questions/17986348/crash-related-to-uitableviewcontroller-uisearchdisplaycontroller-in-monotouch
> But he asked if this helped,
> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller/6769885#6769885
>
> That's the fix I've already tried. I've already activated debug symbols for
> the release, I'm guessing that's the reason I actually can see that it has
> something to do with [UISearchDisplayController _destroyManagedTableView]
>
> Once again, thanks for all you're replies!
>
> 2013/8/1 Nic Wise <[hidden email]>
>>

>> Kind of strange. The main difference usually in Release vrs Debug is
>> just if there are debug symbols.
>>
>> Maybe turn that on for release, and see if it still dies...
>>
>> I suspect you need Rolf or Sebastien tho :) If they dont reply here
>> (they'll both be asleep at the moment, I think, tho Rolf is based in
>> Spain last time I checked), you could also email support@xamarin, tho
>> a bug report first, and point support at that, helps a LOT.
>>
>>
>>
>>
>>
>> On 1 August 2013 10:36, Daniel Nordmark <[hidden email]> wrote:

>> > I really appreciate that you've tried to help!
>> >
>> > Just to clearify things, I can get the app to crash in the simulator
>> > too, if
>> > I compile the app in release mode. I actually looked alot at Xamarin's
>> > example add EmployerDirectory and I can't see whats differs my app from
>> > theirs when it comes to how I perform a search and how I handle my
>> > UITableViewController / UISearchDisplayController.
>> >
>> >
>> > 2013/8/1 Nic Wise <[hidden email]>
>>

>> >>
>> >> I suggest you try to distill it down to a small sample, and put a bug
>> >> up on the Xamarin bugzilla site (bugzilla.xamarin.com).
>> >>
>> >> Very odd tho. Maybe also have a look at MonoTouch.Dialog which has a
>> >> search box, but doesn't crash....
>> >>
>> >> Crashing on device vrs sim isn't uncommon tho - the sim is a proper
>> >> JIT machine, same/similar as the desktop framework, and the GC isn't
>> >> overly aggressive. Once you get it on the device, it's AOT, and the GC
>> >> gets a lot more aggressive about releasing things.
>> >>
>> >> I've CCed in Rolf and Sebastien as they may have[*] better ideas
>> >>
>> >> [*]: "may have" -> are very likely to have.
>> >>
>> >> On 1 August 2013 10:20, Nordis <[hidden email]> wrote:

>> >> > Same problem if I remove that code,
>> >> > https://gist.github.com/Nordis/6129762
>> >> >
>> >> > I was able to reproduce the crash a lot quicker when I removed the
>> >> > code,
>> >> > usually the crash occurs after 1-2 minutes. But with no code att all
>> >> > in
>> >> > Dispose the crash occured after a few seconds.
>> >> >
>> >> > Also the crash only seems to happens when I compile in release mode.
>> >> >
>> >> >
>> >> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>> >> >>
>> >> >> That SO question is from 2011, and the GC and other things have
>> >> >> changed hugely since then, esp in 6.4 (the latest one) which is Mono
>> >> >> 3.x as well as having a new GC by default
>> >> >>
>> >> >> So you may not even need to do that. What happens if you take it out
>> >> >> completely?
>> >> >>
>> >> >> Rolf is often around here, so he may be able to expand on it a bit.
>> >> >>
>> >> >> On 1 August 2013 09:53, Nordis <[hidden email]> wrote:
>> >> >>
>> >> >> > Thanks for your quick reply,
>> >> >> >
>> >> >> > I've tried to change BeginInvokeOnMainThread to
>> >> >> > InvokeOnMainThread,
>> >> >> > but
>> >> >> > still the same problem. The crash dump looks the same to me,
>> >> >> > https://gist.github.com/Nordis/6129637
>> >> >> >
>> >> >> > Then I tried to remove InvokeOnMainThread and only set the
>> >> >> > properties
>> >> >> > to
>> >> >> > null,
>> >> >> >     searchController.Delegate = null;
>> >> >> >     searchController.SearchResultsDelegate = null;
>> >> >> >     searchController.SearchResultsSource = null;
>> >> >> >
>> >> >> > But then I got this exception,
>> >> >> > MonoTouch.UIKit.UIKitThreadAccessException: UIKit Consistency
>> >> >> > error:
>> >> >> > you
>> >> >> > are
>> >> >> > calling a UIKit method that can only be invoked from the UI
>> >> >> > thread.
>> >> >> >   at MonoTouch.UIKit.UIApplication.EnsureUIThread () [0x00000] in
>> >> >> > <filename
>> >> >> > unknown>:0
>> >> >> >   at MonoTouch.UIKit.UISearchDisplayController.set_WeakDelegate
>> >> >> > (MonoTouch.Foundation.NSObject value) [0x00000] in <filename
>> >> >> > unknown>:0
>> >> >> >   at MonoTouch.UIKit.UISearchDisplayController.set_Delegate
>> >> >> > (MonoTouch.UIKit.UISearchDisplayDelegate value) [0x00000] in
>> >> >> > <filename
>> >> >> > unknown>:0
>> >> >> >   at Diet52App.FoodSearchBase.Dispose (Boolean disposing)
>> >> >> > [0x00000]
>> >> >> > in
>> >> >> > <filename unknown>:0
>> >> >> >   at MonoTouch.Foundation.NSObject.Finalize () [0x00000] in
>> >> >> > <filename
>> >> >> > unknown>:0
>> >> >> >
>> >> >> > I got the idea to set searchController's properties to null by
>> >> >> > reading
>> >> >> > this
>> >> >> > thread,
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >> >> >

>> >> >> > Best regards,
>> >> >> >
>> >> >> > Daniel
>> >> >> >
>> >> >> >
>> >> >> > 2013/8/1 Nic Wise [via MonoTouch] <[hidden email]>
>> >> >> >>
>> >> >> >> Hi Nordis
>> >> >> >>
>> >> >> >> If I had to guess, I'd say this is the problem
>> >> >> >>
>> >> >> >> protected override void Dispose (bool disposing)
>> >> >> >> {
>> >> >> >> // Hopefully fixes SIGSEGV error
>> >> >> >> //
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> http://stackoverflow.com/questions/6708705/monotouch-sigsegv-crash-using-navigationcontroller-and-searchdisplaycontroller?rq=1
>> >> >> >> BeginInvokeOnMainThread (() => {

>> >> >>
>> >> >> >> searchController.Delegate = null;
>> >> >> >> searchController.SearchResultsDelegate = null;
>> >> >> >> searchController.SearchResultsSource = null;
>> >> >> >> });
>> >> >> >> base.Dispose (disposing);
>> >> >> >> }
>> >> >> >>
>> >> >> >>
>> >> >> >> BeginInvokeOnMainThread will call it and return immediately - so
>> >> >> >> your
>> >> >> >> searchController may have been disposed of by the time the
>> >> >> >> background
>> >> >> >> thread runs.
>> >> >> >>
>> >> >> >> try changing it to either not use the call at all, or use
>> >> >> >> InvokeOnMainThread, which waits for the code to execute before
>> >> >> >> continuing.
>> >> >> >>
>> >> >> >>
>> >> >> >> "Unlike NSObject.BeginInvokeOnMainThread(NSAction) this method
>> >> >> >> waits
>> >> >> >> for the main thread to execute the method, and does not return
>> >> >> >> until
>> >> >> >> the code pointed by action has completed running."
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> On 1 August 2013 09:16, Nordis <[hidden email]> wrote:
>> >> >> >>
>> >> >> >> > I'm having problem to find the cause of random crashes in my
>> >> >> >> > app.
>> >> >> >> > The
>> >> >> >> > crashes
>> >> >> >> > only occurs when I build in release mode and run on a device
>> >> >> >> > like
>> >> >> >> > iPhone
>> >> >> >> > or
>> >> >> >> > iPad. Running in debug on simulator no crashes occurs. My guess
>> >> >> >> > is
>> >> >> >> > that
>> >> >> >> > the
>> >> >> >> > problem has something to do with these two lines in the crash
>> >> >> >> > log,
>> >> >> >> >
>> >> >> >> > 6   UIKit                           0x34a193d0
>> >> >> >> > -[UISearchDisplayController
>> >> >> >> > _destroyManagedTableView] + 68
>> >> >> >> > 7   UIKit                           0x34a2195a
>> >> >> >> > -[UISearchDisplayController
>> >> >> >> > dealloc] + 94
>> >> >> >> > I've uploaded the source code of my UITableViewController and
>> >> >> >> > the
>> >> >> >> > full
>> >> >> >> > crash
>> >> >> >> > log here, https://gist.github.com/Nordis/6128735
>> >> >> >> >
>> >> >> >> > All help to track the cause of the crashes is much appreciated!
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> > View this message in context:
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405.html
>> >> >> >> > Sent from the MonoTouch mailing list archive at Nabble.com.

>> >> >> >> > _______________________________________________
>> >> >> >> > MonoTouch mailing list
>> >> >> >> > [hidden email]
>> >> >> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> --
>> >> >> >> Nic Wise
>> >> >> >> t.  <a href="tel:%2B44%207788%20592%20806" value="<a
>> >> >> >> href="tel:%2B447788592806" value="<a href="tel:%2B447788592806"
>> >> >> >> value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806" target="_blank"><a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> >> >> >> target="_blank"><a href="tel:%2B447788592806"
>> >> >> >> value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806" target="_blank"><a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"

>>
>> >> >> >> target="_blank"><a href="tel:%2B44%207788%20592%20806"
>> >> >> >> value="<a href="tel:%2B447788592806" value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> >> >> >> target="_blank"><a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806" target="_blank"><a
>> >> >> >> href="tel:%2B44%207788%20592%20806" value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> >> >> >> target="_blank"><a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 |
>> >> >> >> @fastchicken
>> >> >> >> b. http://www.fastchicken.co.nz/
>> >> >>
>> >> >> >> _______________________________________________
>> >> >> >> MonoTouch mailing list
>> >> >> >> [hidden email]
>> >> >> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >> >>
>> >> >> >>
>> >> >> >> ________________________________
>> >> >> >> If you reply to this email, your message will be added to the
>> >> >> >> discussion
>> >> >> >> below:
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658406.html
>> >> >> >> To unsubscribe from Crash related to UITableViewController /

>> >> >> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> >> >> >> NAML
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > ________________________________
>> >> >> > View this message in context: Re: Crash related to
>> >> >> > UITableViewController
>> >> >> > /
>> >> >> > UISearchDisplayController in MonoTouch/Xamarin.iOS
>> >> >> >
>> >> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> >> >
>> >> >> > _______________________________________________
>> >> >> > MonoTouch mailing list
>> >> >> > [hidden email]
>> >> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Nic Wise
>> >> >> t.  <a href="tel:%2B44%207788%20592%20806" value="<a
>> >> >> href="tel:%2B447788592806" value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> >> >> target="_blank"><a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806"
>> >> >> target="_blank"><a href="tel:%2B44%207788%20592%20806"
>> >> >> value="<a href="tel:%2B447788592806" value="+447788592806" target="_blank">+447788592806" target="_blank"><a href="tel:%2B44%207788%20592%20806" value="+447788592806" target="_blank">+44 7788 592 806 | @fastchicken
>> >> >> b. http://www.fastchicken.co.nz/
>> >> >> _______________________________________________
>> >> >> MonoTouch mailing list
>> >> >> [hidden email]
>> >> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >>
>> >> >>
>> >> >> ________________________________
>> >> >> If you reply to this email, your message will be added to the
>> >> >> discussion
>> >> >> below:
>> >> >>
>> >> >>
>> >> >>
>> >> >> http://monotouch.2284126.n4.nabble.com/Crash-related-to-UITableViewController-UISearchDisplayController-in-MonoTouch-Xamarin-iOS-tp4658405p4658408.html
>> >> >> To unsubscribe from Crash related to UITableViewController /

>> >> >> UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
>> >> >> NAML
>> >> >
>> >> >
>> >> >
>> >> > ________________________________
>> >> > View this message in context: Re: Crash related to
>> >> > UITableViewController
>> >> > /
>> >> > UISearchDisplayController in MonoTouch/Xamarin.iOS
>> >> > Sent from the MonoTouch mailing list archive at Nabble.com.
>> >> >
>> >> > _______________________________________________
>> >> > MonoTouch mailing list
>> >> > [hidden email]

>> >> > http://lists.ximian.com/mailman/listinfo/monotouch
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Nic Wise
>> >> t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806"
>> >> target="_blank">+44 7788 592 806 | @fastchicken
>> >> b. http://www.fastchicken.co.nz/
>> >
>> >
>>
>>
>>
>> --
>> Nic Wise
>> t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806"
>> target="_blank">+44 7788 592 806 | @fastchicken
>> b. http://www.fastchicken.co.nz/
>
>
>
> ________________________________
> View this message in context: Re: Crash related to UITableViewController /
> UISearchDisplayController in MonoTouch/Xamarin.iOS
> Sent from the MonoTouch mailing list archive at Nabble.com.
>
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>


--
Nic Wise
t.  +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch



To unsubscribe from Crash related to UITableViewController / UISearchDisplayController in MonoTouch/Xamarin.iOS, click here.
NAML

Loading...