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

Swift WCDB Debug模式下初始化crash #1027

Closed
Monkey-Sun opened this issue Nov 23, 2023 · 3 comments
Closed

Swift WCDB Debug模式下初始化crash #1027

Monkey-Sun opened this issue Nov 23, 2023 · 3 comments

Comments

@Monkey-Sun
Copy link

The language of WCDB

Swift 5, xcode 15.0.1

The version of WCDB

WCDB (2.0.4)

The base device info of iPhone

iPhone Xs, iOS 14.4.2

The platform of WCDB

iOS

The installation of WCDB

Cocoapods

What's the issue?

Debug mode crashed when create Database instance.

image image

Full stack:

  • thread Repair #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000000000000
    frame Repair #1: 0x000000010378aa7c WCDBWCDB::Core::shared() at Core.cpp:44:27 frame #2: 0x00000001037b0138 WCDBWCDBCoreCreateDatabase(path="/var/mobile/Containers/Data/Application/DCE0F7F3-E0E1-4E4C-B281-9A05CF1FF900/Documents/wcdb/uudb.db") at CoreBridge.cpp:31:41
    frame iOS 不支持cocoapods引入吗 #3: 0x0000000103af98e4 WCDBDatabase.__allocating_init(url="file:///var/mobile/Containers/Data/Application/DCE0F7F3-E0E1-4E4C-B281-9A05CF1FF900/Documents/wcdb/uudb.db") at Database.swift:54:24 frame #4: 0x0000000103af95b4 WCDBDatabase.__allocating_init(path="/var/mobile/Containers/Data/Application/DCE0F7F3-E0E1-4E4C-B281-9A05CF1FF900/Documents/wcdb/uudb.db") at Database.swift:39:14
    frame Feature: WCDB for Swift #5: 0x0000000102a41250 SteivaDemoUUStDBManager.init(self=0x0000000282aafbc0) at UUStDBManager.swift:15:14 frame #6: 0x0000000102a410fc SteivaDemoUUStDBManager.__allocating_init() at UUStDBManager.swift:0
    frame 增加android的 x86_64 支持 #7: 0x0000000102a410bc SteivaDemoone-time initialization function for share at UUStDBManager.swift:12:24 frame #8: 0x00000001058f56c0 libdispatch.dylib_dispatch_client_callout + 20
    frame Is there any plan to support React Native? #9: 0x00000001058f71f8 libdispatch.dylib_dispatch_once_callout + 136 frame #10: 0x000000018d3345bc libswiftCore.dylibswift_once + 48
    frame 使用 Carthage 安装,但是文件路径与文档不同 #11: 0x0000000102a41158 SteivaDemoUUStDBManager.share.unsafeMutableAddressor at UUStDBManager.swift:12:16 frame #12: 0x0000000102a3c0f4 SteivaDemoViewController.viewDidLoad(self=0x00000001568113a0) at ViewController.swift:82:23
    frame iOS 版,在未设置加密的情况下,是否可以使用软件直接查看数据库? #13: 0x0000000102a3c290 SteivaDemo@objc ViewController.viewDidLoad() at <compiler-generated>:0 frame #14: 0x000000018b632744 UIKitCore-[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 108
    frame 表创建失败 #15: 0x000000018b636f70 UIKitCore-[UIViewController loadViewIfRequired] + 956 frame #16: 0x000000018b575a08 UIKitCore-[UINavigationController _updateScrollViewFromViewController:toViewController:] + 176
    frame WCDB_PROPERTY, WCDB_SYNTHESIZE 修改建议 #17: 0x000000018b575d24 UIKitCore-[UINavigationController _startTransition:fromViewController:toViewController:] + 196 frame #18: 0x000000018b576bac UIKitCore-[UINavigationController _startDeferredTransitionIfNeeded:] + 880
    frame iOS 建议添加打包脚本 #19: 0x000000018b577f88 UIKitCore-[UINavigationController __viewWillLayoutSubviews] + 168 frame #20: 0x000000018b559a18 UIKitCore-[UILayoutContainerView layoutSubviews] + 228
    frame 当我尝试加密数据库的时候遇到这个bug #21: 0x000000018c2a7ec4 UIKitCore-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2504 frame #22: 0x000000018c7c2644 QuartzCore-[CALayer layoutSublayers] + 308
    frame iOS文件编译设置 #23: 0x000000018c7c2b18 QuartzCoreCA::Layer::layout_if_needed(CA::Transaction*) + 524 frame #24: 0x000000018c7d730c QuartzCoreCA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144
    frame 按教程用carthage集成,编译失败 #25: 0x000000018c71c640 QuartzCoreCA::Context::commit_transaction(CA::Transaction*, double, double*) + 416 frame #26: 0x000000018c747b08 QuartzCoreCA::Transaction::commit() + 732 frame SetGlobalTrace回调不执行 #27: 0x000000018bd79f28 UIKitCore__34-[UIApplication _firstCommitBlock]_block_invoke_2 + 84 frame #28: 0x000000018932149c CoreFoundationCFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 28
    frame Carthage 集成出错 #29: 0x00000001893206e4 CoreFoundation__CFRunLoopDoBlocks + 408 frame #30: 0x000000018931aaa0 CoreFoundation__CFRunLoopRun + 844
    frame 如何测试损坏数据库的修复和恢复功能 #31: 0x000000018931a21c CoreFoundationCFRunLoopRunSpecific + 600 frame #32: 0x00000001a0ee4784 GraphicsServicesGSEventRunModal + 164
    frame Android从SQLCipher Android升级到WCDB失败 #33: 0x000000018bd5aee8 UIKitCore-[UIApplication _run] + 1072 frame #34: 0x000000018bd6075c UIKitCoreUIApplicationMain + 168
    frame 请教个加密的问题 #35: 0x000000019d67f2e4 libswiftUIKit.dylibUIKit.UIApplicationMain(Swift.Int32, Swift.Optional<Swift.UnsafeMutablePointer<Swift.UnsafeMutablePointer<Swift.Int8>>>, Swift.Optional<Swift.String>, Swift.Optional<Swift.String>) -> Swift.Int32 + 104 frame #36: 0x0000000102a40214 SteivaDemostatic UIApplicationDelegate.main() at :0
    frame ORM 怎么实现一对多, 多对多, 模型套模型这种case呢? #37: 0x0000000102a4018c SteivaDemostatic AppDelegate.$main(self=SteivaDemo.AppDelegate) at <compiler-generated>:0 frame #38: 0x0000000102a402c0 SteivaDemomain at AppDelegate.swift:11:7
    frame 项目编译时.hpp里有报错 #39: 0x0000000188fda6b0 libdyld.dylibstart + 4 thread #2 frame #0: 0x00000001d4e58764 libsystem_pthread.dylibstart_wqthread
    thread iOS 不支持cocoapods引入吗 #3
    frame #0: 0x00000001b72f6184 libsystem_kernel.dylib__workq_kernreturn + 8 thread #4 frame #0: 0x00000001d4e58764 libsystem_pthread.dylibstart_wqthread
    thread Feature: WCDB for Swift #5
    frame #0: 0x00000001b72f6184 libsystem_kernel.dylib__workq_kernreturn + 8 thread #6, name = 'com.apple.uikit.eventfetch-thread' frame #0: 0x00000001b72d12d0 libsystem_kernel.dylibmach_msg_trap + 8
    frame Repair #1: 0x00000001b72d0660 libsystem_kernel.dylibmach_msg + 76 frame #2: 0x0000000189320c30 CoreFoundation__CFRunLoopServiceMachPort + 380
    frame iOS 不支持cocoapods引入吗 #3: 0x000000018931ac14 CoreFoundation__CFRunLoopRun + 1216 frame #4: 0x000000018931a21c CoreFoundationCFRunLoopRunSpecific + 600
    frame Feature: WCDB for Swift #5: 0x000000018a5c9df0 Foundation-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 232 frame #6: 0x000000018a5c9cbc Foundation-[NSRunLoop(NSRunLoop) runUntilDate:] + 92
    frame 增加android的 x86_64 支持 #7: 0x000000018be0ec48 UIKitCore-[UIEventFetcher threadMain] + 516 frame #8: 0x000000018a73ba34 FoundationNSThread__start + 864
    frame Is there any plan to support React Native? #9: 0x00000001d4e4fcb0 libsystem_pthread.dylib_pthread_start + 320 thread #7 frame #0: 0x00000001b72f6184 libsystem_kernel.dylib__workq_kernreturn + 8
    thread Support Android x86_64 ABI #8
    frame #0: 0x00000001d4e58764 libsystem_pthread.dylib`start_wqthread
@Monkey-Sun
Copy link
Author

Only debug mode have this crash. Archive as product ipa every thing is fine.

@Chouee
Copy link

Chouee commented Nov 23, 2023

Same issue.

@Qiuwen-chen
Copy link
Collaborator

Maybe this issue can help you: #1006

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

No branches or pull requests

3 participants