Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXC_BAD_ACCESS #195

Closed
2 tasks
xmkevin opened this issue Dec 6, 2017 · 3 comments
Closed
2 tasks

EXC_BAD_ACCESS #195

xmkevin opened this issue Dec 6, 2017 · 3 comments
Labels

Comments

@xmkevin
Copy link

xmkevin commented Dec 6, 2017

对应的 WCDB 语言 ( The language of WCDB )

Objective-C

WCDB 的版本号 ( The version of WCDB )

cocoapod 最新版本

WCDB 的平台 ( The platform of WCDB )

iOS

WCDB 的安装方式 ( The installation of WCDB )

Cocoapods

遇到的问题 ( What's the issue? )

有一个对象,在单元测试的时候插入和读取数据都没有问题,在第三方调用的时候,每次都崩溃。调用堆栈如下:
`* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000000000000

  • frame Repair #1: 0x000000010b453818 HLMailDemosqlite3Malloc(n=258) at malloc.c:269 frame #2: 0x000000010b454409 HLMailDemodbMallocRawFinish(db=0x00007fa56ce41690, n=258) at malloc.c:592
    frame iOS 不支持cocoapods引入吗 #3: 0x000000010b4543de HLMailDemosqlite3DbMallocRawNN(db=0x00007fa56ce41690, n=258) at malloc.c:660 frame #4: 0x000000010b454288 HLMailDemosqlite3DbMallocRaw(db=0x00007fa56ce41690, n=258) at malloc.c:623
    frame Feature: WCDB for Swift #5: 0x000000010b4d9b5a HLMailDemosqlite3VdbeMemGrow(pMem=0x00007fa570818ad8, n=258, bPreserve=0) at vdbemem.c:135 frame #6: 0x000000010b4d9ced HLMailDemosqlite3VdbeMemClearAndResize(pMem=0x00007fa570818ad8, szNew=258) at vdbemem.c:177
    frame 增加android的 x86_64 支持 #7: 0x000000010b4db068 HLMailDemosqlite3VdbeMemSetStr(pMem=0x00007fa570818ad8, z="bplist00\324�\x02\x03\x04\x05\x06\x15\x16X$versionX$objectsY$archiverT$top\x12", n=258, enc='\0', xDel=0xffffffffffffffff) at vdbemem.c:903 frame #8: 0x000000010b4d0c8a HLMailDemobindText(pStmt=0x00007fa56d80c2e0, i=14, zData=0x00007fa56d810650, nData=258, xDel=0xffffffffffffffff, encoding='\0') at vdbeapi.c:1288
    frame Is there any plan to support React Native? #9: 0x000000010b4d0bf0 HLMailDemosqlite3_bind_blob(pStmt=0x00007fa56d80c2e0, i=14, zData=0x00007fa56d810650, nData=258, xDel=0xffffffffffffffff) at vdbeapi.c:1316 frame #10: 0x000000010b44560e HLMailDemoWCDB::StatementHandle::bindBLOB(this=0x000060c00024e8e0, value=0x00007ffee49fcb80, size=258, index=14) at handle_statement.cpp:109
    frame 使用 Carthage 安装,但是文件路径与文档不同 #11: 0x000000010b5020e9 HLMailDemostd::__1::enable_if<ColumnTypeInfo<(WCDB::ColumnType)5>::isBLOB, void>::type WCDB::StatementHandle::bind<(this=0x000060c00024e8e0, value=0x00007ffee49fcb80, size=258, index=14)5>(WCDB::ColumnTypeInfo<(WCDB::ColumnType)5>::CType const&, int, int) at handle_statement.hpp:74 frame #12: 0x00000001104b2b0d HLUMail::-[WCTChainCall bindProperty:ofObject:toStatementHandle:atIndex:withError:](self=0x000060c000300360, _cmd="bindProperty:ofObject:toStatementHandle:atIndex:withError:", property=0x000060c00007de10, object=0x000060c0001ad900, statementHandle=0x00007ffee49fd2f0, index=14, error=0x000060c000300378) at WCTChainCall.mm:111
    frame iOS 版,在未设置加密的情况下,是否可以使用软件直接查看数据库? #13: 0x00000001104d3333 HLUMail::-[WCTInsert doInsertObjects:withError:](self=0x000060c000300360, _cmd="doInsertObjects:withError:", objects=1 element, error=0x000060c000300378) at WCTInsert.mm:116 frame #14: 0x00000001104d396b HLUMail::-[WCTInsert executeWithObjects:](self=0x000060c000300360, _cmd="executeWithObjects:", objects=1 element) at WCTInsert.mm:154
    frame 表创建失败 #15: 0x00000001104edd39 HLUMail::-[WCTInterface(self=0x000060000023ff20, _cmd="insertObject:into:", object=0x000060c0001ad900, tableName="MailMessage") insertObject:into:](WCTObject *, NSString *) at WCTInterface+Convenient.mm:1019 frame #16: 0x00000001101e5e1c HLUMail::-[HLUMailDBService insertMessages:](self=0x000060000001ecc0, _cmd="insertMessages:", messages=50 elements) at HLUMailDBService.mm:108
    frame WCDB_PROPERTY, WCDB_SYNTHESIZE 修改建议 #17: 0x00000001101b82d9 HLUMail__50-[HLUMailManager fetchMailBriefsWithFolder:mails:]_block_invoke((null)=0x00000001132e4170, t=0x0000604000265d80) at HLUMailManager.m:140 frame #18: 0x0000000110206950 HLUMail__62-[BFTask continueWithExecutor:successBlock:cancellationToken:]_block_invoke((null)=, task=0x0000604000265d80) at BFTask.m:496
    frame iOS 建议添加打包脚本 #19: 0x0000000110205c92 HLUMail__55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke((null)=<unavailable>) at BFTask.m:412 frame #20: 0x0000000110200b1e HLUMail__29+[BFExecutor defaultExecutor]_block_invoke_2((null)=, block=0x0000000110205c10) at BFExecutor.m:65
    frame 当我尝试加密数据库的时候遇到这个bug #21: 0x00000001102014ce HLUMail-[BFExecutor execute:](self=0x000060000001f580, _cmd="execute:", block=0x0000000110205c10) at BFExecutor.m:131 frame #22: 0x00000001102063d2 HLUMail__55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke.145((null)=) at BFTask.m:461
    frame iOS文件编译设置 #23: 0x0000000110205594 HLUMail-[BFTask runContinuations](self=0x0000604000265d80, _cmd="runContinuations") at BFTask.m:383 frame #24: 0x0000000110204b5c HLUMail-[BFTask trySetResult:](self=0x0000604000265d80, _cmd="trySetResult:", result=@"50 elements") at BFTask.m:304
    frame 按教程用carthage集成,编译失败 #25: 0x0000000110207559 HLUMail-[BFTaskCompletionSource setResult:](self=0x0000604000016da0, _cmd="setResult:", result=@"50 elements") at BFTaskCompletionSource.m:46 frame #26: 0x00000001101cfb20 HLUMail__58-[HLUIMAPProvider fetchMessagesInFolder:requestKind:uids:]_block_invoke.139((null)=, error=0x0000000000000000, messages=@"50 elements", vanishedMessages=0x0000000000000000) at HLUIMAPProvider.m:194
    frame SetGlobalTrace回调不执行 #27: 0x0000000110284566 HLUMail::-[MCOIMAPFetchMessagesOperation operationCompleted](self=0x0000604000265d40, _cmd=<unavailable>) at MCOIMAPFetchMessagesOperation.mm:66 [opt] frame #28: 0x000000011027c716 HLUMail::-[MCOOperation _operationCompleted](self=0x0000604000265d40, _cmd=) at MCOOperation.mm:106 [opt]
    frame Carthage 集成出错 #29: 0x00000001131f643c libdispatch.dylib_dispatch_client_callout + 8 frame #30: 0x0000000113203497 libdispatch.dylib_dispatch_sync_thread_bound_invoke + 386
    frame 如何测试损坏数据库的修复和恢复功能 #31: 0x00000001131f643c libdispatch.dylib_dispatch_client_callout + 8 frame #32: 0x00000001132016f0 libdispatch.dylib_dispatch_main_queue_callback_4CF + 628
    frame Android从SQLCipher Android升级到WCDB失败 #33: 0x000000010c11cee9 CoreFoundation__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 frame #34: 0x000000010c0e1592 CoreFoundation__CFRunLoopRun + 2402
    frame 请教个加密的问题 #35: 0x000000010c0e09b9 CoreFoundationCFRunLoopRunSpecific + 409 frame #36: 0x0000000115c779c6 GraphicsServicesGSEventRunModal + 62
    frame ORM 怎么实现一对多, 多对多, 模型套模型这种case呢? #37: 0x000000010e0345e8 UIKitUIApplicationMain + 159 frame #38: 0x000000010b2007ff HLMailDemomain(argc=1, argv=0x00007ffee49ff098) at main.m:14
    frame 项目编译时.hpp里有报错 #39: 0x0000000113272d81 libdyld.dylibstart + 1 frame #40: 0x0000000113272d81 libdyld.dylibstart + 1`
@RingoD
Copy link
Collaborator

RingoD commented Dec 7, 2017

检查下 podfile 有没有加 use_framework!
然后麻烦提供下完整的 crash 堆栈 或 能够重现 crash 的代码

@xmkevin
Copy link
Author

xmkevin commented Dec 7, 2017

找到问题的原因了,是因为我在一个 Workspace 下,有三个项目。A-->B--->C-->WCDB,A 是一个 iOS App, B 是一个静态库,C 是一个动态库,因为 B 和 C 是一个慢慢融合的过程,现在 B 和 C 都依赖 WCDB,导致我在Pod 中 A 依赖的WCDB, C 也依赖了 WCDB,这样就出问题了。

@xmkevin xmkevin closed this as completed Dec 7, 2017
@RingoD
Copy link
Collaborator

RingoD commented Dec 7, 2017

@xmkevin 所以这就是我不那么推荐 cocoapods 的原因,静态库比较容易出问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants