FMDB崩溃*** -[FMResultSet retain]: message sent to deallocated instance 0x604003a49e70

本文描述了一个使用FMDB过程中遇到的偶发性崩溃问题,崩溃信息提示发送消息给已释放的实例。通过分析代码片段及FMDB内部实现,探讨可能的原因及解决思路。

执行FMDB语句时候,偶尔会发生崩溃 信息如下

*** -[FMResultSet retain]: message sent to deallocated instance 0x604003a49e70

代码很少

__block NSArray *arrs = [NSArray new];

        [jqFmdb jq_inDatabase:^{

            __strong typeof(weakSelf)strongSelf=weakSelf;

            arrs = [strongSelf ->jqFmdb jq_lookupTable:[NSString stringWithFormat:@"qunDetail%@",strongSelf.chatCreateSuccessEntity.groupId] dicOrModel:[ZJContact class] whereFormat:[NSString stringWithFormat:@""]];

        }];


在此代码上面还有其他FMDb操作 但是都在线程安全block中,僵尸断点在FMDB库中FMResultSet *rs = (FMResultSet *)[rsInWrappedInATastyValueMeal pointerValue]; 具体定位到这一行

#ifdef DEBUG

            NSSet *openSetCopy = FMDBReturnAutoreleased([[db valueForKey:@"_openResultSets"] copy]);

            for (NSValue *rsInWrappedInATastyValueMeal in openSetCopy) {

                FMResultSet *rs = (FMResultSet *)[rsInWrappedInATastyValueMeal pointerValue];

                NSLog(@"query: '%@'", [rs query]);

            }

#endif

        }

    });

    

    FMDBRelease(self);


请问哪位好心人帮帮忙看看呢,用着用着就能崩了 哎



iOS崩溃日志: Application Specific Information: Could not allocate memory. Thread 0 name: Dispatch queue: fmdb.<FMDatabaseQueue: 0x281b26580> Thread 0 Crashed: 0 libswiftCore.dylib 0x1d54294fc swift_slowAlloc.cold.1 + 16 1 libswiftCore.dylib 0x1d53912e0 swift_slowAlloc + 116 2 libswiftCore.dylib 0x1d5391464 swift_allocObject + 52 3 libswiftCore.dylib 0x1d53426c8 specialized static _DictionaryStorage.resize(original:capacity:move:) + 260 4 IPrinter 0x10304597c specialized _NativeDictionary._copyOrMoveAndResize(capacity:moveElements:) + 92 5 IPrinter 0x1031f3e24 closure #1 in DatabaseManager.query(table:condition:sort:) + 1864 6 IPrinter 0x1031f5b0c partial apply for closure #1 in DatabaseManager.query(table:condition:sort:) + 44 7 IPrinter 0x102dd87fc MoyaProvider.endpoint(_:) + 20 8 IPrinter 0x1031f1a7c thunk for @escaping @callee_guaranteed (@guaranteed FMDatabase, @unowned UnsafeMutablePointer<ObjCBool>) -> () + 44 9 IPrinter 0x10347569c __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 180 10 libdispatch.dylib 0x1e1f78780 _dispatch_client_callout + 16 11 libdispatch.dylib 0x1e1f5aa50 _dispatch_lane_barrier_sync_invoke_and_complete + 52 12 IPrinter 0x1034755c8 -[FMDatabaseQueue beginTransaction:withBlock:] + 112 13 IPrinter 0x1031f349c DatabaseManager.query(table:condition:sort:) + 384 14 IPrinter 0x103083a98 DatabaseManager.querySystemTemplateData(deviceType:lang:) + 352 15 IPrinter 0x103083b24 @objc DatabaseManager.querySystemTemplateData(deviceType:lang:) + 48 16 IPrinter 0x1028b2e18 +[SFPublicMethods getLocalSystemTemplateData] + 348 17 IPrinter 0x102d16b20 -[FHYAPP refreshLocalTemplateAndMaterialData] + 44 18 IPrinter 0x102c31e00 -[SFG10TabBarController updateStyleTypeNotification] + 52 19 CoreFoundation 0x1db1fc7d8 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 140 20 CoreFoundation 0x1db2990c0 ___CFXRegistrationPost_block_invoke + 84 21 CoreFoundation 0x1db27d8a8 _CFXRegistrationPost + 404 22 CoreFoundation 0x1db20feec _CFXNotificationPost + 680 23 Foundation 0x1d55a9fd4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88 24 IPrinter 0x102a12940 -[SFLPSettingViewController selectCell:] + 3616 25 UIKitCore 0x1ddf13a84 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:deselectPrevious:performCustomSelectionAction:] + 1228 帮我分析一下错误原因
最新发布
11-29
Application Specific Information: Could not allocate memory. Thread 0 name: Dispatch queue: fmdb.<FMDatabaseQueue: 0x281b26580> Thread 0 Crashed: 0 libswiftCore.dylib 0x1d54294fc swift_slowAlloc.cold.1 + 16 1 libswiftCore.dylib 0x1d53912e0 swift_slowAlloc + 116 2 libswiftCore.dylib 0x1d5391464 swift_allocObject + 52 3 libswiftCore.dylib 0x1d53426c8 specialized static _DictionaryStorage.resize(original:capacity:move:) + 260 4 IPrinter 0x10304597c specialized _NativeDictionary._copyOrMoveAndResize(capacity:moveElements:) + 92 5 IPrinter 0x1031f3e24 closure #1 in DatabaseManager.query(table:condition:sort:) + 1864 6 IPrinter 0x1031f5b0c partial apply for closure #1 in DatabaseManager.query(table:condition:sort:) + 44 7 IPrinter 0x102dd87fc MoyaProvider.endpoint(_:) + 20 8 IPrinter 0x1031f1a7c thunk for @escaping @callee_guaranteed (@guaranteed FMDatabase, @unowned UnsafeMutablePointer<ObjCBool>) -> () + 44 9 IPrinter 0x10347569c __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 180 10 libdispatch.dylib 0x1e1f78780 _dispatch_client_callout + 16 11 libdispatch.dylib 0x1e1f5aa50 _dispatch_lane_barrier_sync_invoke_and_complete + 52 12 IPrinter 0x1034755c8 -[FMDatabaseQueue beginTransaction:withBlock:] + 112 13 IPrinter 0x1031f349c DatabaseManager.query(table:condition:sort:) + 384 14 IPrinter 0x103083a98 DatabaseManager.querySystemTemplateData(deviceType:lang:) + 352 15 IPrinter 0x103083b24 @objc DatabaseManager.querySystemTemplateData(deviceType:lang:) + 48 16 IPrinter 0x1028b2e18 +[SFPublicMethods getLocalSystemTemplateData] + 348 17 IPrinter 0x102d16b20 -[FHYAPP refreshLocalTemplateAndMaterialData] + 44 18 IPrinter 0x102c31e00 -[SFG10TabBarController updateStyleTypeNotification] + 52 19 CoreFoundation 0x1db1fc7d8 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 140 20 CoreFoundation 0x1db2990c0 ___CFXRegistrationPost_block_invoke + 84 21 CoreFoundation 0x1db27d8a8 _CFXRegistrationPost + 404 22 CoreFoundation 0x1db20feec _CFXNotificationPost + 680 23 Foundation 0x1d55a9fd4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88 24 IPrinter 0x102a12940 -[SFLPSettingViewController selectCell:] + 3616 25 UIKitCore 0x1ddf13a84 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:deselectPrevious:performCustomSelectionAction:] + 1228 帮我分析一下错误原因
11-29
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值