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 when evaluating query that uses @count on list of primitive #5491

Closed
mitevdev opened this issue Nov 27, 2017 · 3 comments
Closed

Crash when evaluating query that uses @count on list of primitive #5491

mitevdev opened this issue Nov 27, 2017 · 3 comments

Comments

@mitevdev
Copy link

mitevdev commented Nov 27, 2017

class Entry: Object {
   let tags = List<String>()
}

and then later:

realm.objects(Entry.self).filter("tags.@count == 0")

Goals

fetch entries having no tags

Expected Results

Results instance

Actual Results

Exception EXC_BAD_ACCESS (code=1, address=0x0) in

  • thread Adds new unit test for cursors. #10, name = 'RLMRealm notification listener', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    • frame #0: 0x0000000100462794 Realmrealm::LinkMap::map_links(unsigned long, unsigned long, realm::LinkMapFunction&) + 52 frame #1: 0x000000010046242b Realmrealm::LinkCount::evaluate(unsigned long, realm::ValueBase&) + 65
      frame Support for 'float' and 'double' column types and a lot of other fixes #2: 0x000000010045ff93 Realmrealm::Compare<realm::Equal, long long, realm::Subexpr, realm::Subexpr>::find_first(unsigned long, unsigned long) const + 113 frame #3: 0x00000001006ed410 Realmrealm::ParentNode::aggregate_local(realm::QueryStateBase_, unsigned long, unsigned long, unsigned long, realm::SequentialGetterBase_) + 144
      frame Explicit string size - Obj-C #4: 0x000000010067c15a Realmrealm::Query::aggregate_internal(realm::Action, realm::DataType, bool, realm::ParentNode_, realm::QueryStateBase_, unsigned long, unsigned long, realm::SequentialGetterBase*) const + 314 frame #5: 0x0000000100680ad8 Realmrealm::Query::find_all(realm::TableViewBase&, unsigned long, unsigned long, unsigned long) const + 440
      frame Tutorial (./examples/tutorial.m) ready for inspection and upload if found ok. #6: 0x0000000100681ff6 Realmrealm::Query::find_all(unsigned long, unsigned long, unsigned long) + 102 frame #7: 0x000000010041485b Realmrealm::impl::ResultsNotifier::run() + 119
      frame Fix for memory leakage when typed tables are created in a group. #8: 0x00000001004054c2 Realmrealm::_impl::RealmCoordinator::run_async_notifiers() + 1730 frame #9: 0x0000000100404da8 Realmrealm::impl::RealmCoordinator::on_change() + 18
      frame Adds new unit test for cursors. #10: 0x00000001003eba11 Realmrealm::_impl::ExternalCommitHelper::listen() + 191 frame #11: 0x00000001003ebe2e Realmstd::*1::*async_funcrealm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0::operator()() + 18
      frame Update examples #12: 0x00000001003ebdba Realmstd::*1::*async_assoc_state<void, std::*1::*async_func<realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0> >::__execute() + 26 frame #13: 0x00000001003ebf4b Realmstd::*1::*thread_proxy<std::*1::tuple<std::*1::unique_ptr<std::*1::*thread_struct, std::*1::default_deletestd::*1::*thread_struct >, void (std::*1::*async_assoc_state<void, std::*1::__async_funcrealm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0 >::
      )(), std::*1::*async_assoc_state<void, std::*1::*async_funcrealm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::_impl::RealmCoordinator&)::$_0 >
      > >(void_, void_) + 62
      frame added xcode project to examples #14: 0x00000001052f26c1 libsystem_pthread.dylib_pthread_body + 340 frame #15: 0x00000001052f256d libsystem_pthread.dylib_pthread_start + 377
      frame Now using new Descriptor based API (Spec is no longer a public class) #16: 0x00000001052f1c5d libsystem_pthread.dylib`thread_start + 13

Steps to Reproduce

create and store Instance of Entry and try to filter using @count aggregate function == 0

Version of Realm and Tooling

ProductName:	Mac OS X
ProductVersion:	10.13.1
BuildVersion:	17B48

/Applications/Xcode.app/Contents/Developer
Xcode 9.1
Build version 9B55


(not in use here)

/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)


(not in use here)

/usr/bin/git
git version 2.13.6 (Apple Git-96)
@bdash
Copy link
Contributor

bdash commented Nov 27, 2017

Note that queries involving arrays of primitives are not yet supported (#5334). We should be catching this and throwing a meaningful exception, though.

@bdash bdash changed the title Exception when using @count on List of primitive type String Crash when evaluating query that uses @count on list of primitive Nov 27, 2017
@mitevdev
Copy link
Author

Correct. This is exactly what I was expecting once I realised that arrays of primitives are not supported in queries yet.

@tgoyne
Copy link
Member

tgoyne commented Feb 26, 2021

This was implemented in 10.7.0.

@tgoyne tgoyne closed this as completed Feb 26, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants