使用导航控制器和搜索显示控制器时 MonoTouch SIGSEGV 崩溃
在 MonoTouch 模拟器中,我遇到随机崩溃,并显示以下诊断:
/tmp/mono-gdb-commands.FV1b8V:1: Error in sourced command file:
unable to debug self
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
跟踪提到“UISearchDisplayController dealloc”:
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend (intptr,intptr) <IL 0x00024, 0xffffffff>
at MonoTouch.Foundation.NSObject/MonoTouch_Disposer.Drain (MonoTouch.Foundation.NSObject) [0x0002a] in /Users/plasma/Source/iphone/monotouch/Foundation/NSObject.cs:305
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00052, 0xffffffff>
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:26
at TestCase.Application.Main (string[]) [0x00000] in /Users/user/Projects/Junk 2/StarTrack/Main.cs:13
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
Native stacktrace:
0 TestCase 0x000d1965 mono_handle_native_sigsegv + 343
1 TestCase 0x0000ffb4 mono_sigsegv_signal_handler + 322
2 libSystem.B.dylib 0x91b3745b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 UIKit 0x01f7ab5a **-[UISearchDisplayController dealloc]** + 106
5 ??? 0x0aa9a194 0x0 + 178889108
6 ??? 0x0fcea9c4 0x0 + 265202116
7 ??? 0x077520d6 0x0 + 125116630
8 TestCase 0x0000fd6f mono_jit_runtime_invoke + 1332
9 TestCase 0x001ee239 mono_runtime_invoke + 137
10 TestCase 0x0029e9ab monotouch_trampoline + 2527
11 Foundation 0x0140e94e __NSThreadPerformPerform + 251
12 CoreFoundation 0x00ea08ff __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
13 CoreFoundation 0x00dfe88b __CFRunLoopDoSources0 + 571
14 CoreFoundation 0x00dfdd86 __CFRunLoopRun + 470
15 CoreFoundation 0x00dfd840 CFRunLoopRunSpecific + 208
16 CoreFoundation 0x00dfd761 CFRunLoopRunInMode + 97
17 GraphicsServices 0x0404c1c4 GSEventRunModal + 217
18 GraphicsServices 0x0404c289 GSEventRun + 115
19 UIKit 0x01ce0c93 UIApplicationMain + 1160
20 ??? 0x09d54933 0x0 + 164972851
21 ??? 0x09d53384 0x0 + 164967300
22 ??? 0x09d530be 0x0 + 164966590
23 ??? 0x09d53216 0x0 + 164966934
24 TestCase 0x0000fd6f mono_jit_runtime_invoke + 1332
25 TestCase 0x001ee239 mono_runtime_invoke + 137
26 TestCase 0x001f0920 mono_runtime_exec_main + 669
27 TestCase 0x001efd0a mono_runtime_run_main + 843
28 TestCase 0x000a3c62 mono_jit_exec + 200
29 TestCase 0x002a25eb main + 3838
30 TestCase 0x000030c9 _start + 208
31 TestCase 0x00002ff8 start + 40
32 ??? 0x00000002 0x0 + 2
已将应用程序削减到重现崩溃所需的绝对最低限度,并寻找对 descoped 和垃圾收集变量的可能引用。没有 XIB:它只是代码。
导航控制器有一个用于调度的表格视图;点击表格行即可进入带有搜索栏的 22,000 行表格。用户在搜索栏中键入内容,点击过滤后的表格行,然后立即弹回到第一个表格视图。在崩溃之前可以执行两到二十次。 (点击第一个表格视图中的表格行后立即发生崩溃)。除了崩溃之外,该应用程序的运行完全符合预期。
任何想法或建议都会非常感激,经过几天的努力我已经束手无策了。顺便说一句,在臭名昭著的收购之后,我建议使用 MonoTouch,这是我们的第一个应用程序。
下面列出的类似乎是最相关的;这些类和其他类在这里:http://www.whaleandseal.org/Test/Crash.pdf< /a> 和一个独立的测试用例位于 http://www.whaleandseal.org/Test/TestCase.zip 。
AppDelegate
TTNavController
TTNavigationController
despatchTable
TTTableDelegate
new FromTableController(…)
FromTableController
searchBar
searchController
FromSearchResultsSource
FromSearchResultsDelegate
:
In the MonoTouch simulator I am getting random crashes with the following diagnostic:
/tmp/mono-gdb-commands.FV1b8V:1: Error in sourced command file:
unable to debug self
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
The trace mentions "UISearchDisplayController dealloc" :
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend (intptr,intptr) <IL 0x00024, 0xffffffff>
at MonoTouch.Foundation.NSObject/MonoTouch_Disposer.Drain (MonoTouch.Foundation.NSObject) [0x0002a] in /Users/plasma/Source/iphone/monotouch/Foundation/NSObject.cs:305
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00052, 0xffffffff>
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:26
at TestCase.Application.Main (string[]) [0x00000] in /Users/user/Projects/Junk 2/StarTrack/Main.cs:13
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
Native stacktrace:
0 TestCase 0x000d1965 mono_handle_native_sigsegv + 343
1 TestCase 0x0000ffb4 mono_sigsegv_signal_handler + 322
2 libSystem.B.dylib 0x91b3745b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 UIKit 0x01f7ab5a **-[UISearchDisplayController dealloc]** + 106
5 ??? 0x0aa9a194 0x0 + 178889108
6 ??? 0x0fcea9c4 0x0 + 265202116
7 ??? 0x077520d6 0x0 + 125116630
8 TestCase 0x0000fd6f mono_jit_runtime_invoke + 1332
9 TestCase 0x001ee239 mono_runtime_invoke + 137
10 TestCase 0x0029e9ab monotouch_trampoline + 2527
11 Foundation 0x0140e94e __NSThreadPerformPerform + 251
12 CoreFoundation 0x00ea08ff __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
13 CoreFoundation 0x00dfe88b __CFRunLoopDoSources0 + 571
14 CoreFoundation 0x00dfdd86 __CFRunLoopRun + 470
15 CoreFoundation 0x00dfd840 CFRunLoopRunSpecific + 208
16 CoreFoundation 0x00dfd761 CFRunLoopRunInMode + 97
17 GraphicsServices 0x0404c1c4 GSEventRunModal + 217
18 GraphicsServices 0x0404c289 GSEventRun + 115
19 UIKit 0x01ce0c93 UIApplicationMain + 1160
20 ??? 0x09d54933 0x0 + 164972851
21 ??? 0x09d53384 0x0 + 164967300
22 ??? 0x09d530be 0x0 + 164966590
23 ??? 0x09d53216 0x0 + 164966934
24 TestCase 0x0000fd6f mono_jit_runtime_invoke + 1332
25 TestCase 0x001ee239 mono_runtime_invoke + 137
26 TestCase 0x001f0920 mono_runtime_exec_main + 669
27 TestCase 0x001efd0a mono_runtime_run_main + 843
28 TestCase 0x000a3c62 mono_jit_exec + 200
29 TestCase 0x002a25eb main + 3838
30 TestCase 0x000030c9 _start + 208
31 TestCase 0x00002ff8 start + 40
32 ??? 0x00000002 0x0 + 2
Have cut down the app to the absolute minimum necessary to reproduce the crash, and hunted for possible references to descoped and garbage-collected variables. There are no XIBs: it is code-only.
A navigation controller has a tableview for despatch; tapping on a table row takes you to a table of 22,000 rows with a searchbar. The user types into the searchbar, taps on a filtered table row, and is immediately popped back to the first tableview. This can be done from two to twenty times before crashing. (The crash occurs immediately upon tapping a table row in the first tableview). Apart from the crashes, the app works exactly as expected.
Any ideas or suggestions would be -so- much appreciated, am at wits end after days of effort. Btw I proposed using MonoTouch after the infamous takeover and this is our first app.
The classes listed below would seem to be the most relevant; these classes and others are here: http://www.whaleandseal.org/Test/Crash.pdf and a self-contained test case is at http://www.whaleandseal.org/Test/TestCase.zip .
AppDelegate
TTNavController
TTNavigationController
despatchTable
TTTableDelegate
new FromTableController(…)
FromTableController
searchBar
searchController
FromSearchResultsSource
FromSearchResultsDelegate
:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的 FromTableController 中添加此似乎可以解决问题:
解决方案的灵感来自于此: UISearchDisplayController 自动释放如何导致不同视图控制器崩溃?
Adding this in your FromTableController seems to fix the problem:
Solution was inspired by this: How can UISearchDisplayController autorelease cause crash in a different view controller?