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

Realm Is Crashing At Startup #3320

Closed
chodges opened this issue Mar 12, 2016 · 4 comments
Closed

Realm Is Crashing At Startup #3320

chodges opened this issue Mar 12, 2016 · 4 comments
Assignees
Labels

Comments

@chodges
Copy link

chodges commented Mar 12, 2016

I am using Realm (0.98.4)
iOS 9.2 SDK
Xcode 7.2.1
Swift

My app is crashing the first time I attempt to open a realm. But it is only happening so far on my iPhone 5. On the iPhone 6 the app works perfectly.

Here is code:

..... In the App Delegate .....

   func setupRealm(){
       var config = Realm.Configuration()
        config.path = NSURL.fileURLWithPath(config.path!)
             .URLByDeletingLastPathComponent?
             .URLByAppendingPathComponent("vflicks.realm")
            .path

       Realm.Configuration.defaultConfiguration = config
  }

.... And in the initial Table View ....

  var realm : Realm?

  override func viewDidLoad() {
    super.viewDidLoad()

    self.title = "My App"

    self.realm = try! Realm()   < =======  This is where the app is crashing

}

The exception is happening in this code

static void commit_and_continue_as_read(SharedGroup& sg)
{
    sg.commit_and_continue_as_read();   <-===== This is where exception 
}

Here's the contents of sg:

  sg    realm::SharedGroup &    0x1633cc00  0x1633cc00
  m_group   realm::Group        
  m_read_lock   realm::SharedGroup::ReadLockInfo        
  m_local_max_entry uint_fast32_t   32  32
  m_file    realm::util::File       
  m_file_map    realm::util::File::Map<realm::SharedGroup::SharedInfo>      
  m_reader_map  realm::util::File::Map<realm::SharedGroup::SharedInfo>      
  m_wait_for_change_enabled bool    true    true
  m_lockfile_path   std::__1::string    "/var/mobile/Containers/Data/Application/B128D6F7-7934-4E2A-8F17-C7E005B37E70/Documents/vflicks.realm.lock" 
 m_db_path  std::__1::string    "/var/mobile/Containers/Data/Application/B128D6F7-7934-4E2A-8F17-C7E005B37E70/Documents/vflicks.realm"  
 m_key  const char *    NULL    0x00000000
 m_transact_stage   realm::SharedGroup::TransactStage   transact_Writing    transact_Writing
 m_handover_lock    realm::util::Mutex      
 m_room_to_write    realm::util::PlatformSpecificCondVar        
 m_work_to_do   realm::util::PlatformSpecificCondVar        
 m_daemon_becomes_ready realm::util::PlatformSpecificCondVar        
 m_new_commit_available realm::util::PlatformSpecificCondVar        

Here's the trace:

Thread 1Queue : com.apple.main-thread (serial)
#0 0x38800fe0 in OSAtomicCompareAndSwap64Barrier ()
#1 0x38805b92 in _pthread_cond_signal ()
#2 0x0147815a in realm::SharedGroup::low_level_commit(unsigned long long) ()
#3 0x01477d14 in realm::SharedGroup::do_commit() ()
#4 0x01478342 in realm::SharedGroup::commit_and_continue_as_read() ()
#5 0x013addca in realm::_impl::SharedGroupFriend::commit_and_continue_as_read(realm::SharedGroup&) at /Users/christopherhodges/Development/voiceflicks/Pods/Realm/include/core/realm/group_shared.hpp:1108
#6 0x013addb6 in realm::LangBindHelper::commit_and_continue_as_read(realm::SharedGroup&) at /Users/christopherhodges/Development/voiceflicks/Pods/Realm/include/core/realm/lang_bind_helper.hpp:372
#7 0x013a7546 in realm::_impl::transaction::commit(realm::SharedGroup&, realm::BindingContext*) at /Users/christopherhodges/Development/voiceflicks/Pods/Realm/Realm/ObjectStore/impl/transact_log_handler.cpp:451
#8 0x013a3018 in realm::Realm::commit_transaction() at /Users/christopherhodges/Development/voiceflicks/Pods/Realm/Realm/ObjectStore/shared_realm.cpp:318
#9 0x013a234e in realm::Realm::update_schema(std::__1::unique_ptr<realm::Schema, std::__1::default_deleterealm::Schema >, unsigned long long) at /Users/christopherhodges/Development/voiceflicks/Pods/Realm/Realm/ObjectStore/shared_realm.cpp:254
#10 0x0137fbba in +[RLMRealm realmWithConfiguration:error:] at /Users/christopherhodges/Development/voiceflicks/Pods/Realm/Realm/RLMRealm.mm:374
#11 0x017a0b80 in @nonobjc RLMRealm.__allocating_init(configuration : RLMRealmConfiguration) throws -> RLMRealm ()
#12 0x0179c6f8 in Realm.init(configuration : Realm.Configuration) throws -> Realm at /Users/christopherhodges/Development/voiceflicks/Pods/RealmSwift/RealmSwift/Realm.swift:75
#13 0x0179cb78 in Realm.__allocating_init(configuration : Realm.Configuration) throws -> Realm ()
#14 0x00019880 in VoiceflicksTableViewController.viewDidLoad() -> () at /Users/christopherhodges/Development/voiceflicks/voiceflicks/VoiceflicksTableViewController.swift:27
#15 0x0001996c in @objc VoiceflicksTableViewController.viewDidLoad() -> () ()
#16 0x2aa8922e in -UIViewController loadViewIfRequired
#17 0x2ab4358e in -UINavigationController _layoutViewController:
#18 0x2ab43488 in -UINavigationController _updateScrollViewFromViewController:toViewController:
#19 0x2ab4282c in -UINavigationController _startTransition:fromViewController:toViewController:
#20 0x2ab4247e in -UINavigationController _startDeferredTransitionIfNeeded:
#21 0x2ab420c4 in -UINavigationController __viewWillLayoutSubviews
#22 0x2ab4203e in -UILayoutContainerView layoutSubviews
#23 0x2aa8539a in -UIView(CALayerDelegate) layoutSublayersOfLayer:
#24 0x2a35667c in -CALayer layoutSublayers
#25 0x2a351d78 in CA::Layer::layout_if_needed(CA::Transaction*) ()
#26 0x2a351c08 in CA::Layer::layout_and_display_if_needed(CA::Transaction*) ()
#27 0x2a351128 in CA::Context::commit_transaction(CA::Transaction*) ()
#28 0x2a350dea in CA::Transaction::commit() ()
#29 0x2a34a5be in CA::Transaction::observer_callback(CFRunLoopObserver, unsigned long, void) ()
#30 0x26975cd0 in CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION ()
#31 0x26973fc6 in __CFRunLoopDoObservers ()
#32 0x268c6da8 in CFRunLoopRunSpecific ()
#33 0x268c6b7c in CFRunLoopRunInMode ()
#34 0x2aaf4bde in -UIApplication _run
#35 0x2aaef99c in UIApplicationMain ()
#36 0x00025f0c in main at /Users/christopherhodges/Development/voiceflicks/voiceflicks/AppDelegate.swift:17

@jpsim jpsim changed the title Realm Is Crashing At Startup Realm Is Crashing At Startup Mar 12, 2016
@jpsim jpsim added the T-Help label Mar 12, 2016
@chodges
Copy link
Author

chodges commented Mar 12, 2016

Interestingly after reading through a few other people's issues with the latest build (0.98.4) I downgraded to 0.98.3 and everything works fine now.

@ppamorim
Copy link

@chodges Not working yet...

@TheHmmka
Copy link

Yep, not working! I created the same issue but with Objective C!
Works fine with simulator but iPhone 4s with iOS 8.4.1 is crashing...

@bdash
Copy link
Contributor

bdash commented Mar 14, 2016

Thanks for the report, @chodges. We're tracking this issue via #3321.

@bdash bdash closed this as completed Mar 14, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants