核心数据轻量级迁移需要很长时间轰然

时间:2014-05-04 14:45:40

标签: macos core-data cocoa-bindings core-data-migration

我有一个OS X应用程序,它使用Core Data&绑定和最近更新到新版本。较新版本包含更新的数据模型(由一个与之前的实体没有任何关系的附加实体组成)。数据模型的更新在两个版本中,我使用自动轻量级迁移功能。两个版本都在应用程序内部发布。我们有数千名用户已经更新。由于此问题,我们未收到任何支持请求或自动崩溃报告。这就是为什么我认为我的代码是(好的)OK-ish。

但仍有一个堆栈痕迹让我发疯:


OS Version:      10.9.2 (Build 13C1021)
Architecture:    x86_64
Report Version:  18

Command:         Rainbow Unicorn
Path:            /Applications/Rainbow Unicorn.app/Contents/MacOS/Rainbow Unicorn
Version:         1.8 (35)
App Item ID:     414704443
App External ID: 510002694
Parent:          launchd [155]

PID:             1390
Event:           hang
Duration:        4.84s (process was unresponsive for 117 seconds before sampling)
Steps:           40 (100ms sampling interval)

Hardware model:  MacBookPro8,1
Active cpus:     4
Fan speed:       1996 rpm

Free pages:      31445 pages (-25644)
Pageins:         144 pages
Pageouts:        0 pages
Swapins:         0 pages
Swapouts:        0 pages


Process:         Rainbow Unicorn [1390]
Path:            /Applications/Rainbow Unicorn.app/Contents/MacOS/Rainbow Unicorn
Architecture:    x86_64
Parent:          launchd [155]
UID:             501
Task size:       77873 pages (+13047)
CPU Time:        0.227s
Note:            Unresponsive for 117 seconds before sampling

  Thread 0xd10a6    DispatchQueue 1          priority 46         cpu time   0.227s
  40 start + 1 (libdyld.dylib) [0x7fff835ed5fd]
    40 NSApplicationMain + 448 (AppKit) [0x7fff8b328727]
      40 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 357 (AppKit) [0x7fff8b32c8db]
        40 -[NSBundle(NSNibLoading) loadNibNamed:owner:topLevelObjects:] + 197 (AppKit) [0x7fff8b32caec]
          40 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 288 (AppKit) [0x7fff8b32ccfc]
            40 loadNib + 327 (AppKit) [0x7fff8b32d75e]
              40 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1004 (AppKit) [0x7fff8b338bf4]
                40 -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 652 (AppKit) [0x7fff8b3d30a8]
                  40 -[NSObjectParameterBinder _updateObject:observedController:observedKeyPath:context:] + 1118 (AppKit) [0x7fff8b3dbff9]
                    40 -[NSBinder valueForBinding:resolveMarkersToPlaceholders:] + 160 (AppKit) [0x7fff8b3dc3bd]
                      40 -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 334 (Foundation) [0x7fff890714ff]
                        40 -[NSObject(NSKeyValueCoding) valueForKey:] + 381 (Foundation) [0x7fff89059466]
                          40 ??? (Rainbow Unicorn + 13382) [0x10871c446]
                            40 ??? (Rainbow Unicorn + 12213) [0x10871bfb5]
                              40 ??? (Rainbow Unicorn + 12919) [0x10871c277]
                                40 -[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:] + 4014 (CoreData) [0x7fff888bb4de]
                                  40 -[NSStoreMigrationPolicy(InternalMethods) _gatherDataAndPerformMigration:] + 2039 (CoreData) [0x7fff889c60a7]
                                    40 -[NSStoreMigrationPolicy migrateStoreAtURL:withManager:metadata:options:error:] + 102 (CoreData) [0x7fff889c4626]
                                      40 -[NSStoreMigrationPolicy(InternalMethods) migrateStoreAtURL:toURL:storeType:options:withManager:error:] + 290 (CoreData) [0x7fff889c5792]
                                        40 -[NSMigrationManager migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:] + 521 (CoreData) [0x7fff889c7889]
                                          40 -[NSSQLiteInPlaceMigrationManager migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:] + 1737 (CoreData) [0x7fff889ddac9]
                                            40 -[_NSSQLiteStoreMigrator performMigration:] + 782 (CoreData) [0x7fff889e142e]
                                              40 -[NSSQLConnection prepareAndExecuteSQLStatement:] + 52 (CoreData) [0x7fff88901e44]
                                                40 -[NSSQLiteConnection execute] + 2040 (CoreData) [0x7fff888c75d8]
                                                  40 _execute + 214 (CoreData) [0x7fff888c7926]
                                                    40 sqlite3_step + 666 (libsqlite3.dylib) [0x7fff893be40a]
                                                      32 sqlite3VdbeExec + 68340 (libsqlite3.dylib) [0x7fff893cff44]
                                                        32 sqlite3VdbeMemFromBtree + 438 (libsqlite3.dylib) [0x7fff893db306]
                                                          29 accessPayload + 752 (libsqlite3.dylib) [0x7fff893fa6c0]
                                                            29 sqlite3PagerAcquire + 349 (libsqlite3.dylib) [0x7fff893a518d]
                                                              29 readDbPage + 478 (libsqlite3.dylib) [0x7fff893a65ee]
                                                                29 pread + 10 (libsystem_kernel.dylib) [0x7fff835a4962]
                                                                 *29 hndl_unix_scall64 + 22 (mach_kernel) [0xffffff80002f3b76]
                                                                   *29 unix_syscall64 + 499 (mach_kernel) [0xffffff800063e413]
                                                                     *29 pread_nocancel + 137 (mach_kernel) [0xffffff80005efc49]
                                                                       *29 ??? (mach_kernel + 4127438) [0xffffff80005eface]
                                                                         *29 ??? (mach_kernel + 2045365) [0xffffff80003f35b5]
                                                                           *29 VNOP_READ + 225 (mach_kernel) [0xffffff80003fda01]
                                                                             *29 hfs_vnop_read + 566 (mach_kernel) [0xffffff800056b1f6]
                                                                               *29 cluster_read_ext + 5045 (mach_kernel) [0xffffff80003d0765]
                                                                                 *28 ??? (mach_kernel + 1904306) [0xffffff80003d0eb2]
                                                                                   *28 ??? (mach_kernel + 1910723) [0xffffff80003d27c3]
                                                                                     *28 memory_object_control_uiomove + 284 (mach_kernel) [0xffffff800026cdcc]
                                                                                       *28 lck_rw_sleep + 81 (mach_kernel) [0xffffff800022d921]
                                                                                         *28 thread_block_reason + 204 (mach_kernel) [0xffffff8000235d8c]
                                                                                           *28 ??? (mach_kernel + 223627) [0xffffff800023698b]
                                                                                             *28 machine_switch_context + 354 (mach_kernel) [0xffffff80002d7e92]
                                                                                 *1  ??? (mach_kernel + 1904418) [0xffffff80003d0f22]
                                                                                   *1  ??? (mach_kernel + 1914137) [0xffffff80003d3519]
                                                                                     *1  lck_rw_lock_exclusive + 17 (mach_kernel) [0xffffff80002d0c81]
                                                          3  accessPayload + 918 (libsqlite3.dylib) [0x7fff893fa766]
                                                            3  _platform_memmove$VARIANT$Nehalem + 178 (libsystem_platform.dylib) [0x7fff8b19c092]
                                                             *3  hndl_alltraps + 219 (mach_kernel) [0xffffff80002f327b]
                                                               *3  user_trap + 748 (mach_kernel) [0xffffff80002dc2bc]
                                                                 *2  vm_fault + 5246 (mach_kernel) [0xffffff80002791be]
                                                                   *2  delay + 51 (mach_kernel) [0xffffff80002221d3]
                                                                     *2  thread_block_reason + 204 (mach_kernel) [0xffffff8000235d8c]
                                                                       *2  ??? (mach_kernel + 223627) [0xffffff800023698b]
                                                                         *2  machine_switch_context + 354 (mach_kernel) [0xffffff80002d7e92]
                                                                 *1  vm_fault + 4767 (mach_kernel) [0xffffff8000278fdf]
                                                                   *1  vm_fault_enter + 2631 (mach_kernel) [0xffffff8000277587]
                                                                     *1  pmap_enter_options + 5013 (mach_kernel) [0xffffff80002c4ef5]
                                                      7  sqlite3VdbeExec + 30051 (libsqlite3.dylib) [0x7fff893c69b3]
                                                        7  sqlite3BtreeInsert + 1205 (libsqlite3.dylib) [0x7fff893e6655]
                                                          6  allocateBtreePage + 1626 (libsqlite3.dylib) [0x7fff893ecbba]
                                                            5  sqlite3PagerAcquire + 349 (libsqlite3.dylib) [0x7fff893a518d]
                                                              5  readDbPage + 478 (libsqlite3.dylib) [0x7fff893a65ee]
                                                                5  pread + 10 (libsystem_kernel.dylib) [0x7fff835a4962]
                                                                 *5  hndl_unix_scall64 + 22 (mach_kernel) [0xffffff80002f3b76]
                                                                   *5  unix_syscall64 + 499 (mach_kernel) [0xffffff800063e413]
                                                                     *5  pread_nocancel + 137 (mach_kernel) [0xffffff80005efc49]
                                                                       *5  ??? (mach_kernel + 4127438) [0xffffff80005eface]
                                                                         *5  ??? (mach_kernel + 2045365) [0xffffff80003f35b5]
                                                                           *5  VNOP_READ + 225 (mach_kernel) [0xffffff80003fda01]
                                                                             *5  hfs_vnop_read + 566 (mach_kernel) [0xffffff800056b1f6]
                                                                               *5  cluster_read_ext + 5045 (mach_kernel) [0xffffff80003d0765]
                                                                                 *5  ??? (mach_kernel + 1905981) [0xffffff80003d153d]
                                                                                   *5  msleep + 114 (mach_kernel) [0xffffff80005e1852]
                                                                                     *5  ??? (mach_kernel + 4068901) [0xffffff80005e1625]
                                                                                       *5  lck_mtx_sleep + 78 (mach_kernel) [0xffffff800022d1be]
                                                                                         *5  thread_block_reason + 204 (mach_kernel) [0xffffff8000235d8c]
                                                                                           *5  ??? (mach_kernel + 223627) [0xffffff800023698b]
                                                                                             *5  machine_switch_context + 354 (mach_kernel) [0xffffff80002d7e92]
                                                            1  sqlite3PagerAcquire + 68 (libsqlite3.dylib) [0x7fff893a5074]
                                                              1  sqlite3PcacheFetch + 299 (libsqlite3.dylib) [0x7fff893a53fb]
                                                                1  pagerStress + 326 (libsqlite3.dylib) [0x7fff8943b736]
                                                                  1  syncJournal + 436 (libsqlite3.dylib) [0x7fff893efec4]
                                                                    1  fsync + 10 (libsystem_kernel.dylib) [0x7fff835a4392]
                                                                     *1  hndl_unix_scall64 + 22 (mach_kernel) [0xffffff80002f3b76]
                                                                       *1  unix_syscall64 + 499 (mach_kernel) [0xffffff800063e413]
                                                                         *1  ??? (mach_kernel + 2010599) [0xffffff80003eade7]
                                                                           *1  VNOP_FSYNC + 67 (mach_kernel) [0xffffff80003fe063]
                                                                             *1  hfs_vnop_fsync + 107 (mach_kernel) [0xffffff8000589fbb]
                                                                               *1  hfs_fsync + 295 (mach_kernel) [0xffffff8000586677]
                                                                                 *1  cluster_push_ext + 521 (mach_kernel) [0xffffff80003d1e39]
                                                                                   *1  vnode_waitforwrites + 227 (mach_kernel) [0xffffff80003d8693]
                                                                                     *1  msleep + 114 (mach_kernel) [0xffffff80005e1852]
                                                                                       *1  ??? (mach_kernel + 4068901) [0xffffff80005e1625]
                                                                                         *1  lck_mtx_sleep + 78 (mach_kernel) [0xffffff800022d1be]
                                                                                           *1  thread_block_reason + 204 (mach_kernel) [0xffffff8000235d8c]
                                                                                             *1  ??? (mach_kernel + 223627) [0xffffff800023698b]
                                                                                               *1  machine_switch_context + 354 (mach_kernel) [0xffffff80002d7e92]
                                                          1  allocateBtreePage + 1691 (libsqlite3.dylib) [0x7fff893ecbfb]
                                                            1  sqlite3PagerWrite + 90 (libsqlite3.dylib) [0x7fff893e330a]
                                                              1  pager_write + 1450 (libsqlite3.dylib) [0x7fff893e3e7a]
                                                                1  pwrite + 10 (libsystem_kernel.dylib) [0x7fff835a49aa]
                                                                 *1  hndl_unix_scall64 + 22 (mach_kernel) [0xffffff80002f3b76]
                                                                   *1  unix_syscall64 + 499 (mach_kernel) [0xffffff800063e413]
                                                                     *1  pwrite_nocancel + 362 (mach_kernel) [0xffffff80005f030a]
                                                                       *1  ??? (mach_kernel + 4128961) [0xffffff80005f00c1]
                                                                         *1  ??? (mach_kernel + 2046147) [0xffffff80003f38c3]
                                                                           *1  VNOP_WRITE + 225 (mach_kernel) [0xffffff80003fdb31]
                                                                             *1  hfs_vnop_write + 2472 (mach_kernel) [0xffffff800056bce8]
                                                                               *1  cluster_write + 37 (mach_kernel) [0xffffff80003cd0a5]
                                                                                 *1  cluster_write_ext + 3864 (mach_kernel) [0xffffff80003cdfc8]
                                                                                   *1  ??? (mach_kernel + 1896259) [0xffffff80003cef43]
                                                                                     *1  ubc_upl_commit_range + 136 (mach_kernel) [0xffffff8000600138]
                                                                                       *1  upl_commit_range + 3006 (mach_kernel) [0xffffff800029dd6e]
                                                      1  sqlite3VdbeExec + 4284 (libsqlite3.dylib) [0x7fff893c050c]
                                                        1  sqlite3BtreeMovetoUnpacked + 1143 (libsqlite3.dylib) [0x7fff893da8f7]
                                                          1  sqlite3PagerAcquire + 349 (libsqlite3.dylib) [0x7fff893a518d]
                                                            1  readDbPage + 478 (libsqlite3.dylib) [0x7fff893a65ee]
                                                              1  pread + 10 (libsystem_kernel.dylib) [0x7fff835a4962]
                                                               *1  hndl_unix_scall64 + 22 (mach_kernel) [0xffffff80002f3b76]
                                                                 *1  unix_syscall64 + 499 (mach_kernel) [0xffffff800063e413]
                                                                   *1  pread_nocancel + 137 (mach_kernel) [0xffffff80005efc49]
                                                                     *1  ??? (mach_kernel + 4127438) [0xffffff80005eface]
                                                                       *1  ??? (mach_kernel + 2045365) [0xffffff80003f35b5]
                                                                         *1  VNOP_READ + 225 (mach_kernel) [0xffffff80003fda01]
                                                                           *1  hfs_vnop_read + 566 (mach_kernel) [0xffffff800056b1f6]
                                                                             *1  cluster_read_ext + 5045 (mach_kernel) [0xffffff80003d0765]
                                                                               *1  ??? (mach_kernel + 1905981) [0xffffff80003d153d]
                                                                                 *1  msleep + 114 (mach_kernel) [0xffffff80005e1852]
                                                                                   *1  ??? (mach_kernel + 4068901) [0xffffff80005e1625]
                                                                                     *1  lck_mtx_sleep + 78 (mach_kernel) [0xffffff800022d1be]
                                                                                       *1  thread_block_reason + 204 (mach_kernel) [0xffffff8000235d8c]
                                                                                         *1  ??? (mach_kernel + 223627) [0xffffff800023698b]
                                                                                           *1  machine_switch_context + 354 (mach_kernel) [0xffffff80002d7e92]

它只发生在一个客户身上,并且可以在她的Mac上重现。你知道问题的根源是什么吗?我该如何解决这个错误?到目前为止我唯一知道的事情是在自动轻量级迁移期间发生崩溃并且需要花费很多时间。

0 个答案:

没有答案