如何修复VAFieldTest应用程序中发生的_CTServerConnectionRegisterForNotification崩溃 [英] How to fix _CTServerConnectionRegisterForNotification crash happening in VAFieldTest application

查看:289
本文介绍了如何修复VAFieldTest应用程序中发生的_CTServerConnectionRegisterForNotification崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的设备中运行 VAFieldTest 应用程序,但应用程序在此行崩溃 _CTServerConnectionRegisterForNotification 。如何修复此崩溃?

I am trying to run VAFieldTest application in my device, but the application got crashed at this line _CTServerConnectionRegisterForNotification. How can I fix this crash?

以下是我通过的参数:

CTServerConnectionRef conn;
void register_notification(){
    if (!mach_port || !conn) return;    
    void *libHandle = dlopen("/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony", RTLD_LOCAL | RTLD_LAZY);
    void *kCTCellMonitorUpdateNotification = dlsym(libHandle, "kCTIndicatorsSignalStrengthNotification");
    if( kCTCellMonitorUpdateNotification== NULL) NSLog(@"Could not find kCTCellMonitorUpdateNotification"); 
    int x = 0; //placehoder for callback
    _CTServerConnectionRegisterForNotification(conn,kCTCellMonitorUpdateNotification,(void*)&x);
}

以下是崩溃报告:

(gdb) bt
#0  0x344f9710 in __CFStrConvertBytesToUnicode ()
#1  0x344faaea in __CFStringEncodeByteStream ()
#2  0x34466a10 in CFStringGetBytes ()
#3  0x39123928 in ctu::cf::assign ()
#4  0x39112380 in getCTEventForNotification ()
#5  0x390ecff8 in _CTServerConnectionDaemonRegistration ()
#6  0x39112e12 in _CTServerConnectionRegisterForNotification ()
#7  0x00003138 in register_notification () at /Users/deepthi/Desktop/iPhone Agent/VAFieldTest-master/Classes/VAFieldTestViewController.m:66
#8  0x00003388 in -[VAFieldTestViewController viewDidLoad] (self=0x15ada0, _cmd=0x34b8581b) at /Users/deepthi/Desktop/iPhone Agent/VAFieldTest-master/Classes/VAFieldTestViewController.m:116
#9  0x3471458c in -[UIViewController loadViewIfRequired] ()
#10 0x00002d84 in -[VAFieldTestAppDelegate application:didFinishLaunchingWithOptions:] (self=0x11f350, _cmd=0x34b698d3, application=0x11e510, launchOptions=0x0) at /Users/deepthi/Desktop/iPhone Agent/VAFieldTest-master/Classes/VAFieldTestAppDelegate.m:22
#11 0x34755ad0 in -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] ()
#12 0x3475565a in -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] ()
#13 0x3474d842 in -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] ()
#14 0x346f5c38 in -[UIApplication handleEvent:withNewEvent:] ()
#15 0x346f56cc in -[UIApplication sendEvent:] ()
#16 0x346f511a in _UIApplicationHandleEvent ()
#17 0x394785a2 in _PurpleEventCallback ()
#18 0x344e9682 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#19 0x344e8ee8 in __CFRunLoopDoSources0 ()
#20 0x344e7cb6 in __CFRunLoopRun ()
#21 0x3445aebc in CFRunLoopRunSpecific ()
#22 0x3445ad48 in CFRunLoopRunInMode ()
#23 0x3474c47c in -[UIApplication _run] ()
#24 0x347492f8 in UIApplicationMain ()
#25 0x00002cf6 in main (argc=1, argv=0x2fdffc50) at /Users/deepthi/Desktop/iPhone Agent/VAFieldTest-master/main.m:15
(gdb) 


推荐答案

当我得到它时,它是由_CTServerConnectionRegisterForNotification(...)调用中的第3个参数引起的,它应该是一个指向回调的指针...此处描述 - 不可紧缩的指针类型将int传递给coretelephony obj c中的void(*)(void)类型的参数

When I got this, it was caused by the 3rd argument in the call to _CTServerConnectionRegisterForNotification(...) which should be a pointer to a callback...described here - incompactable pointer type passing int to parameter of type void(*)(void) in coretelephony obj c

这篇关于如何修复VAFieldTest应用程序中发生的_CTServerConnectionRegisterForNotification崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆