进程通信,第三次发送消息的时候就会进入安全模式,求解

接收消息的是一个Tweak
代码如下:

-(void)applicationDidFinishLaunching:(id)applicationDidFinishLaunching
{
    %orig;
    CPDistributedMessagingCenter *server = [CPDistributedMessagingCenter centerNamed:@"com.FF_IOS.server"];
    
    rocketbootstrap_distributedmessagingcenter_apply(server);
    
    [server registerForMessageName:@"msgTest" target:self selector:@selector(handleMessageNamed:userInfo:)];
    [server runServerOnCurrentThread];
    
    NSLog(@"FFFFFFFFFFFFFFFF  serverInit  FFFFFFFFFFFFFFFFFFFFF");
    
    UIAlertView *alertView=[UIAlertView alloc] initWithTitle:@"ServerInit" message:nil delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];
    [alertView show];
    [alertView release];
}

%new(v@:@@)
- (void) handleMessageNamed:(NSString *)name userInfo :(NSDictionary *)userInfo
{
    
    if([name isEqualToString: @"msgTest"])
    {
        NSLog(@"FFFFFFFFFFFFFFFF  receiveSomething    FFFFFFFFFFFFFFFFFFFFF");
        
        UIAlertView *alertView=[UIAlertView alloc] initWithTitle:@"message" message:@"receive a Msg!" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];
        [alertView show];
        [alertView release];
    }
}

发送消息的是一个ActivatorListener,发送代码是这样的:

CPDistributedMessagingCenter *c = [CPDistributedMessagingCenter centerNamed:@"com.FF_IOS.server"];
        rocketbootstrap_distributedmessagingcenter_apply(c);
        
        [c sendMessageName:@"msgTest" userInfo:nil];
        [c release];

发送消息都能接收到,alert会弹出,然后第三次就会进入安全模式,试过好几遍了,请问一下这问题出在哪呢

看syslog里面有没有什么错误信息

好的,下回会注意
输出有点点,第一条第二条是正常打印,然后就进入安全模式了
syslog信息如下

Jan  1 00:27:23 FFPhone SpringBoard[735]: FFFFFFFFFFFFFFFF  receiveSomething    FFFFFFFFFFFFFFFFFFFFF
Jan  1 00:28:17 FFPhone SpringBoard[735]: FFFFFFFFFFFFFFFF  receiveSomething    FFFFFFFFFFFFFFFFFFFFF
Jan  1 00:28:29 FFPhone ReportCrash[1246]: Formulating crash report for process SpringBoard[735]
Jan  1 00:28:29 FFPhone imagent[47]: [Warning] Denying xpc connection, task does not have entitlement: com.apple.private.icfcallserver  (SpringBoard:735)
Jan  1 00:28:29 FFPhone backboardd[734]: System app "com.apple.SpringBoard" has died. Waiting for it to spawn again...
Jan  1 00:28:29 FFPhone com.apple.launchd[1] (com.apple.SpringBoard[735]): (com.apple.SpringBoard) Job appears to have crashed: Segmentation fault: 11
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Notice: Injecting: com.apple.springboard [SpringBoard] (847.26)
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: Entering Safe Mode
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/MobileSafety.dylib
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: nil class argument for selector touchesEnded:withEvent:
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: nil class argument for selector mouseDown:
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: nil class argument for selector _updateTimeString
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: nil class argument for selector _finishUnlockWithSound:unlockSource:isAutoUnlock:
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: nil class argument for selector _unlockWithSound:isAutoUnlock:unlockSource:
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: nil class argument for selector _unlockWithSound:isAutoUnlock:unlockType:
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: message not found [SBIconController showInfoAlertIfNeeded]
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: nil class argument for selector maxIconColumns
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: message not found [UIImage defaultDesktopImage]
Jan  1 00:28:29 FFPhone SpringBoard[1248]: MS:Warning: nil class argument for selector tile
Jan  1 00:28:29 FFPhone backboardd[734]: HID: The 'Passive' connection 'SpringBoard' access to protected services is granted.
Jan  1 00:28:29 FFPhone backboardd[734]: HID: The 'Rate Controlled' connection 'SpringBoard' access to protected services is granted.
Jan  1 00:28:29 FFPhone SpringBoard[1248]: Loaded logger: SBAppInstallationLog
Jan  1 00:28:29 FFPhone SpringBoard[1248]: Loaded logger: SBIconLog
Jan  1 00:28:29 FFPhone SpringBoard[1248]: Loaded logger: SBWorkspaceLogging
Jan  1 00:28:29 FFPhone SpringBoard[1248]: Error loading /System/Library/ProceduralWallpaper/ProceduralWallpapers.bundle/ProceduralWallpapers:  image not already loaded
Jan  1 00:28:29 FFPhone SpringBoard[1248]: Unable to load wallpaper plugin, bundle load failure - /System/Library/ProceduralWallpaper/ProceduralWallpapers.bundle
Jan  1 00:28:29 FFPhone SpringBoard[1248]: *** error reading settings archive file: <SBRootSettings: /var/mobile/Documents/com.apple.springboard.settings/RootSettings.plist> 
Jan  1 00:28:29 FFPhone backboardd[734]: -[BKSystemAppSentinel lock_notePresenceOfSystemApp:] Now monitoring "com.apple.SpringBoard"
Jan  1 00:28:30 FFPhone SpringBoard[1248]: *** error reading settings archive file: <SBRootSettings: /var/mobile/Documents/com.apple.springboard.settings/RootSettings.previous.plist> 
Jan  1 00:28:30 FFPhone ReportCrash[1246]: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/SpringBoard_2015-01-01-002828_FFPhone.ips using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Jan  1 00:28:30 FFPhone SpringBoard[1248]: Unable to locate class for SBIconClass key SBActivatorIcon for libactivator
Jan  1 00:28:33 FFPhone SpringBoard[1248]: libMobileGestalt MobileGestalt.c:200: string SBNonDefaultSystemAppTag is not a valid gestalt question
Jan  1 00:28:33 FFPhone SpringBoard[1248]: libMobileGestalt MobileGestalt.c:200: string hidden is not a valid gestalt question
Jan  1 00:28:33 FFPhone SpringBoard[1248]: libMobileGestalt MobileGestalt.c:835: still-camera is static and will never generate a notification
Jan  1 00:28:33 FFPhone SpringBoard[1248]: libMobileGestalt MobileGestalt.c:835: nike-ipod is static and will never generate a notification
Jan  1 00:28:33 FFPhone SpringBoard[1248]: libMobileGestalt MobileGestalt.c:835: magnetometer is static and will never generate a notification
Jan  1 00:28:33 FFPhone SpringBoard[1248]: libMobileGestalt MobileGestalt.c:835: any-telephony is static and will never generate a notification
Jan  1 00:28:33 FFPhone SpringBoard[1248]: libMobileGestalt MobileGestalt.c:835: stand-alone-contacts is static and will never generate a notification
Jan  1 00:28:33 FFPhone SpringBoard[1248]: (Note ) MC: Locking device immediately.
Jan  1 00:28:33 FFPhone backboardd[734]: HID: The 'Rate Controlled' connection 'SpringBoard' access to protected services is granted.
Jan  1 00:28:33 FFPhone SpringBoard[1248]: WiFi: Consulting "no-sdio-devices" property.
Jan  1 00:28:33 FFPhone SpringBoard[1248]: WiFi: "no-sdio-devices" property not found.
Jan  1 00:28:33 FFPhone SpringBoard[1248]: WiFi: Consulting "no-sdio-devices" property.
Jan  1 00:28:33 FFPhone SpringBoard[1248]: WiFi: "no-sdio-devices" property not found.
Jan  1 00:28:33 FFPhone SpringBoard[1248]: BTM: attaching to BTServer
Jan  1 00:28:33 FFPhone SpringBoard[1248]: lockdown says the device is: [Activated], state is 3
Jan  1 00:28:33 FFPhone SpringBoard[1248]: lockdown says we've previously registered: [1], state is 1
Jan  1 00:28:34 FFPhone SpringBoard[1248]: Using your own bundle identifier as an NSUserDefaults suite name does not make sense and will not work. Break on _NSUserDefaults_Log_Nonsensical_Suites to find this
Jan  1 00:28:36 FFPhone SpringBoard[1248]: Application windows are expected to have a root view controller at the end of application launch
Jan  1 00:28:36 FFPhone SpringBoard[1248]: CoreAnimation: ignoring invalid path
Jan  1 00:28:36 FFPhone SpringBoard[1248]: SMS Plugin initialized.
Jan  1 00:28:36 FFPhone SpringBoard[1248]: SIMToolkit plugin for SpringBoard initialized.
Jan  1 00:28:36 FFPhone SpringBoard[1248]: Unable to load plugin bundle NSBundle </System/Library/SpringBoardPlugins/Sharing.servicebundle> (not yet loaded): Error Domain=NSCocoaErrorDomain Code=3588 "The bundle “Sharing” couldn’t be loaded." UserInfo=0x179c2e30 {NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/System/Library/SpringBoardPlugins/Sharing.servicebundle/Sharing, NSLocalizedFailureReason=The bundle couldn’t be loaded., NSLocalizedDescription=The bundle “Sharing” couldn’t be loaded., NSDebugDescription=, NSBundlePath=/System/Library/SpringBoardPlugins/Sharing.servicebundle}
Jan  1 00:28:36 FFPhone SpringBoard[1248]: Unable to load plugin bundle NSBundle </System/Library/SpringBoardPlugins/WiFiPicker.servicebundle> (not yet loaded): Error Domain=NSCocoaErrorDomain Code=3588 "The bundle “WiFiPicker” couldn’t be loaded." UserInfo=0x1782add0 {NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/System/Library/SpringBoardPlugins/WiFiPicker.servicebundle/WiFiPicker, NSLocalizedFailureReason=The bundle couldn’t be loaded., NSLocalizedDescription=The bundle “WiFiPicker” couldn’t be loaded., NSDebugDescription=, NSBundlePath=/System/Library/SpringBoardPlugins/WiFiPicker.servicebundle}
Jan  1 00:28:48 FFPhone SpringBoard[1248]: [MPUSystemMediaControls] Disabling lock screen media controls updates for screen turning off.
Jan  1 00:28:48 FFPhone SpringBoard[1248]: [MPUNowPlayingController] Not registered for now playing notifications. Ignoring call to -unregisterForNotifications.
Jan  1 00:28:49 FFPhone SpringBoard[1248]: [MPUNowPlayingController] Not registered for now playing notifications. Ignoring call to -unregisterForNotifications.
Jan  1 00:28:54 FFPhone SpringBoard[1248]: [MPUSystemMediaControls] Enabling lock screen media controls updates for screen turning on.
Jan  1 00:28:54 FFPhone SpringBoard[1248]: [MPUNowPlayingController] Already registered for now playing notifications.
Jan  1 00:28:54 FFPhone SpringBoard[1248]: [MPUSystemMediaControls] Updating supported commands for now playing application.
Jan  1 00:28:56 FFPhone SpringBoard[1248]: __MKBAssertionFinalize: __MKBAssertionFinalize(0x16679b10)
Jan  1 00:28:56 FFPhone SpringBoard[1248]: MKBDeviceLockAssertion: MKBDeviceLockAssertion  (asserttype:4490844 with error 1)
Jan  1 00:28:56 FFPhone SpringBoard[1248]: (Error) MC: Could not unlock device. Error: NSError:
Jan  1 00:29:01 FFPhone SpringBoard[1248]: __MKBAssertionFinalize: __MKBAssertionFinalize(0x178207b0)
Jan  1 00:29:01 FFPhone SpringBoard[1248]: MKBDeviceLockAssertion: MKBDeviceLockAssertion  (asserttype:4490844 with error 1)

这个是错误信息,应该是空指针、野指针的问题。你的所有代码就是这些了吗?

[c release];

这里不应该release吧?