Skip to content

[Bug]: crash at startup: "data parameter is nil" #3127

Description

@n8henrie

Before submitting your bug report, please confirm you have completed the following steps

Bug description

I'm getting a crash shortly after startup. Currently at itemContents = [self.source objectsForEntry:self]; in:

- (NSArray *)scannedObjects {
    NSArray *itemContents = nil;
    @autoreleasepool {
        @try {
            itemContents = [self.source objectsForEntry:self];
			for (QSObject *item in itemContents) {
				// set the source in the meta
				[item setObject:self forMeta:kCatalogSource];
			};
        }
        @catch (NSException *exception) {
            NSLog(@"An error occurred while scanning \"%@\": %@", self.name, exception);
            [exception printStackTrace];
        }
    }
    return itemContents;
}

Some LLM help suggests it's related to a "too many open files" issue, ultimately causing trouble for the emojis plugin (which needs a nil check).

The LLM has suggests a global semaphore for the catalog search to prevent the "too many open files" issue (or of course I could mess around with my ulimit / open files limit / sysctl stuff).

I think a global semaphore set to a reasonable and user-configurable limit may be helpful. Could initially implement as one set to macos's default open files limit, meaning it would not change current behavior for the vast majority of users, but could be restricted by those like myself that are running into issues (likely in part due to multiple VMs and nix-daemon running, among other things).

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000018c2971c0 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x000000018bd1291c objc_exception_throw + 88
	2   Foundation                          0x000000018da8de60 newJSONValue + 0
	3   Emojis Plugin                       0x0000000116cb1170 Emojis Plugin + 4464
	4   libdispatch.dylib                   0x0000000102b58ee0 _dispatch_client_callout + 16
	5   libdispatch.dylib                   0x0000000102b3f620 _dispatch_once_callout + 160
	6   Emojis Plugin                       0x0000000116cb0d1c Emojis Plugin + 3356
	7   Emojis Plugin                       0x0000000116cb0dd0 Emojis Plugin + 3536
	8   QSCore                              0x0000000103504698 -[QSCatalogEntry scannedObjects] + 108
	9   QSCore                              0x0000000103504e68 __30-[QSCatalogEntry scanAndCache]_block_invoke + 40
	10  libdispatch.dylib                   0x0000000102b58ee0 _dispatch_client_callout + 16
	11  libdispatch.dylib                   0x0000000102b4e9ac _dispatch_lane_barrier_sync_invoke_and_complete + 192
	12  QSFoundation                        0x0000000102c227ac QSGCDQueueSync + 136
	13  QSCore                              0x0000000103504bdc -[QSCatalogEntry scanAndCache] + 352
	14  QSCore                              0x0000000103517ad0 -[QSLibrarian loadMissingIndexes] + 408
	15  Quicksilver                         0x0000000102814fa4 -[QSController delayedStartup] + 384
	16  Quicksilver                         0x0000000102817f40 __32-[QSController startQuicksilver]_block_invoke + 36
	17  libdispatch.dylib                   0x0000000102b3c4d4 _dispatch_call_block_and_release + 32
	18  libdispatch.dylib                   0x0000000102b58ee0 _dispatch_client_callout + 16
	19  libdispatch.dylib                   0x0000000102b520ac _dispatch_root_queue_drain + 960
	20  libdispatch.dylib                   0x0000000102b52978 _dispatch_worker_thread2 + 204
	21  libsystem_pthread.dylib             0x00000001036177b8 _pthread_wqthread + 232
	22  libsystem_pthread.dylib             0x000000010361ef8c start_wqthread + 8
)
Thread 4#0	0x000000018c1305e8 in __pthread_kill ()
#1	0x0000000103616668 in pthread_kill ()
#2	0x000000018c071978 in abort ()
#3	0x000000018c12272c in __abort_message ()
#4	0x000000018c10f588 in demangling_terminate_handler ()
#5	0x000000018bd1c894 in _objc_terminate ()
#6	0x000000018c11f75c in std::__terminate ()
#7	0x000000018c121be4 in __cxxabiv1::failed_throw ()
#8	0x000000018c10e09c in __cxa_throw ()
#9	0x000000018bd12a84 in objc_exception_throw ()
#10	0x000000018da8de60 in +[NSJSONSerialization JSONObjectWithData:options:error:] ()
#11	0x0000000116cb1170 in ___lldb_unnamed_symbol_10d4 ()
#12	0x0000000102b58ee0 in _dispatch_client_callout ()
#13	0x0000000102b3f620 in _dispatch_once_callout ()
#14	0x0000000116cb0d1c in ___lldb_unnamed_symbol_cac ()
#15	0x0000000116cb0dd0 in ___lldb_unnamed_symbol_d20 ()
#16	0x0000000103504698 in -[QSCatalogEntry scannedObjects] at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-QuickStepCore/QSCatalogEntry.m:648
#17	0x0000000103504e68 in __30-[QSCatalogEntry scanAndCache]_block_invoke at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-QuickStepCore/QSCatalogEntry.m:682
#18	0x0000000102b58ee0 in _dispatch_client_callout ()
#19	0x0000000102b4e9ac in _dispatch_lane_barrier_sync_invoke_and_complete ()
#20	0x0000000102c227ac in QSGCDQueueSync at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-QuickStepFoundation/QSGCD.h:19
#21	0x0000000103504bdc in -[QSCatalogEntry scanAndCache] at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-QuickStepCore/QSCatalogEntry.m:680
#22	0x0000000103517ad0 in -[QSLibrarian loadMissingIndexes] at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-QuickStepCore/QSLibrarian.m:539
#23	0x0000000102814fa4 in -[QSController delayedStartup] at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-App/QSController.m:617
#24	0x0000000102817f40 in __32-[QSController startQuicksilver]_block_invoke at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-App/QSController.m:1128
#25	0x0000000102b3c4d4 in _dispatch_call_block_and_release ()
#26	0x0000000102b58ee0 in _dispatch_client_callout ()
#27	0x0000000102b520ac in _dispatch_root_queue_drain ()
#28	0x0000000102b52978 in _dispatch_worker_thread2 ()
#29	0x00000001036177b8 in _pthread_wqthread ()
Exception Backtrace#0	0x000000018c2971b4 in __exceptionPreprocess ()
#1	0x000000018bd1291c in objc_exception_throw ()
#2	0x000000018da8de60 in +[NSJSONSerialization JSONObjectWithData:options:error:] ()
#3	0x0000000116cb1170 in ___lldb_unnamed_symbol_10d4 ()
#4	0x0000000102b58ee0 in _dispatch_client_callout ()
#5	0x0000000102b3f620 in _dispatch_once_callout ()
#6	0x0000000116cb0d1c in ___lldb_unnamed_symbol_cac ()
#7	0x0000000116cb0dd0 in ___lldb_unnamed_symbol_d20 ()
#8	0x0000000103504698 in -[QSCatalogEntry scannedObjects] at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-QuickStepCore/QSCatalogEntry.m:648
#9	0x0000000103504e68 in __30-[QSCatalogEntry scanAndCache]_block_invoke at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-QuickStepCore/QSCatalogEntry.m:682
#10	0x0000000102b58ee0 in _dispatch_client_callout ()
#11	0x0000000102b4e9ac in _dispatch_lane_barrier_sync_invoke_and_complete ()
#12	0x0000000102c227ac in QSGCDQueueSync at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-QuickStepFoundation/QSGCD.h:19
#13	0x0000000103504bdc in -[QSCatalogEntry scanAndCache] at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-QuickStepCore/QSCatalogEntry.m:680
#14	0x0000000103517ad0 in -[QSLibrarian loadMissingIndexes] at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-QuickStepCore/QSLibrarian.m:539
#15	0x0000000102814fa4 in -[QSController delayedStartup] at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-App/QSController.m:617
#16	0x0000000102817f40 in __32-[QSController startQuicksilver]_block_invoke at /Users/n8henrie/git/qs/quicksilver/Quicksilver/Code-App/QSController.m:1128
#17	0x0000000102b3c4d4 in _dispatch_call_block_and_release ()
#18	0x0000000102b58ee0 in _dispatch_client_callout ()
#19	0x0000000102b520ac in _dispatch_root_queue_drain ()
#20	0x0000000102b52978 in _dispatch_worker_thread2 ()
#21	0x00000001036177b8 in _pthread_wqthread ()
#22	0x000000010361ef8c in start_wqthread ()

Steps to reproduce

Expected behavior

No crash

MacOS Version

26.6.1 (25G76)

Quicksilver Version

bb5aae1

Relevant Plugins

emoji

Crash Logs or Spindump

No response

Screenshots

No response

Additional info

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions