videovillage / Lattice-Issues

Feature requests, bug tracking, questions, and issues for Lattice.
https://videovillage.co/lattice
6 stars 2 forks source link

Crash when changing input bounds #97

Closed llamafilm closed 1 year ago

llamafilm commented 3 years ago

I have a typical cube LUT in the range of 0-1 that I need to convert to 0-1023 for use in an AJA Kona card. I tried using the Change Input Bounds option to change it to 0-1023 but this causes Lattice to crash. Should this work or is there another way to do this?

Process:               Lattice [2609]
Path:                  /Users/USER/*/Lattice.app/Contents/MacOS/Lattice
Identifier:            biz.lut.Lattice
Version:               1.8.15 (1804)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Lattice [2609]
User ID:               501

Date/Time:             2021-09-03 23:38:46.346 -0700
OS Version:            macOS 11.5.2 (20G95)
Report Version:        12
Bridge OS Version:     5.5 (18P4759a)
Anonymous UUID:        5D069DEF-A688-67EF-BDA0-2A3669347821

Sleep/Wake UUID:       8CE7BFBC-BC72-4DAB-9C13-1527640D07F6

Time Awake Since Boot: 350000 seconds
Time Since Wake:       8900 seconds

System Integrity Protection: enabled

Crashed Thread:        8  Dispatch queue: LUTDocument Serial Dispatch

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
*** Terminating app due to uncaught exception 'LUTCreationError', reason: 'Input Lower Bound >= Input Upper Bound'
terminating with uncaught exception of type NSException
abort() called

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff2052083b __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007fff20258d92 objc_exception_throw + 48
2   Lattice                             0x00000001096054f8 Lattice + 2807032
3   Lattice                             0x0000000109610dce Lattice + 2854350
4   Lattice                             0x0000000109610e67 Lattice + 2854503
5   Lattice                             0x0000000109607d68 Lattice + 2817384
6   Lattice                             0x00000001096159a0 Lattice + 2873760
7   Lattice                             0x00000001094ec5ce Lattice + 1656270
8   Lattice                             0x0000000109439a7d Lattice + 924285
9   Lattice                             0x0000000109439741 Lattice + 923457
10  libdispatch.dylib                   0x00007fff20202623 _dispatch_call_block_and_release + 12
11  libdispatch.dylib                   0x00007fff20203806 _dispatch_client_callout + 8
12  libdispatch.dylib                   0x00007fff202095ea _dispatch_lane_serial_drain + 606
13  libdispatch.dylib                   0x00007fff2020a0ad _dispatch_lane_invoke + 366
14  libdispatch.dylib                   0x00007fff20213c0d _dispatch_workloop_worker_thread + 811
15  libsystem_pthread.dylib             0x00007fff203aa45d _pthread_wqthread + 314
16  libsystem_pthread.dylib             0x00007fff203a942f start_wqthread + 15

Thread 0:: Dispatch queue: com.apple.main-thread
0   com.apple.coreui                0x00007fff26f59d15 -[CUIThemeFacet _renditionForSpecificKey:] + 47
1   com.apple.coreui                0x00007fff26f59ccc -[CUIThemeFacet _rendition] + 68
2   com.apple.coreui                0x00007fff26f583d1 CUICoreThemeRenderer::CopyMeasurementsForRendition(CUIRenditionKey*, CUIDescriptor const*, __CFDictionary const*, __CFArray const*, __CFDictionary*) + 273
3   com.apple.coreui                0x00007fff26f3bb93 CUIRenderer::CopyMeasurements(CGRect, CGContext*, __CFDictionary const*, __CFArray const*) + 277
4   com.apple.coreui                0x00007fff26f3ba40 CUICopyMeasurements + 184
5   com.apple.AppKit                0x00007fff22cf3762 __72-[NSAppearance _copyMeasurements:context:options:requestedMeasurements:]_block_invoke + 67
6   com.apple.AppKit                0x00007fff22cb6e8c -[NSCompositeAppearance _callCoreUIWithBlock:options:requireBezelTintColor:] + 399
7   com.apple.AppKit                0x00007fff22cf36df -[NSAppearance _copyMeasurements:context:options:requestedMeasurements:] + 176
8   com.apple.AppKit                0x00007fff22cf3415 NSVisualEffectViewGetMetadataValue + 177
9   com.apple.AppKit                0x00007fff22cf32ab -[NSVisualEffectView _preferredAppearance] + 114
10  com.apple.AppKit                0x00007fff22cd3f7c +[NSCompositeAppearance compositeAppearanceForView:] + 90
11  com.apple.AppKit                0x00007fff22cd0b9b -[NSView effectiveAppearance] + 187
12  com.apple.AppKit                0x00007fff22cd07d8 -[NSView _viewDidChangeAppearance:] + 252
13  com.apple.AppKit                0x00007fff22cce9ec -[NSView _setSuperview:] + 1366
14  com.apple.AppKit                0x00007fff22cf5ca6 -[NSView removeFromSuperview] + 140
15  com.apple.AppKit                0x00007fff22d759e6 -[NSView removeFromSuperviewWithoutNeedingDisplay] + 36
16  com.apple.AppKit                0x00007fff22cfc215 -[NSView _finalize] + 965
17  com.apple.AppKit                0x00007fff22cfbd14 -[NSView dealloc] + 119
18  com.apple.AppKit                0x00007fff231edae2 -[NSSheetEffectDimmingView dealloc] + 508
19  libobjc.A.dylib                 0x00007fff2026b20f AutoreleasePoolPage::releaseUntil(objc_object**) + 167
20  libobjc.A.dylib                 0x00007fff2024de30 objc_autoreleasePoolPop + 161
21  com.apple.CoreFoundation        0x00007fff20467a66 _CFAutoreleasePoolPop + 22
22  com.apple.Foundation            0x00007fff212080ab -[NSAutoreleasePool drain] + 131
23  com.apple.AppKit                0x00007fff22c9cc9b -[NSApplication run] + 636
24  com.apple.AppKit                0x00007fff22c70e6c NSApplicationMain + 816
25  libdyld.dylib                   0x00007fff203c8f3d start + 1

Thread 1:: com.apple.NSEventThread
0   libsystem_kernel.dylib          0x00007fff203782ba mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff2037862c mach_msg + 60
2   com.apple.CoreFoundation        0x00007fff204a6b2f __CFRunLoopServiceMachPort + 316
3   com.apple.CoreFoundation        0x00007fff204a520f __CFRunLoopRun + 1328
4   com.apple.CoreFoundation        0x00007fff204a461c CFRunLoopRunSpecific + 563
5   com.apple.AppKit                0x00007fff22e3223a _NSEventThread + 124
6   libsystem_pthread.dylib         0x00007fff203ad8fc _pthread_start + 224
7   libsystem_pthread.dylib         0x00007fff203a9443 thread_start + 15

Thread 2:: com.apple.NSURLConnectionLoader
0   libsystem_kernel.dylib          0x00007fff203782ba mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff2037862c mach_msg + 60
2   com.apple.CoreFoundation        0x00007fff204a6b2f __CFRunLoopServiceMachPort + 316
3   com.apple.CoreFoundation        0x00007fff204a520f __CFRunLoopRun + 1328
4   com.apple.CoreFoundation        0x00007fff204a461c CFRunLoopRunSpecific + 563
5   com.apple.CFNetwork             0x00007fff2494c358 0x7fff2470c000 + 2360152
6   com.apple.Foundation            0x00007fff2122d437 __NSThread__start__ + 1068
7   libsystem_pthread.dylib         0x00007fff203ad8fc _pthread_start + 224
8   libsystem_pthread.dylib         0x00007fff203a9443 thread_start + 15

Thread 3:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 4:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 6:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 7:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 8 Crashed:: Dispatch queue: LUTDocument Serial Dispatch
0   libsystem_kernel.dylib          0x00007fff2037e92e __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff203ad5bd pthread_kill + 263
2   libsystem_c.dylib               0x00007fff20302406 abort + 125
3   libc++abi.dylib                 0x00007fff20370ef2 abort_message + 241
4   libc++abi.dylib                 0x00007fff203625fd demangling_terminate_handler() + 266
5   libobjc.A.dylib                 0x00007fff2025b58d _objc_terminate() + 96
6   libc++abi.dylib                 0x00007fff20370307 std::__terminate(void (*)()) + 8
7   libc++abi.dylib                 0x00007fff203702a9 std::terminate() + 41
8   libdispatch.dylib               0x00007fff2020381a _dispatch_client_callout + 28
9   libdispatch.dylib               0x00007fff202095ea _dispatch_lane_serial_drain + 606
10  libdispatch.dylib               0x00007fff2020a0ad _dispatch_lane_invoke + 366
11  libdispatch.dylib               0x00007fff20213c0d _dispatch_workloop_worker_thread + 811
12  libsystem_pthread.dylib         0x00007fff203aa45d _pthread_wqthread + 314
13  libsystem_pthread.dylib         0x00007fff203a942f start_wqthread + 15

Thread 9:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 10:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 11:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 12:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 13:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 14:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 15:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 16:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 17:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 18:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 19:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 20:
0   libsystem_pthread.dylib         0x00007fff203a9420 start_wqthread + 0

Thread 8 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000700004609000  rcx: 0x00007000046082e8  rdx: 0x0000000000000000
  rdi: 0x0000000000017f1b  rsi: 0x0000000000000006  rbp: 0x0000700004608310  rsp: 0x00007000046082e8
   r8: 0x00007000046081b0   r9: 0x0000000000000000  r10: 0x0000000000000000  r11: 0x0000000000000246
  r12: 0x0000000000017f1b  r13: 0x0000003000000008  r14: 0x0000000000000006  r15: 0x0000000000000016
  rip: 0x00007fff2037e92e  rfl: 0x0000000000000246  cr2: 0x00007fff8097b470

Logical CPU:     0
Error Code:      0x02000148
Trap Number:     133

Thread 8 instruction stream not available.

Thread 8 last branch register state not available.
gregcotten commented 3 years ago

Hi! I'll look into this crash, thanks! You likely do not want to be changing the input bounds of the LUT - that tool is mostly there for reducing the input bounds.

In this case, you'd likely want to scale the output range by scaling the entire LUT from the 0-1 to 0-1023 using Edit->Scale->Scale Using Value with a value of 1023. The resulting preview image will be entirely white. This type of operation is fairly unusual though, I'm not familiar with the Kona cards - what LUT format does it need? Perhaps it's a format that will already scale the values appropriately, such as 3DL?

llamafilm commented 3 years ago

Oops, now I realize the Kona card can only take a 1D LUT, so the conversion I was trying to do would be invalid anyway. By the way, I noticed Lattice can already save 1D LUTs in AJA format, but the Kona card won't accept those either. I think this is a bug in AJA software, I'm discussing it with them.