0
votes

I downloaded and build the facebook-binding from https://github.com/mono/monotouch-bindings The authentication works, but when I try to post something to my wall I get native crashes. After the "Post to Wall" Dialog has shown up, the app crashes when I click "Cancel" and also when I click "Share". The actual post gets successfully posted to my wall, but the crash is not very amusing :)

Here is the native stacktrace:

at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29 at sample.AppDelegate.Main (string[]) [0x00000] in /Users/fusonic/Projects/facebook/sample/Main.cs:263 at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr)

0   sample                              0x0009e72c mono_handle_native_sigsegv + 284
1   sample                              0x00013ab8 mono_sigsegv_signal_handler + 248
2   libSystem.B.dylib                   0x9474805b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   sample                              0x000094f3 -[FBDialog webView:shouldStartLoadWithRequest:navigationType:] + 735
5   UIKit                               0x0115b8d4 -[UIWebView webView:decidePolicyForNavigationAction:request:frame:decisionListener:] + 222
6   UIKit                               0x0115d59e -[UIWebViewWebViewDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:] + 77
7   CoreFoundation                      0x0219551d __invoking___ + 29
8   CoreFoundation                      0x02195437 -[NSInvocation invoke] + 167
9   CoreFoundation                      0x021c049a -[NSInvocation invokeWithTarget:] + 74
10  WebKit                              0x06b43aa4 -[_WebSafeForwarder forwardInvocation:] + 164
11  CoreFoundation                      0x021960c9 ___forwarding___ + 889
12  CoreFoundation                      0x02195ce2 _CF_forwarding_prep_0 + 50
13  CoreFoundation                      0x0219551d __invoking___ + 29
14  CoreFoundation                      0x02195437 -[NSInvocation invoke] + 167
15  WebCore                             0x076e3ae3 _ZL11SendMessageP12NSInvocation + 35
16  WebCore                             0x076e4115 _ZL20HandleDelegateSourcePv + 101
17  CoreFoundation                      0x0220397f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
18  CoreFoundation                      0x02166b73 __CFRunLoopDoSources0 + 243
19  CoreFoundation                      0x02166454 __CFRunLoopRun + 1012
20  CoreFoundation                      0x02165db4 CFRunLoopRunSpecific + 212
21  CoreFoundation                      0x02165ccb CFRunLoopRunInMode + 123
22  GraphicsServices                    0x03e95879 GSEventRunModal + 207
23  GraphicsServices                    0x03e9593e GSEventRun + 114
24  UIKit                               0x00fa5a9b UIApplicationMain + 1175
25  ???                                 0x0d080a05 0x0 + 218630661
26  ???                                 0x09ffaf18 0x0 + 167751448
27  ???                                 0x09ffac10 0x0 + 167750672
28  ???                                 0x09ffad66 0x0 + 167751014
29  sample                              0x00017e22 mono_jit_runtime_invoke + 722
30  sample                              0x00177d2e mono_runtime_invoke + 126
31  sample                              0x0017be14 mono_runtime_exec_main + 420
32  sample                              0x00181235 mono_runtime_run_main + 725
33  sample                              0x00075025 mono_jit_exec + 149
34  sample                              0x00010d2f main + 2202
35  sample                              0x0000d5a9 start + 53
1

1 Answers

0
votes

Ok, the issue is because the GC is collecting the Handler Delegate. When keeping a reference to the delegate the example works.

Fix can be found here: https://github.com/mono/monotouch-bindings/pull/46