Skip to content

macosx: Fix bookmarks NSInternalInconsistencyException

Clicking outside the bookmarks table would call

bookmarkForRow:(NSInteger)row

with -1 thereby causing this exception from this assertion

NSParameterAssert(row >= 0 || row < _bookmarks.count);

I'm also wondering whether the assertion should be an AND instead of an OR

2025-08-25 19:52:22.770233+0300 vlc-osx-static[36287:592225] [general] *** Assertion failure in -[VLCBookmarksTableViewDataSource bookmarkForRow:], VLCBookmarksTableViewDataSource.m:184
2025-08-25 19:52:22.777442+0300 vlc-osx-static[36287:592225] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: row >= 0 || row < _bookmarks.count'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000019b643ae0 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x000000019b106b90 objc_exception_throw + 88
	2   Foundation                          0x000000019cc53a78 -[NSCalendarDate initWithCoder:] + 0
	3   libmacosx_plugin.dylib              0x0000000100b6f998 -[VLCBookmarksTableViewDataSource bookmarkForRow:] + 188
	4   libmacosx_plugin.dylib              0x0000000100b44ae4 -[VLCBookmarksWindowController goToBookmark:] + 148
	5   AppKit                              0x000000019f694fb0 -[NSApplication(NSResponder) sendAction:to:from:] + 560
	6   AppKit                              0x000000019f694d50 -[NSControl sendAction:to:] + 72
	7   AppKit                              0x000000019f793d64 -[NSTableView _sendAction:to:row:column:] + 112
	8   AppKit    
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: row >= 0 || row < _bookmarks.count'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000019b643ae0 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x000000019b106b90 objc_exception_throw + 88
	2   Foundation                          0x000000019cc53a78 -[NSCalendarDate initWithCoder:] + 0
	3   libmacosx_plugin.dylib              0x0000000100b6f998 -[VLCBookmarksTableViewDataSource bookmarkForRow:] + 188
	4   libmacosx_plugin.dylib              0x0000000100b44ae4 -[VLCBookmarksWindowController goToBookmark:] + 148
	5   AppKit                              0x000000019f694fb0 -[NSApplication(NSResponder) sendAction:to:from:] + 560
	6   AppKit                              0x000000019f694d50 -[NSControl sendAction:to:] + 72
	7   AppKit                              0x000000019f793d64 -[NSTableView _sendAction:to:row:column:] + 112
	8   AppKit                              0x000000019f792818 -[NSTableView mouseDown:] + 4616
	9   AppKit                              0x000000019f68fbe4 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 3664
	10  AppKit                              0x000000019f61bc54 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 492
	11  AppKit                              0x000000019f61b8a0 -[NSWindow(NSEventRouting) sendEvent:] + 288
	12  AppKit                              0x000000019fe936c0 -[NSApplication(NSEventRouting) sendEvent:] + 1504
	13  AppKit                              0x000000019fa9242c -[NSApplication _handleEvent:] + 60
	14  AppKit                              0x000000019f4e8c0c -[NSApplication run] + 520
	15  libmacosx_plugin.dylib              0x0000000100b0c5f0 __OpenIntf_block_invoke + 868
	16  CoreFoundation                      0x000000019b5d26b4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
	17  CoreFoundation                      0x000000019b5d25c4 __CFRunLoopDoBlocks + 352
	18  CoreFoundation                      0x000000019b5d1a70 __CFRunLoopRun + 2384
	19  CoreFoundation                      0x000000019b5d0a98 CFRunLoopRunSpecific + 572
	20  CoreFoundation                      0x000000019b64a554 CFRunLoopRun + 64
	21  vlc-osx-static                      0x0000000100002d30 main + 1824
	22  dyld                                0x000000019b146b98 start + 6076
)
2025-08-25 19:52:22.777821+0300 vlc-osx-static[36287:592225] [General] An uncaught exception was raised
2025-08-25 19:52:22.778601+0300 vlc-osx-static[36287:592225] [General] Invalid parameter not satisfying: row >= 0 || row < _bookmarks.count
2025-08-25 19:52:22.778704+0300 vlc-osx-static[36287:592225] [General] (
	0   CoreFoundation                      0x000000019b643ae0 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x000000019b106b90 objc_exception_throw + 88
	2   Foundation                          0x000000019cc53a78 -[NSCalendarDate initWithCoder:] + 0
	3   libmacosx_plugin.dylib              0x0000000100b6f998 -[VLCBookmarksTableViewDataSource bookmarkForRow:] + 188
	4   libmacosx_plugin.dylib              0x0000000100b44ae4 -[VLCBookmarksWindowController goToBookmark:] + 148
	5   AppKit                              0x000000019f694fb0 -[NSApplication(NSResponder) sendAction:to:from:] + 560
	6   AppKit                              0x000000019f694d50 -[NSControl sendAction:to:] + 72
	7   AppKit                              0x000000019f793d64 -[NSTableView _sendAction:to:row:column:] + 112
	8   AppKit                              0x000000019f792818 -[NSTableView mouseDown:] + 4616
	9   AppKit                              0x000000019f68fbe4 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 3664
	10  AppKit                              0x000000019f61bc54 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 492
	11  AppKit                              0x000000019f61b8a0 -[NSWindow(NSEventRouting) sendEvent:] + 288
	12  AppKit                              0x000000019fe936c0 -[NSApplication(NSEventRouting) sendEvent:] + 1504
	13  AppKit                              0x000000019fa9242c -[NSApplication _handleEvent:] + 60
	14  AppKit                              0x000000019f4e8c0c -[NSApplication run] + 520
	15  libmacosx_plugin.dylib              0x0000000100b0c5f0 __OpenIntf_block_invoke + 868
	16  CoreFoundation                      0x000000019b5d26b4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
	17  CoreFoundation                      0x000000019b5d25c4 __CFRunLoopDoBlocks + 352
	18  CoreFoundation                      0x000000019b5d1a70 __CFRunLoopRun + 2384
	19  CoreFoundation                      0x000000019b5d0a98 CFRunLoopRunSpecific + 572
	20  CoreFoundation                      0x000000019b64a554 CFRunLoopRun + 64
	21  vlc-osx-static                      0x0000000100002d30 main + 1824
	22  dyld                                0x000000019b146b98 start + 6076
)
2025-08-25 19:52:22.782431+0300 vlc-osx-static[36287:592225] [HIExceptions] FAULT: NSInternalInconsistencyException: Invalid parameter not satisfying: row >= 0 || row < _bookmarks.count; {
    NSAssertFile = "VLCBookmarksTableViewDataSource.m";
    NSAssertLine = 184;
}
libc++abi: terminating due to uncaught exception of type NSException
Process 36287 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x000000019b4ae388 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x19b4ae388 <+8>:  b.lo   0x19b4ae3a8    ; <+40>
    0x19b4ae38c <+12>: pacibsp 
    0x19b4ae390 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x19b4ae394 <+20>: mov    x29, sp
Target 0: (vlc-osx-static) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x000000019b4ae388 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x000000019b4e788c libsystem_pthread.dylib`pthread_kill + 296
    frame #2: 0x000000019b3f0a3c libsystem_c.dylib`abort + 124
    frame #3: 0x000000019b49d384 libc++abi.dylib`abort_message + 132
    frame #4: 0x000000019b48bcf4 libc++abi.dylib`demangling_terminate_handler() + 344
    frame #5: 0x000000019b110dd4 libobjc.A.dylib`_objc_terminate() + 156
    frame #6: 0x000000019b49c698 libc++abi.dylib`std::__terminate(void (*)()) + 16
    frame #7: 0x000000019b49fc30 libc++abi.dylib`__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 88
    frame #8: 0x000000019b49fbd8 libc++abi.dylib`__cxa_throw + 92
    frame #9: 0x000000019b106cf8 libobjc.A.dylib`objc_exception_throw + 448
    frame #10: 0x000000019cc53a78 Foundation`-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 288
    frame #11: 0x0000000100b6f998 libmacosx_plugin.dylib`-[VLCBookmarksTableViewDataSource bookmarkForRow:](self=0x0000600000758440, _cmd="bookmarkForRow:", row=-1) at VLCBookmarksTableViewDataSource.m:184:5
    frame #12: 0x0000000100b44ae4 libmacosx_plugin.dylib`-[VLCBookmarksWindowController goToBookmark:](self=0x0000600002d11cc0, _cmd="goToBookmark:", sender=0x00000001370cca00) at VLCBookmarksWindowController.m:143:36
    frame #13: 0x000000019f694fb0 AppKit`-[NSApplication(NSResponder) sendAction:to:from:] + 560
    frame #14: 0x000000019f694d50 AppKit`-[NSControl sendAction:to:] + 72
    frame #15: 0x000000019f793d64 AppKit`-[NSTableView _sendAction:to:row:column:] + 112
    frame #16: 0x000000019f792818 AppKit`-[NSTableView mouseDown:] + 4616
    frame #17: 0x000000019f68fbe4 AppKit`-[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 3664
    frame #18: 0x000000019f61bc54 AppKit`-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 492
    frame #19: 0x000000019f61b8a0 AppKit`-[NSWindow(NSEventRouting) sendEvent:] + 288
    frame #20: 0x000000019fe936c0 AppKit`-[NSApplication(NSEventRouting) sendEvent:] + 1504
    frame #21: 0x000000019fa9242c AppKit`-[NSApplication _handleEvent:] + 60
    frame #22: 0x000000019f4e8c0c AppKit`-[NSApplication run] + 520
    frame #23: 0x0000000100b0c5f0 libmacosx_plugin.dylib`__OpenIntf_block_invoke(.block_descriptor=0x0000600000901e00) at VLCMain.m:196:13
    frame #24: 0x000000019b5d26b4 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
    frame #25: 0x000000019b5d25c4 CoreFoundation`__CFRunLoopDoBlocks + 352
    frame #26: 0x000000019b5d1a70 CoreFoundation`__CFRunLoopRun + 2384
    frame #27: 0x000000019b5d0a98 CoreFoundation`CFRunLoopRunSpecific + 572
    frame #28: 0x000000019b64a554 CoreFoundation`CFRunLoopRun + 64
    frame #29: 0x0000000100002d30 vlc-osx-static`main(i_argc=1, ppsz_argv=0x000000016fdff568) at darwinvlc.m:313:9
    frame #30: 0x000000019b146b98 dyld`start + 6076
Edited by Bob Moriasi

Merge request reports

Loading