App crashes when I try to search after the index is loaded.
-
The main cause of the previous issue: #4 The main cause was that the index file,
images.uform3-image-text-english-small.usearch, was missing both in the project and target membership. After manually adding the index file, the app can read theimageIndexfrom the bundle file. -
However, the app crashes if I try to search after the index is fully loaded. I wonder that USearchIndex.load() might need a fix. This also happens when I load the index file saved by a previous PR: #7
Xcode: 16.1 MacOS: Sonoma 14.7.1 Device: iPhone 16 Plus - iOS 18.0 Simulator: iPhone 16 - iOS 18. 1, iPhone SE 3rd Gen - iOS 17.5
Console Log:
Wants to filter images by B
libc++abi: terminating due to uncaught exception of type std::runtime_error: No available threads to lock
Type: studio
Stack images:
Is it using the newest USearch? Can you try calling "reserve" before "search"?
Is it using the newest USearch?
Yes, it's the main branch
Can you try calling "reserve" before "search"?
After adding reserve before search, the crash is resolved. I will prepare a P.R. for this.
BTW, I wonder how this resolved the crash. Would you explain about this a little bit?
Sure, @Hyukjae-Jang! I've made a mistake in the complex logic of pre-allocating thread-specific pools after the index is loaded into memory. Reserving memory allocates the needed buffers. Thanks!
@Hyukjae-Jang, just FYI, that should a PR to the USearch Obj-C binding. Specifically the load interface. Thanks again!
PR is opened (https://github.com/ashvardanian/SwiftSemanticSearch/pull/9). Please take a look.
BTW, will there be a patch for this issue on the USearch Obj-C binding side?
@ashvardanian will there be a patch on the USearch Obj-C binding side?
@cnhhoang850, I'm currently more focused on the algorithmic improvements than specific bindings. I've merged some of the proposed patches. Which one are you interested in?