Subject: Re: bug#57267: 28.1; emacs crashes when loading too many images

From: [email-masked]
Date: Fri, 19 Aug 2022 10:18:35 -0400

-------------------------------------------------------------------------------
$ git log --oneline -1
8f1d0295bc (HEAD -> master, origin/master, origin/HEAD) Speed up image-dired-display-image
(END)
-------------------------------------------------------------------------------
src/ $ lldb emacs
Emacs debugging support has been installed.
(lldb) target create "emacs"
Current executable set to '/Users/james/Code/emacs/src/emacs' (x86_64).
(lldb) r
Process 92880 launched: '/Users/james/Code/emacs/src/emacs' (x86_64)
2022-08-19 10:09:18.742470-0400 emacs[92880:17395371] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=92880
2022-08-19 10:09:18.742614-0400 emacs[92880:17395371] SecTaskCopyDebugDescription: emacs[92880]/0#-1 LF=0
2022-08-19 10:09:20.003006-0400 emacs[92880:17395371] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=92880
2022-08-19 10:09:20.003162-0400 emacs[92880:17395371] SecTaskCopyDebugDescription: emacs[92880]/0#-1 LF=0
2022-08-19 10:09:20.622858-0400 emacs[92880:17395371] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=92880
2022-08-19 10:09:20.622985-0400 emacs[92880:17395371] SecTaskCopyDebugDescription: emacs[92880]/0#-1 LF=0
2022-08-19 10:09:20.623744-0400 emacs[92880:17395371] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=92880
2022-08-19 10:09:20.623835-0400 emacs[92880:17395371] SecTaskCopyDebugDescription: emacs[92880]/0#-1 LF=0
2022-08-19 10:09:42.014642-0400 emacs[92880:17395371] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit
2022-08-19 10:09:53.021061-0400 emacs[92880:17395371] MTLIOAccelDevice bad MetalPluginClassName property (null)
2022-08-19 10:09:53.024056-0400 emacs[92880:17395371] +[MTLIOAccelDevice registerDevices]: Zero Metal services found
2022-08-19 10:09:53.075267-0400 emacs[92880:17395371] VPA info: plugin is INTEL, AVD_id = 1080080, AVD_api.Create:0x12651cb3f
2022-08-19 10:09:53.126184-0400 emacs[92880:17395371] VPA info: plugin is INTEL, AVD_id = 1080080, AVD_api.Create:0x12651cb3f
2022-08-19 10:09:53.160436-0400 emacs[92880:17395371] VPA info: plugin is INTEL, AVD_id = 1080080, AVD_api.Create:0x12651cb3f
2022-08-19 10:09:53.301888-0400 emacs[92880:17395371] fopen failed for data file: errno = 2 (No such file or directory)
2022-08-19 10:09:53.301916-0400 emacs[92880:17395371] Errors found! Invalidating cache...
2022-08-19 10:09:53.442872-0400 emacs[92880:17395371] fopen failed for data file: errno = 2 (No such file or directory)
2022-08-19 10:09:53.442902-0400 emacs[92880:17395371] Errors found! Invalidating cache...
2022-08-19 10:09:58.789535-0400 emacs[92880:17395371] VPA info: plugin is INTEL, AVD_id = 1080080, AVD_api.Create:0x12651cb3f
2022-08-19 10:09:59.866566-0400 emacs[92880:17395371] VPA info: plugin is INTEL, AVD_id = 1080080, AVD_api.Create:0x12651cb3f
2022-08-19 10:10:00.138473-0400 emacs[92880:17395371] VPA info: plugin is INTEL, AVD_id = 1080080, AVD_api.Create:0x12651cb3f
Process 92880 stopped
* thread #17, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000000000000
error: memory read failed for 0x0
Target 0: (emacs) stopped.
-------------------------------------------------------------------------------
(lldb) bt
* thread #17, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000000000000
    frame #1: 0x00007fff31a448da AppleVPA`___lldb_unnamed_symbol479$$AppleVPA + 336
    frame #2: 0x00007fff31a427ec AppleVPA`___lldb_unnamed_symbol455$$AppleVPA + 254
    frame #3: 0x00007fff204a48fc libsystem_pthread.dylib`_pthread_start + 224
    frame #4: 0x00007fff204a0443 libsystem_pthread.dylib`thread_start + 15
-------------------------------------------------------------------------------
(lldb) thread select 1
* thread #1, queue = 'com.apple.main-thread'
    frame #0: 0x00007fff2046fd76 libsystem_kernel.dylib`__mmap + 10
libsystem_kernel.dylib`__mmap:
->  0x7fff2046fd76 <+10>: jae    0x7fff2046fd80            ; <+20>
    0x7fff2046fd78 <+12>: movq   %rax, %rdi
    0x7fff2046fd7b <+15>: jmp    0x7fff2046fac9            ; cerror_nocancel
    0x7fff2046fd80 <+20>: retq
-------------------------------------------------------------------------------
(lldb) bt
* thread #1, queue = 'com.apple.main-thread'
  * frame #0: 0x00007fff2046fd76 libsystem_kernel.dylib`__mmap + 10
    frame #1: 0x0000000102f00609 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::internal_mmap(void*, unsigned long, int, int, int, unsigned long long) + 25
    frame #2: 0x0000000102f03690 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::MmapFixedImpl(unsigned long, unsigned long, bool, char const*) + 128
    frame #3: 0x0000000102eacea6 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >::PopulateFreeArray(__sanitizer::AllocatorStats*, unsigned long, __sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >::RegionInfo*, unsigned long) + 230
    frame #4: 0x0000000102eacd7d libclang_rt.asan_osx_dynamic.dylib`__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >::GetFromAllocator(__sanitizer::AllocatorStats*, unsigned long, unsigned int*, unsigned long) + 621
    frame #5: 0x0000000102eaca56 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> > >::Refill(__sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> > >::PerClass*, __sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >*, unsigned long) + 54
    frame #6: 0x0000000102eac709 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::CombinedAllocator<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >, __sanitizer::LargeMmapAllocatorPtrArrayDynamic>::Allocate(__sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> > >*, unsigned long, unsigned long) + 489
    frame #7: 0x0000000102ea8320 libclang_rt.asan_osx_dynamic.dylib`__asan::Allocator::Allocate(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType, bool) + 592
    frame #8: 0x0000000102ea80a9 libclang_rt.asan_osx_dynamic.dylib`__asan::asan_malloc(unsigned long, __sanitizer::BufferedStackTrace*) + 41
    frame #9: 0x0000000102ee93ff libclang_rt.asan_osx_dynamic.dylib`wrap_malloc + 255
    frame #10: 0x00007fff2843e5a6 Metal`-[MTLResourceList initWithCapacity:] + 143
    frame #11: 0x00007fff2843e4ad Metal`MTLResourceListPoolCreateResourceList + 118
    frame #12: 0x00007fff2843e2b9 Metal`MTLIOAccelCommandBufferStorageCreateExt + 365
    frame #13: 0x00007fff2843e09e Metal`MTLIOAccelCommandBufferStoragePoolCreateStorage + 102
    frame #14: 0x00007fff2843db2d Metal`-[MTLIOAccelCommandBuffer initWithQueue:retainedReferences:synchronousDebugMode:] + 148
    frame #15: 0x00007fff6522af75 AppleIntelICLGraphicsMTLDriver`-[MTLIGAccelCommandBuffer initWithQueue:retainedReferences:synchronousDebugMode:] + 54
    frame #16: 0x00007fff6522adc0 AppleIntelICLGraphicsMTLDriver`-[MTLIGAccelCommandBuffer initWithQueue:retainedReferences:] + 56
    frame #17: 0x00007fff651e8829 AppleIntelICLGraphicsMTLDriver`-[MTLIGAccelCommandQueue commandBuffer] + 45
    frame #18: 0x00007fff2bc7db7c VideoToolbox`___lldb_unnamed_symbol1120$$VideoToolbox + 2281
    frame #19: 0x00007fff2bbb3e81 VideoToolbox`VTMetalTransferSessionTransferImageSync + 297
    frame #20: 0x00007fff2bbd5f07 VideoToolbox`___lldb_unnamed_symbol120$$VideoToolbox + 11979
    frame #21: 0x00007fff2bbb1a6e VideoToolbox`VTPixelTransferSessionTransferImage + 1259
    frame #22: 0x00007fff2c4e30b9 MediaToolbox`___lldb_unnamed_symbol11295$$MediaToolbox + 4079
    frame #23: 0x00007fff2c4e38ac MediaToolbox`___lldb_unnamed_symbol11295$$MediaToolbox + 6114
    frame #24: 0x00007fff2c0515b9 MediaToolbox`FigPhotoScaleAndRotateSessionTransformForSize + 247
    frame #25: 0x00007fff2c3afdea MediaToolbox`___lldb_unnamed_symbol7966$$MediaToolbox + 2665
    frame #26: 0x00007fff2c3acb81 MediaToolbox`___lldb_unnamed_symbol7929$$MediaToolbox + 74
    frame #27: 0x00007fff2c060c88 MediaToolbox`FigPhotoDecompressionContainerCreateImageForIndex + 81
    frame #28: 0x00007fff28b7ccac ImageIO`AppleJPEGReadPlugin::copyIOSurfaceCallback(InfoRec*, CGImageProvider*, __CFDictionary const*) + 802
    frame #29: 0x00007fff28b7d570 ImageIO`AppleJPEGReadPlugin::createImageBlockSetWithHardwareDecode(InfoRec*, CGImageProvider*, CGSize, __CFDictionary const*) + 154
    frame #30: 0x00007fff28b0f679 ImageIO`AppleJPEGReadPlugin::copyImageBlockSet(InfoRec*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 1955
    frame #31: 0x00007fff28b0e998 ImageIO`IIO_Reader::CopyImageBlockSetProc(void*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 100
    frame #32: 0x00007fff28b2c527 ImageIO`IIOImageProviderInfo::copyImageBlockSetWithOptions(CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 663
    frame #33: 0x00007fff28b0e8d0 ImageIO`IIOImageProviderInfo::CopyImageBlockSetWithOptions(void*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 680
    frame #34: 0x00007fff250e076b CoreGraphics`CGImageCreateSubsampledImage + 594
    frame #35: 0x00007fff250e0000 CoreGraphics`ripc_DrawImage + 507
    frame #36: 0x00007fff250df4f7 CoreGraphics`CGContextDrawImageWithOptions + 454
    frame #37: 0x00007fff22f119c5 AppKit`__74-[NSImageRep drawInRect:fromRect:operation:fraction:respectFlipped:hints:]_block_invoke + 902
    frame #38: 0x00007fff22f114fa AppKit`-[NSImageRep drawInRect:fromRect:operation:fraction:respectFlipped:hints:] + 936
    frame #39: 0x00007fff233b1dbc AppKit`__71-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:]_block_invoke.1340 + 967
    frame #40: 0x00007fff22eea8b9 AppKit`-[NSImage _usingBestRepresentationForRect:context:hints:body:] + 129
    frame #41: 0x00007fff22f10ec1 AppKit`-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:] + 1359
    frame #42: 0x0000000100a1a9ce emacs`ns_dumpglyphs_image(s=0x00007ffeefbf5a60, r=(origin = (x = 10, y = 566), size = (width = 700, height = 163))) at nsterm.m:3952:7
    frame #43: 0x0000000100a08bf9 emacs`ns_draw_glyph_string(s=0x00007ffeefbf5a60) at nsterm.m:4349:7
    frame #44: 0x000000010019cf87 emacs`draw_glyphs(w=0x0000621002048520, x=348, row=0x000062a00001e600, area=TEXT_AREA, start=0, end=26, hl=DRAW_NORMAL_TEXT, overlaps=0) at xdisp.c:30449:5
    frame #45: 0x0000000100193680 emacs`gui_write_glyphs(w=0x0000621002048520, updated_row=0x000062a00001e600, start=0x000062600036f100, updated_area=TEXT_AREA, len=26) at xdisp.c:32509:7
    frame #46: 0x0000000100048563 emacs`update_text_area(w=0x0000621002048520, updated_row=0x000062a00001e600, vpos=4, partial_p=0x00007ffeefbf8000) at dispnew.c:3981:2
    frame #47: 0x000000010003e371 emacs`update_window_line(w=0x0000621002048520, vpos=4, mouse_face_overwritten_p=0x00007ffeefbf83a0) at dispnew.c:4239:11
    frame #48: 0x0000000100013e1d emacs`update_window(w=0x0000621002048520, force_p=true) at dispnew.c:3719:19
    frame #49: 0x00000001000154dc emacs`update_window_tree(w=0x0000621002048520, force_p=true) at dispnew.c:3444:14
    frame #50: 0x0000000100012156 emacs`update_frame(f=0x0000621002046130, force_p=true, inhibit_hairy_id_p=false) at dispnew.c:3279:18
    frame #51: 0x0000000100122312 emacs`redisplay_internal at xdisp.c:17096:14
    frame #52: 0x0000000100135fd9 emacs`redisplay at xdisp.c:16103:3
    frame #53: 0x00000001004a9efe emacs`read_char(commandflag=1, map=(EMACS_INT) $1 = 27092655099956, prev_event=(struct Lisp_Symbol *) $4 = 0x000000010125d880, used_mouse_menu=0x00007ffeefbfd340, end_time=0x0000000000000000) at keyboard.c:2643:6
    frame #54: 0x00000001004a1b04 emacs`read_key_sequence(keybuf=(struct Lisp_Symbol *) $7 = 0x000000010125d880, prompt=(struct Lisp_Symbol *) $10 = 0x000000010125d880, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:10045:12
    frame #55: 0x000000010049bf96 emacs`command_loop_1 at keyboard.c:1384:15
    frame #56: 0x0000000100713bc9 emacs`internal_condition_case(bfun=(emacs`command_loop_1 at keyboard.c:1277), handlers=(struct Lisp_Symbol *) $13 = 0x000000010125d910, hfun=(emacs`cmd_error at keyboard.c:935)) at eval.c:1497:25
    frame #57: 0x000000010049b013 emacs`command_loop_2(handlers=(struct Lisp_Symbol *) $16 = 0x000000010125d910) at keyboard.c:1132:11
    frame #58: 0x0000000100712009 emacs`internal_catch(tag=(struct Lisp_Symbol *) $19 = 0x000000010126c280, func=(emacs`command_loop_2 at keyboard.c:1128), arg=(struct Lisp_Symbol *) $22 = 0x000000010125d910) at eval.c:1220:25
    frame #59: 0x000000010049919f emacs`command_loop at keyboard.c:1110:2
    frame #60: 0x0000000100498c8e emacs`recursive_edit_1 at keyboard.c:719:9
    frame #61: 0x0000000100499b33 emacs`Frecursive_edit at keyboard.c:802:3
    frame #62: 0x00000001004918be emacs`main(argc=1, argv=0x00007ffeefbff310) at emacs.c:2517:3
    frame #63: 0x00007fff204bff3d libdyld.dylib`start + 1
-------------------------------------------------------------------------------
(lldb) bt all
* thread #1, queue = 'com.apple.main-thread'
  * frame #0: 0x00007fff2046fd76 libsystem_kernel.dylib`__mmap + 10
    frame #1: 0x0000000102f00609 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::internal_mmap(void*, unsigned long, int, int, int, unsigned long long) + 25
    frame #2: 0x0000000102f03690 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::MmapFixedImpl(unsigned long, unsigned long, bool, char const*) + 128
    frame #3: 0x0000000102eacea6 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >::PopulateFreeArray(__sanitizer::AllocatorStats*, unsigned long, __sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >::RegionInfo*, unsigned long) + 230
    frame #4: 0x0000000102eacd7d libclang_rt.asan_osx_dynamic.dylib`__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >::GetFromAllocator(__sanitizer::AllocatorStats*, unsigned long, unsigned int*, unsigned long) + 621
    frame #5: 0x0000000102eaca56 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> > >::Refill(__sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> > >::PerClass*, __sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >*, unsigned long) + 54
    frame #6: 0x0000000102eac709 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::CombinedAllocator<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> >, __sanitizer::LargeMmapAllocatorPtrArrayDynamic>::Allocate(__sanitizer::SizeClassAllocator64LocalCache<__sanitizer::SizeClassAllocator64<__asan::AP64<__sanitizer::LocalAddressSpaceView> > >*, unsigned long, unsigned long) + 489
    frame #7: 0x0000000102ea8320 libclang_rt.asan_osx_dynamic.dylib`__asan::Allocator::Allocate(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType, bool) + 592
    frame #8: 0x0000000102ea80a9 libclang_rt.asan_osx_dynamic.dylib`__asan::asan_malloc(unsigned long, __sanitizer::BufferedStackTrace*) + 41
    frame #9: 0x0000000102ee93ff libclang_rt.asan_osx_dynamic.dylib`wrap_malloc + 255
    frame #10: 0x00007fff2843e5a6 Metal`-[MTLResourceList initWithCapacity:] + 143
    frame #11: 0x00007fff2843e4ad Metal`MTLResourceListPoolCreateResourceList + 118
    frame #12: 0x00007fff2843e2b9 Metal`MTLIOAccelCommandBufferStorageCreateExt + 365
    frame #13: 0x00007fff2843e09e Metal`MTLIOAccelCommandBufferStoragePoolCreateStorage + 102
    frame #14: 0x00007fff2843db2d Metal`-[MTLIOAccelCommandBuffer initWithQueue:retainedReferences:synchronousDebugMode:] + 148
    frame #15: 0x00007fff6522af75 AppleIntelICLGraphicsMTLDriver`-[MTLIGAccelCommandBuffer initWithQueue:retainedReferences:synchronousDebugMode:] + 54
    frame #16: 0x00007fff6522adc0 AppleIntelICLGraphicsMTLDriver`-[MTLIGAccelCommandBuffer initWithQueue:retainedReferences:] + 56
    frame #17: 0x00007fff651e8829 AppleIntelICLGraphicsMTLDriver`-[MTLIGAccelCommandQueue commandBuffer] + 45
    frame #18: 0x00007fff2bc7db7c VideoToolbox`___lldb_unnamed_symbol1120$$VideoToolbox + 2281
    frame #19: 0x00007fff2bbb3e81 VideoToolbox`VTMetalTransferSessionTransferImageSync + 297
    frame #20: 0x00007fff2bbd5f07 VideoToolbox`___lldb_unnamed_symbol120$$VideoToolbox + 11979
    frame #21: 0x00007fff2bbb1a6e VideoToolbox`VTPixelTransferSessionTransferImage + 1259
    frame #22: 0x00007fff2c4e30b9 MediaToolbox`___lldb_unnamed_symbol11295$$MediaToolbox + 4079
    frame #23: 0x00007fff2c4e38ac MediaToolbox`___lldb_unnamed_symbol11295$$MediaToolbox + 6114
    frame #24: 0x00007fff2c0515b9 MediaToolbox`FigPhotoScaleAndRotateSessionTransformForSize + 247
    frame #25: 0x00007fff2c3afdea MediaToolbox`___lldb_unnamed_symbol7966$$MediaToolbox + 2665
    frame #26: 0x00007fff2c3acb81 MediaToolbox`___lldb_unnamed_symbol7929$$MediaToolbox + 74
    frame #27: 0x00007fff2c060c88 MediaToolbox`FigPhotoDecompressionContainerCreateImageForIndex + 81
    frame #28: 0x00007fff28b7ccac ImageIO`AppleJPEGReadPlugin::copyIOSurfaceCallback(InfoRec*, CGImageProvider*, __CFDictionary const*) + 802
    frame #29: 0x00007fff28b7d570 ImageIO`AppleJPEGReadPlugin::createImageBlockSetWithHardwareDecode(InfoRec*, CGImageProvider*, CGSize, __CFDictionary const*) + 154
    frame #30: 0x00007fff28b0f679 ImageIO`AppleJPEGReadPlugin::copyImageBlockSet(InfoRec*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 1955
    frame #31: 0x00007fff28b0e998 ImageIO`IIO_Reader::CopyImageBlockSetProc(void*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 100
    frame #32: 0x00007fff28b2c527 ImageIO`IIOImageProviderInfo::copyImageBlockSetWithOptions(CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 663
    frame #33: 0x00007fff28b0e8d0 ImageIO`IIOImageProviderInfo::CopyImageBlockSetWithOptions(void*, CGImageProvider*, CGRect, CGSize, __CFDictionary const*) + 680
    frame #34: 0x00007fff250e076b CoreGraphics`CGImageCreateSubsampledImage + 594
    frame #35: 0x00007fff250e0000 CoreGraphics`ripc_DrawImage + 507
    frame #36: 0x00007fff250df4f7 CoreGraphics`CGContextDrawImageWithOptions + 454
    frame #37: 0x00007fff22f119c5 AppKit`__74-[NSImageRep drawInRect:fromRect:operation:fraction:respectFlipped:hints:]_block_invoke + 902
    frame #38: 0x00007fff22f114fa AppKit`-[NSImageRep drawInRect:fromRect:operation:fraction:respectFlipped:hints:] + 936
    frame #39: 0x00007fff233b1dbc AppKit`__71-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:]_block_invoke.1340 + 967
    frame #40: 0x00007fff22eea8b9 AppKit`-[NSImage _usingBestRepresentationForRect:context:hints:body:] + 129
    frame #41: 0x00007fff22f10ec1 AppKit`-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:] + 1359
    frame #42: 0x0000000100a1a9ce emacs`ns_dumpglyphs_image(s=0x00007ffeefbf5a60, r=(origin = (x = 10, y = 566), size = (width = 700, height = 163))) at nsterm.m:3952:7
    frame #43: 0x0000000100a08bf9 emacs`ns_draw_glyph_string(s=0x00007ffeefbf5a60) at nsterm.m:4349:7
    frame #44: 0x000000010019cf87 emacs`draw_glyphs(w=0x0000621002048520, x=348, row=0x000062a00001e600, area=TEXT_AREA, start=0, end=26, hl=DRAW_NORMAL_TEXT, overlaps=0) at xdisp.c:30449:5
    frame #45: 0x0000000100193680 emacs`gui_write_glyphs(w=0x0000621002048520, updated_row=0x000062a00001e600, start=0x000062600036f100, updated_area=TEXT_AREA, len=26) at xdisp.c:32509:7
    frame #46: 0x0000000100048563 emacs`update_text_area(w=0x0000621002048520, updated_row=0x000062a00001e600, vpos=4, partial_p=0x00007ffeefbf8000) at dispnew.c:3981:2
    frame #47: 0x000000010003e371 emacs`update_window_line(w=0x0000621002048520, vpos=4, mouse_face_overwritten_p=0x00007ffeefbf83a0) at dispnew.c:4239:11
    frame #48: 0x0000000100013e1d emacs`update_window(w=0x0000621002048520, force_p=true) at dispnew.c:3719:19
    frame #49: 0x00000001000154dc emacs`update_window_tree(w=0x0000621002048520, force_p=true) at dispnew.c:3444:14
    frame #50: 0x0000000100012156 emacs`update_frame(f=0x0000621002046130, force_p=true, inhibit_hairy_id_p=false) at dispnew.c:3279:18
    frame #51: 0x0000000100122312 emacs`redisplay_internal at xdisp.c:17096:14
    frame #52: 0x0000000100135fd9 emacs`redisplay at xdisp.c:16103:3
    frame #53: 0x00000001004a9efe emacs`read_char(commandflag=1, map=(EMACS_INT) $24 = 27092655099956, prev_event=(struct Lisp_Symbol *) $27 = 0x000000010125d880, used_mouse_menu=0x00007ffeefbfd340, end_time=0x0000000000000000) at keyboard.c:2643:6
    frame #54: 0x00000001004a1b04 emacs`read_key_sequence(keybuf=(struct Lisp_Symbol *) $30 = 0x000000010125d880, prompt=(struct Lisp_Symbol *) $33 = 0x000000010125d880, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:10045:12
    frame #55: 0x000000010049bf96 emacs`command_loop_1 at keyboard.c:1384:15
    frame #56: 0x0000000100713bc9 emacs`internal_condition_case(bfun=(emacs`command_loop_1 at keyboard.c:1277), handlers=(struct Lisp_Symbol *) $36 = 0x000000010125d910, hfun=(emacs`cmd_error at keyboard.c:935)) at eval.c:1497:25
    frame #57: 0x000000010049b013 emacs`command_loop_2(handlers=(struct Lisp_Symbol *) $39 = 0x000000010125d910) at keyboard.c:1132:11
    frame #58: 0x0000000100712009 emacs`internal_catch(tag=(struct Lisp_Symbol *) $42 = 0x000000010126c280, func=(emacs`command_loop_2 at keyboard.c:1128), arg=(struct Lisp_Symbol *) $45 = 0x000000010125d910) at eval.c:1220:25
    frame #59: 0x000000010049919f emacs`command_loop at keyboard.c:1110:2
    frame #60: 0x0000000100498c8e emacs`recursive_edit_1 at keyboard.c:719:9
    frame #61: 0x0000000100499b33 emacs`Frecursive_edit at keyboard.c:802:3
    frame #62: 0x00000001004918be emacs`main(argc=1, argv=0x00007ffeefbff310) at emacs.c:2517:3
    frame #63: 0x00007fff204bff3d libdyld.dylib`start + 1
  thread #4, name = 'gmain'
    frame #0: 0x00007fff20477646 libsystem_kernel.dylib`__select + 10
    frame #1: 0x00000001029f056b libglib-2.0.0.dylib`g_poll + 505
    frame #2: 0x00000001029e3c2a libglib-2.0.0.dylib`g_main_context_iterate + 340
    frame #3: 0x00000001029e3cd8 libglib-2.0.0.dylib`g_main_context_iteration + 55
    frame #4: 0x00000001029e4e35 libglib-2.0.0.dylib`glib_worker_main + 30
    frame #5: 0x0000000102a06ff2 libglib-2.0.0.dylib`g_thread_proxy + 66
    frame #6: 0x00007fff204a48fc libsystem_pthread.dylib`_pthread_start + 224
    frame #7: 0x00007fff204a0443 libsystem_pthread.dylib`thread_start + 15
  thread #5
    frame #0: 0x00007fff20473d52 libsystem_kernel.dylib`__pselect + 10
    frame #1: 0x00007fff20473c6f libsystem_kernel.dylib`pselect$DARWIN_EXTSN + 42
    frame #2: 0x00000001009b2be5 emacs`-[EmacsApp fd_handler:](self=0x0000612000024640, _cmd="fd_handler:", unused=0x0000000000000000) at nsterm.m:6303:20
    frame #3: 0x00007fff21325447 Foundation`__NSThread__start__ + 1068
    frame #4: 0x00007fff204a48fc libsystem_pthread.dylib`_pthread_start + 224
    frame #5: 0x00007fff204a0443 libsystem_pthread.dylib`thread_start + 15
  thread #6, name = 'com.apple.NSEventThread'
    frame #0: 0x00007fff2046f2aa libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x00007fff2046f61c libsystem_kernel.dylib`mach_msg + 60
    frame #2: 0x00007fff2059cecf CoreFoundation`__CFRunLoopServiceMachPort + 316
    frame #3: 0x00007fff2059b5af CoreFoundation`__CFRunLoopRun + 1328
    frame #4: 0x00007fff2059a9bc CoreFoundation`CFRunLoopRunSpecific + 563
    frame #5: 0x00007fff22f29bba AppKit`_NSEventThread + 124
    frame #6: 0x00007fff204a48fc libsystem_pthread.dylib`_pthread_start + 224
    frame #7: 0x00007fff204a0443 libsystem_pthread.dylib`thread_start + 15
  thread #8
    frame #0: 0x00007fff2047094e libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x00007fff204a14c1 libsystem_pthread.dylib`_pthread_wqthread + 414
    frame #2: 0x00007fff204a042f libsystem_pthread.dylib`start_wqthread + 15
  thread #10
    frame #0: 0x00007fff2047094e libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x00007fff204a14c1 libsystem_pthread.dylib`_pthread_wqthread + 414
    frame #2: 0x00007fff204a042f libsystem_pthread.dylib`start_wqthread + 15
  thread #11
    frame #0: 0x00007fff204a0420 libsystem_pthread.dylib`start_wqthread
  thread #13
    frame #0: 0x00007fff204a0420 libsystem_pthread.dylib`start_wqthread
  thread #14
    frame #0: 0x00007fff204a0420 libsystem_pthread.dylib`start_wqthread
  thread #15
    frame #0: 0x00007fff204a0420 libsystem_pthread.dylib`start_wqthread
  thread #16
    frame #0: 0x00007fff204a0420 libsystem_pthread.dylib`start_wqthread
  thread #17
    frame #0: 0x0000000000000000
    frame #1: 0x00007fff31a448da AppleVPA`___lldb_unnamed_symbol479$$AppleVPA + 336
    frame #2: 0x00007fff31a427ec AppleVPA`___lldb_unnamed_symbol455$$AppleVPA + 254
    frame #3: 0x00007fff204a48fc libsystem_pthread.dylib`_pthread_start + 224
    frame #4: 0x00007fff204a0443 libsystem_pthread.dylib`thread_start + 15
(lldb)

-------------------------------------------------------------------------------

2022-08-19 10:09:53.301888-0400 emacs[92880:17395371] fopen failed for data file: errno = 2 (No such file or directory) (hmnn?)

This time I had to use:

/Users/james/Code/emacs/src/emacs

instead of $ lldb ../nextstep/Emacs.app/Contents/MacOS/Emacs (which crashed on startup)

-------------------------------------------------------------------------------

> On Aug 19, 2022, at 3:22 AM, Gerd Möllmann <[email-masked]> wrote:
> 
> Gerd Möllmann <[email-masked]> writes:
> 
>> This could be heap corruption, I think.
>> 
>> Can you please build Emacs with ASAN?  Something like:
>> 
>>  git clean -xdf
> 
> Sorry I forgot: before that, please also git pull, and show what Git
> version you are using.
> 
>  git log --oneline -1