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

Crash on realm.add(entity, update: update) #5400

Closed
demensdeum opened this issue Oct 16, 2017 · 1 comment
Closed

Crash on realm.add(entity, update: update) #5400

demensdeum opened this issue Oct 16, 2017 · 1 comment

Comments

@demensdeum
Copy link

demensdeum commented Oct 16, 2017

Realm framework version: 2.10.2

Xcode version: 9.0 (9A235)

iOS/OSX version: 11.0 (15A372)

Dependency manager + version: Framework included into project by copy


Got crash EXC_BAD_ACCESS in Realm-Swift only for one object, stack trace:

#0 0x00000001069dac5a in objc_retain ()
#1 0x000000010bbd44c1 in RLMAccessorContext::propertyValue(objc_object*, unsigned long, RLMProperty*) ()
#2 0x000000010bbd57ce in RLMAccessorContext::value_for_property(objc_object*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, unsigned long) ()
#3 0x000000010bbf718c in realm::Object realm::Object::create<objc_object* __strong, RLMAccessorContext>(RLMAccessorContext&, std::__1::shared_ptrrealm::Realm const&, realm::ObjectSchema const&, objc_object* __strong, bool, realm::BasicRowrealm::Table) ()
#4 0x000000010bbf6caa in RLMAddObjectToRealm ()
#5 0x000000010bbd5501 in realm::BasicRowExprrealm::Table RLMAccessorContext::unbox<realm::BasicRowExprrealm::Table >(objc_object
, bool, bool) ()
#6 0x000000010bbd9c38 in auto realm::List::dispatch<void realm::List::add<objc_object* __strong&, RLMAccessorContext>(RLMAccessorContext&, objc_object* __strong&&&, bool)::'lambda'(objc_object* __strong&)>(objc_object* __strong&&&) const ()
#7 0x000000010bbdab8a in void RLMAccessorContext::enumerate_list<void realm::List::assign<objc_object* __strong&, RLMAccessorContext>(RLMAccessorContext&, objc_object* __strong&&&, bool)::'lambda'(objc_object* __strong&&&)>(objc_object*, objc_object* __strong&&&) ()
#8 0x000000010bbdaa5d in void realm::List::assign<objc_object* __strong&, RLMAccessorContext>(RLMAccessorContext&, objc_object* __strong&&&, bool) ()
#9 0x000000010bbda5d6 in void realm::Object::set_property_value_impl<objc_object* __strong, RLMAccessorContext>(RLMAccessorContext&, realm::Property const&, objc_object* __strong, bool, bool) ()
#10 0x000000010bbf72a7 in realm::Object realm::Object::create<objc_object* __strong, RLMAccessorContext>(RLMAccessorContext&, std::__1::shared_ptrrealm::Realm const&, realm::ObjectSchema const&, objc_object* __strong, bool, realm::BasicRowrealm::Table) ()
#11 0x000000010bbf6caa in RLMAddObjectToRealm ()
#12 0x000000010bbd5501 in realm::BasicRowExprrealm::Table RLMAccessorContext::unbox<realm::BasicRowExprrealm::Table >(objc_object
, bool, bool) ()
#13 0x000000010bbd9c38 in auto realm::List::dispatch<void realm::List::add<objc_object* __strong&, RLMAccessorContext>(RLMAccessorContext&, objc_object* __strong&&&, bool)::'lambda'(objc_object* __strong&)>(objc_object* __strong&&&) const ()
#14 0x000000010bbdab8a in void RLMAccessorContext::enumerate_list<void realm::List::assign<objc_object* __strong&, RLMAccessorContext>(RLMAccessorContext&, objc_object* __strong&&&, bool)::'lambda'(objc_object* __strong&&&)>(objc_object*, objc_object* __strong&&&) ()
#15 0x000000010bbdaa5d in void realm::List::assign<objc_object* __strong&, RLMAccessorContext>(RLMAccessorContext&, objc_object* __strong&&&, bool) ()
#16 0x000000010bbda5d6 in void realm::Object::set_property_value_impl<objc_object* __strong, RLMAccessorContext>(RLMAccessorContext&, realm::Property const&, objc_object* __strong, bool, bool) ()
#17 0x000000010bbf72a7 in realm::Object realm::Object::create<objc_object* __strong, RLMAccessorContext>(RLMAccessorContext&, std::__1::shared_ptrrealm::Realm const&, realm::ObjectSchema const&, objc_object* __strong, bool, realm::BasicRowrealm::Table) ()
#18 0x000000010bbf6caa in RLMAddObjectToRealm ()
#19 0x000000010bbd5501 in realm::BasicRowExprrealm::Table RLMAccessorContext::unbox<realm::BasicRowExprrealm::Table >(objc_object
, bool, bool) ()
#20 0x000000010bbd9c38 in auto realm::List::dispatch<void realm::List::add<objc_object* __strong&, RLMAccessorContext>(RLMAccessorContext&, objc_object* __strong&&&, bool)::'lambda'(objc_object* __strong&)>(objc_object* __strong&&&) const ()
#21 0x000000010bbdab8a in void RLMAccessorContext::enumerate_list<void realm::List::assign<objc_object* __strong&, RLMAccessorContext>(RLMAccessorContext&, objc_object* __strong&&&, bool)::'lambda'(objc_object* __strong&&&)>(objc_object*, objc_object* __strong&&&) ()
#22 0x000000010bbdaa5d in void realm::List::assign<objc_object* __strong&, RLMAccessorContext>(RLMAccessorContext&, objc_object* __strong&&&, bool) ()
#23 0x000000010bbda5d6 in void realm::Object::set_property_value_impl<objc_object* __strong, RLMAccessorContext>(RLMAccessorContext&, realm::Property const&, objc_object* __strong, bool, bool) ()
#24 0x000000010bbf72a7 in realm::Object realm::Object::create<objc_object* __strong, RLMAccessorContext>(RLMAccessorContext&, std::__1::shared_ptrrealm::Realm const&, realm::ObjectSchema const&, objc_object* __strong, bool, realm::BasicRowrealm::Table*) ()
#25 0x000000010bbf6caa in RLMAddObjectToRealm ()
#26 0x000000010c297cbb in Realm.add(_:update:) ()

I guess dead object call?

Crashing on static_cast, git source code screenshot attached:
screen shot 2017-10-16 at 20 05 58

@demensdeum
Copy link
Author

Ok it was stupid mistake with type:

var action_text: String? -> @objc dynamic var action_text : String?

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

No branches or pull requests

1 participant